Luau Goes Open Source!

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

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

I wonder if this will add possibilities for ROBLOX studio to run offline… :thinking:

3 Likes

Remember that Security by Obscurity is never the right thing to do.

1 Like

Same vulnerabilities can also be patched in via pull requests versus just only a small team that has access to the code. People can also submit significant improvements to the code and as long as exploiters don’t have access to roblox VM keys; they aren’t going to do much in the first place. Most exploits don’t really even run in the clients VM or miraculously bypass the obfuscated binary for limited access. A majority of the time they run in their own lua engine and hook into the engine functions.

1 Like

The code has been leaked all over the v3rmillion, and I’m pretty sure that people messed around with it for quite a time.
The roblox source code contains a variety of obfuscation methods, and opcodes.image
I am not sure if these files are identical to what roblox has right now.

4 Likes

I don’t program in Lua nor C++ but i am still excited as a developer to see how other users use this new opening and hopefully to see how it can be simplified for non scripters to learn scripting even better

2 Likes

If by exploits you mean cheats, the answer is yes and yes. Hopefully Roblox anticipated this, though.

3 Likes

Fixed.
On https://luau-lang.org/ under Library heading it says:
Luau is currently only runnable from the context of the Roblox engine, which exposes a large API surface documented on Roblox developer portal.

3 Likes

Hype!

I was expecting this to be much later (maybe even next year) so I’m pleasantly surprised. Equally surprised it’s under MIT and accepting community contributions.

Good job to everyone on the team and I hope it’s only uphill from here.

6 Likes

Luau is obviously not an identical replication of studio, it’s no where near that (I’d assume)

It’s a language, not a stand alone engine. In luau it’s not like you can do game:GetService(“Whatever”), those are still strictly roblox based things, what luau does have is the typechecking and other cool performance features. It’s just another scripting language that an engine can incorporate.

6 Likes

This is honestly amazing. I’m really proud of Roblox for being more community-focused over the past few months, it truly is amazing.

Very excited to see what will happen next with the future of Luau.

4 Likes

Nowadays, almost everyone can reverse engineer software. This is how they make exploits. There is even a tool for it on Linux that makes it automatically for you. So, in my opinion, this is only a great thing. Freedom.

2 Likes

At last, when I have a question about how my code is interpreted, I can just look. This is going to be great for when performance really matters!

2 Likes

This has to be the most incredible thing to happen to Roblox in a long time. Open source means that anyone will be able to contribute a part in the code, and anyone will be able to look over the code and catch bugs.
It also means that you can write code in Luau without having to open up Roblox Studio. You could even add it into your own projects, which I’m really excited about.

I believe that this was the right direction for Roblox to go in, and it will be a massive benefit to all of us both in the short and long term.

3 Likes

This is an amazing accomplishment for the Development Community! excited for the future!

1 Like