Page 1 of 1

Luau went open source

Posted: Wed Nov 03, 2021 8:00 pm
by MartimDev
Luau is a typed scripting language derived from Lua developed by some team at Roblox. This language is backwards compatible with Lua 5.1 and it does not implement Just-In-Time compilation but its own interpreter, which is often competitive with LuaJIT interpreter on a wide set of benchmarks.

Luau is now open source under the MIT license.
Info: https://luau-lang.org/ <-Really recommend you check this out.
Repo: https://github.com/Roblox/luau

Hopefully some of you can have fun with this! :awesome:
It would be even cooler if you were able to make löve2d use luau or some version of lua 5.3.

Re: Luau went open source

Posted: Fri Nov 05, 2021 3:41 pm
by ddabrahim
It would be even cooler if you were able to make löve2d use luau or some version of lua 5.3.
Maybe it is a noob question but what benefit Luau has over Lua and LuaJIT? Is it something really worth considering? Just curious.

Re: Luau went open source

Posted: Fri Nov 05, 2021 6:10 pm
by MrFariator
At a glance, Luau seems like a good candidate if you're dealing with a distributed environment (like Roblox), where users are running a lot of user-written code. This is because they have taken great efforts to sandboxing the language better than standard Lua and LuaJIT, so that it's harder to access the underlying system running the code. As such, if you're developing something where security is a major concern Luau may be better suited for your embedded scripting needs.

Beyond that, it's basically another variant based on lua 5.1, with a seemingly decent runtime performance (according to them, would like to see some tests and graphs). Surprisingly, they claim that in their implementation pairs() and ipairs() have comparable performance, which seems neat. They also implemented an incremental garbage collector, which may be of use to some. It doesn't have a JIT compiler, however, but it's something they might think of doing in the future now that the language is open source.

For the average LÖVE developer, however, Luau doesn't do anything all that special.

Re: Luau went open source

Posted: Sun Nov 14, 2021 12:57 pm
by ddabrahim
Thank you for the explanation.

Actually I do like some of the syntactical features they added in Luau:
https://luau-lang.org/syntax

Type annotation and function types

Code: Select all

x:number
name:string
isJump:boolean
getPosition() -> number
If-Then-Else expression

Code: Select all

local maxValue = if a > b then a else b
Compound assignments

Code: Select all

a += 1
b *= 2
..etc

Re: Luau went open source

Posted: Sun Nov 14, 2021 1:30 pm
by grump
ddabrahim wrote: Sun Nov 14, 2021 12:57 pm If-Then-Else expression

Code: Select all

local maxValue = if a > b then a else b
Compound assignments

Code: Select all

a += 1
b *= 2
..etc
Check out moonscript if you haven't yet.

Re: Luau went open source

Posted: Wed Dec 01, 2021 7:16 pm
by ddabrahim
Thank you for the recommendation, MoonScript looks very interesting, I like the syntax, what I dislike however is that it is require some 3rd party libs, I don't like to bloat my system with random staff. Prefer all-in-one packages so then I can also remove all-at-once if I no longer need it. But maybe one day I'll consider it. Thanks.