5/21/2025 at 6:06:07 PM
Disclaimer: I've contributed to Lune multiple times and have contributed off and on to Luau as well.For those who aren't familiar, Luau is a language based on Lua that is developed and maintained by Roblox. It's entirely open source (you can see the repo here: https://github.com/luau-lang/luau) and it's diverged a fair bit from Lua at this point. Most notably, it's quite a bit faster than the PUC-Rio distribution of Lua, has native vector support, and has a type checker. It's not as fast as LuaJIT, but it's about as fast as you can expect for a non-JITed language and it has support for AoT compiling to native instructions on x86 and aarch64, so it can be basically as fast as LuaJIT for some tasks.
It's worth reading the website: https://luau.org/
Lune itself is nice and I use it for basically all of the scripting needs I have. Some of the API is limited compared to what you'd get in other runtimes (the obvious example is hashing, where it's just "string in, string out" instead of a stream that you can feed into and then finalize) but the logic is essentially that APIs should be "good enough" for the average user, not perfect. I think that's fine, but I'm also the one that wrote the hashing API so take it with a grain of salt. :-)
by Dekkonot
5/21/2025 at 9:44:28 PM
Luau also has some special features to make running untrusted user code.Lua itself has a bit of a reputation for this, but it isn't quite true. For example, normal Lua doesn't really let you stop the execution of a program stuck in an infinite loop, either accidentally or maliciously.
by miki123211
5/21/2025 at 6:18:04 PM
Does it compile to wasm? So that it is useful inside the browser?by merb
5/21/2025 at 6:28:37 PM
Luau itself does by design, but I've never tried compiling Lune to WASM. I know that there are some blockers with the Roblox library but that's an optional component and you can just leave it out.The WASM build is actually what powers the demo on their website: https://luau.org/demo
by Dekkonot
5/22/2025 at 2:06:57 PM
Hey! Yet another long-term contributor to Lune, and this is something I've experimented with for a while, but it wasn't possible due to our heavy reliance on Tokio for async I/O for a while. That has recently changed though, so I'm curious if that has changed much. I might try again and report back here.However, I should mention that there is another Luau runtime called cart which has the sole goal of being heavily portable across environments -- and it supports running within WASM! You can even interact with JS APIs and mutate the DOM to write websites with it, if you wanted to.
by CompeyDev