4 ms·
Looking at the source "boils down to a switch statement" appears to be a chain of ifs. It makes me wonder how fast it would have been to use tail calls. Also
by Dylan16807 14y ago
Looking at the source "boils down to a switch statement" appears to be a chain of ifs. It makes me wonder how fast it would have been to use tail calls.
Also possibly worth noting is that lua 5.1 bytecode has gotos, if you're willing to step down a level.
- david-given 14y agoClue 0.3 did precisely that. Unfortunately it required a patched Lua to produce the special bytecode. I decided that that was cheating --- plus it meant the Lua backend wouldn't generate code for LuaJIT. Changing it to generate tail calls would be an excellent idea, but to do it right would require a major rewrite of the backend (most of the code generator is common code).