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:
-Code analyzed in the CLI:
Good Code Variant via Roblox Studio
and lastly, the bad code variant:
Bad Code Variant via CLI
Bad Code Variant via Roblox
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.
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.
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.
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.
I am not sure if these files are identical to what roblox has right now.
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
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.
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.
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.
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.
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.