by aduermael on 10/20/23, 11:41 PM with 24 comments
by xwowsersx on 10/21/23, 4:57 AM
> Luau is syntactically backwards-compatible with Lua 5.1 (code that is valid Lua 5.1 is also valid Luau); however, we have extended the language with a set of syntactical features that make the language more familiar and ergonomic.
by cloudmike on 10/21/23, 4:54 AM
For context, I first started using Luau as an experimental hack by integrating it with Unity. I mostly just wanted fast and simple hot reloading. I found myself writing more and more of it, and now I'm writing most of my code in it.
VS Code support is pretty good via the luau-lsp language server [2]. Type support for certain code patterns isn't great yet, but there are RFCs to improve this.
They're also quietly working on native code gen and JIT support, e.g. this PR from a few hours ago [3].
Overall, recommended! You're not crazy.
[1] https://twitter.com/kineticpoet
by anttiharju on 10/21/23, 7:41 AM
edit: Nitter link for convenience https://nitter.net/petrih3/status/1532738882030260225
by Dekkonot on 10/21/23, 3:50 PM
I would generally recommend Luau over Lua in most cases. If you don't need the simplicity that Lua provides (C is a lot easier to compile than C++), there's no contest to me, especially for game development.
LuaJIT is great, but if you plan to ship to mobile or console, you can't use JIT. You could use its FFI library, but that's the only real advantage.
Luau, however, has a bunch. Its interpreter as often as fast as LuaJIT's interpreter (without JIT), it's improved weekly with a variety of optimizations, and you have a killer feature: native vectors. For game development or heavy math code, that's a really big deal because it means vectors live directly on the stack and aren't garbage collected, making them very fast. Luau also has some very nice QOL and of course type checking.
There's some disadvantages, mind you. The most notable one is that as far as I'm aware all tooling for Luau comes from Roblox users. The Luau LSP extension someone linked earlier, as an example, is developed by a Roblox user. Luau also doesn't implement tailcalls, which might matter to you. I forget the reasoning but it was mostly a UX thing.
There's also no native integers and there probably won't ever be. LuaJIT and Lua 5.3+ have support for 64-bit integers but Luau doesn't, since they have complicated semantics if you want them to be first class citizens and a lot of Luau users are children.
by kkukshtel on 10/31/23, 4:03 PM
by JieJie on 10/21/23, 4:34 AM
https://www.wowhead.com/guide/comprehensive-beginners-guide-...
by sitkack on 10/21/23, 5:49 AM
Is there a transpired from Luau to Lua? Otherwise you could never go back, you would eventually be forced to use their run time. Do they have an interpreter only mode? Can you run on web assembly?
by blayden on 10/21/23, 4:31 AM
by soliton_ on 10/21/23, 9:30 AM
by jwatte on 10/21/23, 4:14 AM
by silenced_trope on 10/21/23, 4:19 AM
From looking at the Github repo's contributors, forks, etc it doesn't look like it.
ChatGPT says it isn't used outside of Roblox, but google found this cross-dev game framework that has their own variant they've started: giderosmobile.com. But Google doesn't show anyone else?