Luau Goes Open Source!

Anyone can contribute or add features, and if it gets accepted, they’ll add it to the actual repository and maybe even eventually to Roblox itself.

Also other people can check to see if there are faster ways or more secure ways to build the language.

It also allows for other people to build in systems that interact with this (such as perhaps a package manager :eyes:)

5 Likes

@zeuxcg
This thread is quite a hype train, so I hope this doesn’t get lost…

How can I configure my .luaurc/command line arguments with luau and luau-analyze to work with a rojo project? Is there any way to actually do so yet?

It also seems like Roblox’s built-in typings are missing?

4 Likes

Too early for that I think - we have a few things missing for this to work. Most notably right now luau-analyze doesn’t understand Roblox type definitions. We plan to expose type definition files so that this works fine.

10 Likes

Congratulations! Making a new language is hard and the sign of a mature company! This could be a long-lasting contribution to computing, and is definitely a non-trivial thing to do. I thought for sure this day was a few years out, so this is a very welcome surprise.

I’m excited to see what rich tooling comes from this, and I look forward to Roblox’s custodianship of Luau.

16 Likes

I noticed a while ago that the github page is no longer just a description with a link and was a bit confused. This is amazing, can’t wait for people to implement online compilers.

2 Likes

@zeuxcg Quick question about Pull Requests.

Are users allowed to write up pull requests and submit them to be reviewed? If so, should we include tests with our pull request?

4 Likes

I’ve been looking forward to this for quite a while now! I’m hoping to see contributions from developers to Luau now.

1 Like

If anything, open sourcing Luau will reduce the amount of exploits, as more eyes will be on the code meaning vulnerabilities will be spotted and corrected sooner than they otherwise would be!

12 Likes

Gosh darn it, I’m a C# developer, not a C++ one. Still, it’s very nice that you guys released it to the public, I’ve always wondered if, or when you guys were go going to release it!

1 Like

HECKKK YEAH! This is a big step in the development of Roblox, I hope to see some cool things made using this!

1 Like

Ok! Though what is the difference between Lua and Luau?

1 Like

Luau is designed to be faster, more robust, has type linting functionality, and has some extra functions built ontop. Lua is what Luau is based on. (this means that most Lua code can be run in Luau)

4 Likes

Hi, I’m not the smartest with programming languages other than Lua :sweat_smile:. How would I integrate this language into Visual Studio (code)?

1 Like

The Luau version is synonymous to the Roblox version except for the globals.

There are some other notable differences other than the Roblox version as well, but all typed annotations work as expected.

To test this, I’ve made two variants: one with good code, and another that should be warning and bug-prone.

Good Code Snippet
type LuauGreeting = string

local Greeting: LuauGreeting = "Hello from Luau %s!"

print(string.format(Greeting, _VERSION))
Bad Code Snippet
type TimeElapsed = number
type FakeType = FakeType 

local GetTimeElapsed: TimeElapsed = ElapsedTime()

task.wait(3)

print(GetTimeElapsed - time())

and here are the given results based on both variants in the CLI and Roblox Studio:

Good Code Variant via CLI

-Code compiled in the CLI:
image

-Code analyzed in the CLI:
image

Good Code Variant via Roblox Studio

image
image

and lastly, the bad code variant:

Bad Code Variant via CLI

image

Bad Code Variant via Roblox

image
image

The biggest difference is that an error is thrown and will not compile for the bad code variant in the CLI, whereas in Roblox Studio it runs just fine.

3 Likes

Same here! An awesome step towards Roblox’s future!

1 Like

This gotta be a early Christmas present for all the programmers

3 Likes

See luau/CONTRIBUTING.md at master · Roblox/luau · GitHub

6 Likes

This is HUGE News. So awesome!

2 Likes

Thanks! I missed that. Ill give it a read.

1 Like

If it’s somewhat identical to the version in roblox studio, then it’s going to become a slight issue in the future for Roblox.
I’ll explain why and how exploit developers can use it to their advantage:

Exploit developers have a great chance improving their software by reading Luau documentaion.
In my opinion, making Luau open sourced is somewhat an equal event in 2017, when Roblox’s source code got leaked by a group of exploiters.
Some people can detect the vulnerability in the source code, and abuse it for their own good; in example, Luau compiler.
Of course I know that the source code has been checked multiple times, but what if something’s actually wrong?
In example, 3dsboy. A person who made Synapse(exploit for roblox) *probably* knows about the leak, and using the open-sourced Luau, Synapse will get much more things in the future.

What I’m saying is, that I’m not sure about making Luau open sourced was a good decision.
If I am wrong, please correct me.

2 Likes