> I saw recently that Python 3.14 is rewriting the core interpreter loop
> <
https://docs.python.org/3.14/whatsnew/3.14.html#whatsnew314-tail-call> to
> take advantage of tail calls, for dramatic performance improvements. I also
> remember that as of 5.0, Lua uses a plain while-switch
> <
https://www.lua.org/doc/jucs05.pdf> as its core loop, not reaping these
> benefits.
>
> My question is, has this changed since that article was written, and if
> not, are there plans to change it in the future? If not with tail calls,
> then perhaps with computed goto, or some other equivalent method.
As Pierre pointed out, the standard source uses while-switch, but since
version 5.4.0 it also offers the option to use computed goto's (jump
tables) when available. That is the default when compiling with gcc; see
the macro LUA_USE_JUMPTABLE in 'lvm.c' and the file 'ljumptab.h'.
At least for Lua, that change brings performance improvements, but they
are far from "dramatic" :-) Something in the order of 5~10%...
-- Roberto