3 ms·
Another really cool and intricate aspect of your compiler is that scanning/parsing/generation are all done in a single pass. I'm not too convinced whether there
by bluetomcat 9y ago
Another really cool and intricate aspect of your compiler is that scanning/parsing/generation are all done in a single pass. I'm not too convinced whether there is a practical benefit to that, but it certainly contributes to the small size of the compiler and reduces the memory footprint, since it eliminates the need for keeping the list of tokens or the parse tree in memory, effectively only using the stack as storage?
- nils-m-holm 9y agoThe biggest benefit is simplicity, the greatest drawback is lack of extensibility (optimizer, etc). Memory footprint is not really optimal, because T3X9 keeps both the entire source code and the entire executable in memory all the time. I wanted fast compilation, though. For small footprint, I would have made it a two-pass compiler. An early T3X compiler ran in tiny on DOS (64KB for code and data).