Some days ago I started to think about making a custom BASIC interpreter for the X16. This interpreter would take advantage of the entire memory map and the capabilities of the X16.
It's still "on paper", right now I got a very small prototype that is able to read a number from the prompt and that's all. I started to write the code into the banked RAM, but I get some issues due to wanting to use the other banks so I need to find out how to get my program in one of the banked ROM instead.
To explain how I see this project, I'd like to use the RAM banks to store the variables (and why not the BASIC programs). Also, considering the speed of the X16, I'd like to see if we can tokenize the lines instead of storing plain text. This would take off the need to optimize every bit of BASIC line, making your programs unreadable, but also that needs more processing in order to tokenize the line and "untokenize" it when listing. Running pre-tokenized lines will likely make BASIC runtine faster.
For variable names, I'd see a "VARTAB" section that contains the two characters of the variable followed by the address of it. Lines of BASIC that uses the variable would get a pointer to a line of the VARTAB. in case the variable changes (like for strings), only the VARTAB entry changes its address.
constant values will be tokenized as well so it'll be stored in variable space (or in a constant space) without any entries in VARTAB.
I imagined some variable types like INT16, INT32, FLOAT16, STRING, ARRAY, etc... And even a special type that represents a segment of free space.
I think I'm getting a bit messy in my explanations, so I'm stopping for now. Nothing's fixed, I'm just trying to get some ideas / feedback and maybe some of you may be interested to participate in this ?
@rje If I remember correctly, you worked on a tokenizer already ? Do you think this project may be viable ?
I'm doing that just to learn how that work so if all of this is a bad idea, at least I got some fun imagining the thing and doing the prototype.