My Tiny BASIC Implementation
Friday, 9th August 2019
I've fleshed out some of the details of my Tiny BASIC implementation plan. Although I want to stick to the original specification, with no arrays, string handling, functions or other fripperies, there are some additional features I want to include to make programming in Tiny BASIC less painful.
1. The original interpreter had no REM (comment) or blank line support. I'd like to add these as an option that can be switched off for full compatibility checking. I could also add a feature that produces an output listing with the REM lines and blank lines stripped out, so that you can edit readable source code but still have it run on the original Tiny BASIC.
2. The original interpreter, like most BASICs of the day, required line numbers for each line of the program. I'd like the option to omit unnecessary line numbers, i.e. lines that are not the target of a GOTO or GOSUB. Again, this can be an option that can be switched off for full compatibility checking. An additional feature would be, similar to the comment handling, the facility of producing an output listing with the missing line numbers filled in.
Some additional options around line numbers would be diresable. First, to lift the original limit of 255, which on machines with modern amounts of memory can be a bit of a restriction. 32767 would be a more sensible maximum. And if a programmer wishes to omit unnecessary line numbers, then maybe the line numbers they do supply can be arbitrary in order, simply being treated as numeric labels like in early Fortran compilers.
The overriding concern with compatibility is that my implementation can run code for the original interpreter from the 1970s. A seconary concern of helping someone write code that would also run on that original interpreter is served by having the aforementioned options of stricter compatibility checks.