Luau went open source

General discussion about LÖVE, Lua, game development, puns, and unicorns.
Post Reply
MartimDev
Prole
Posts: 1
Joined: Wed Nov 03, 2021 7:50 pm

Luau went open source

Post 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.
User avatar
ddabrahim
Party member
Posts: 182
Joined: Mon May 17, 2021 8:05 pm
Contact:

Re: Luau went open source

Post 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.
MrFariator
Party member
Posts: 509
Joined: Wed Oct 05, 2016 11:53 am

Re: Luau went open source

Post 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.
User avatar
ddabrahim
Party member
Posts: 182
Joined: Mon May 17, 2021 8:05 pm
Contact:

Re: Luau went open source

Post 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
grump
Party member
Posts: 947
Joined: Sat Jul 22, 2017 7:43 pm

Re: Luau went open source

Post 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.
User avatar
ddabrahim
Party member
Posts: 182
Joined: Mon May 17, 2021 8:05 pm
Contact:

Re: Luau went open source

Post 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.
Post Reply

Who is online

Users browsing this forum: No registered users and 18 guests