3 ms·
Depends on the BASIC, and the Forth!
by veltas 5y ago
Depends on the BASIC, and the Forth!
- timbit42 5y agoForth is always faster than interpreted BASIC. The speed of compiled BASIC depends on the compiler. Some compilers did very little and didn't increase the speed much because they tried to remain compatible with the ROM BASIC in the system. Compiled BASICs which went their own way were as fast as Forth, occasionally faster.
- veltas 5y agoI think of an example like the ZX Spectrum which is pseudo-compiled. Stuff like addresses for goto line references and variable addresses were pre-baked (I think?), it was stored tokenised, and the maths library was stack-based like Forth. Under the hood they don't even have to be that different, tokenised Forths are a thing. And Forths and BASICs can be fast or slow, really depends how much time is spent optimising.