Roblox has ported the entire front end JavaScript stack to Lua
twitter.com
twitter.com
I have worked on some legacy systems with languages like classic ASP and ColdFusion, and I would advocate against continuing to use them, only to ultimately be met with some feature request deadline. I know Roblox employs a ton of engineers (alright, more than a ton) but this decision couldn't have come lightly. How did this change come to be? Seems like it was a slow, organic, port of parts of their system over to Lua. What percentage of their engineering resources was spent working on this port, and will the gains made from switching to Lua outweigh the loss of productivity on the feature request backlog? Maybe they were blocked by JS and could only solve certain problems with Lua? Either way, this is very neat and makes me wonder what effect this will have on the job market, and if more large organizations going to follow suit and abandon JS in favor of Lua...
As far as I am aware all apps now use this instead of the native/web stacks they were using before, but its been a bit of a rocky transition.
Having used their website for years it just works and is pretty fast (However it is much slower in recent years than it once was), the new in-engine app just feels kinda clunky, its all incredibly slow and janky. Definitely not the smoothest of transitions
But that’s ok, the “engineers” at Roblox must know better. How long was their outage a couple years ago? 3 days? Lol
LuaJIT is one of the more performant bytecode inplementations and you can easily integrate it into most systems languages via it's robust FFI.
In this case, it's a moot point regardless as it's all compiling down to JavaScript and WASM anyways.
Edit: seems like it's "Luau" and not plain "Lua", so they ported it to their own variant of Lua, which promises performance and other gains.
But I’m very biased against rewrites. I’m impressed they are able to pull it off at a company this size, of course — I had a glimpse into the switch from JavaScript to typescript at a big tech company, and just that was a nightmare!
Roblox is also a full game engine. All game scripts are already in Lua and the developers are already using Lua in their games. Their GUI engine is in-house and so would necessitate porting from the web DOM to their game object model, so I doubt it would be a drop-in replacement even if they did the massive amount of work creating an entire duplicate set of language binding for Javascript. GUI driven scripts need to be able to maniulate the game world, and making that happen would definitely be orders of magnitude more work than just reimplementing the good parts of webdev in Lua.
"Just using Javascript" would mean getting people to rewrite their entire games catalog.
I haven't worked with the new Apple spatial computing stuff, but I would be very curious to hear from anyone who has on if it's DOM-like for application devs. I'm willing to bet it's closer to React than it is to Qt, right off the bat
What someone did was port react/redux to Roblox to run on top of the game engine UI primitives + Lua instead of html/css/js. Basically, they ported a more ergonomic way to develop and handle UI to Roblox because the primitives suck (I remember when we used to have to made UI out of 3D game objects and do a bunch of math to map them to the viewport and sync them every frame because Robloxs official stance was they didn't want to recreate flash - can you imagine?! video games without 2D UI elements!).
My first exposure to programming was Roblox over a decade ago, and kids were doing some pretty cool things even back then. If you're just a consumer of the games, then yeah it's a silly place where you're exposed to slurs//internet culture at large. But if you're actually developing things with the engine, even silly stupid things, it's a wonderful playground for math and programming concepts.
They use Lua heavily in Roblox so they've got a lot of tools and expertise in it, so I assume they see a lot of benefit to further standardizing their high level language.
I'm guessing they have some tooling to auto-translate typescript into Lua to massively speed up their porting. TypeScript has a very good compiler API for doing exactly this sort of thing and I've written a decent TypeScript <-> Python translation before.
In general, any time you venture away from a platform's default language (Objective C, Swift, Java, Kotlin, JS), things get significantly more complicated.
I am interested in any tooling or AI they used to help automate this.
The most useful lua code that I've written was very basic openresty nginx scripting around SSL certificates