Luau’s Performance
20 points by gnyeki
20 points by gnyeki
I remain baffled that people capable of performing these kinds of advanced optimizations could also be the same people who looked at Lua and said "tail-call optimization? don't need that; let's get rid of it".
I had to remind myself:
Tail calls are not supported to simplify implementation, make debugging/stack traces more predictable and allow deep validation of caller identity for security
I don’t know. Considering the environment and audience they need to support for this, having more command over control flow is probably the right bet. But as a “general purpose, everyone should use luau”? I’d rather not.
luau doesn't have tail-call optimization? good lord
i'm definitely spoiled but i very much take tail-call optimization for granted and the idea of a language deliberately not having that boggles the mind
Not just "deliberately left it out" but "forked from a VM which had it, and took extra steps to remove it".
Really nice read. Makes me want to go back to my lua-to-c compiler for pico8. I had implemented some of the optimizations mentioned here, but never finished it
I’m curious about the objective here. Isn’t the draw of pico-8 that you have a single environment for everything and you get to use Lua for game code? Or is your objective run a cart -> native executable compilation process?
In that case, why not target TIC-80 which has a permissive license?
My goal was to run pico8 on an embedded processor (esp32), which is not fast enough to run the games otherwise. The project worked ok, but was at "90%" (eg: the game celeste worked)
TIC gives too much freedom in this regard -- multiple programming languages, higher cpu and graphics requirements. The constraints are what makes it possible