In the lexer, strings are now stored on an arena and are NULL terminated. Once the string is evaluated in the interpreter, the string is copied and GC allocated. For static strings, we can omit the copying and instead simply store a pointer to the arena containing the string. Since strings are immutable, this works out nicely.
It is important that the arena storing the strings are not cleared during the entire lifetime of a slash program. Currently, the arena used is the ast_arena which is reset after each run of the interpreter. A solution could be to create a StringArena or something which is never reset during a programs lifetime.
In the lexer, strings are now stored on an arena and are NULL terminated. Once the string is evaluated in the interpreter, the string is copied and GC allocated. For static strings, we can omit the copying and instead simply store a pointer to the arena containing the string. Since strings are immutable, this works out nicely.
It is important that the arena storing the strings are not cleared during the entire lifetime of a slash program. Currently, the arena used is the ast_arena which is reset after each run of the interpreter. A solution could be to create a StringArena or something which is never reset during a programs lifetime.