I ported the Luau scripting language

I’ve got Luau ported from Roblox. It’s backwardly compatible to Lua 5.1 and I’m testing it on 32-bit right now. Unlike Lua, Luau has a kind of Python3-style duck-typing mechanism when not running old Lua code. I’m building and testing on 32-bit under QEmu at the moment. It may have much superior execution speeds to the original Lua as well due to improvements to the bytecode.

The downside compared to Lua is that Lua is compiled in C while Luau has been rewritten in C++17 in the bytecode compiler and C++11 in the interpreter. I’ll let you know how the testing turns out once the emulator finishes building and running the unit-tests.

Update

One conformance test fails on 64-bit but it is not related to the changes I made. 32-bit has the BuiltinFolding test fail but not 64-bit. Maybe it’s using the x86_64 direct code generator that causes the builtin folding to fail in one but not the other.

8 Likes

Update

After a few rounds of reviews, my pull request upstream has just been approved at the Roblox organization on GitHub. Luau should build for Haiku on ToT and in future releases.

3 Likes

JIT on anything less than an AVX capable PC isn’t planned so maybe this isn’t so useful after all.

It does still work from what I’ve read in the link you posted, but falls back to the slower interpreter.
So it’s very useful for modern computers where AVX is available, and still useful but a bit slower on older computers where it isn’t.
I don’t see the big problem here, but maybe I forgot something?

Maybe when RISC-V starts to see Haiku ports it will be more useful. For x86, there is already LuaJIT which is about the same speed as Luau.

Just merged on today’s weekly upstreaming.

2 Likes