I'm always fascinated by these decisions. Having only worked at smaller companies, I've never been involved in moving an entire stack away from the current/primary language. The feature backlog coming from the business never, ever, includes items like "change programming languages". It's always filled with customer or business facing features. And when faced with tough deadlines, as the adage goes, the devil you know is better than the devil you don't.
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...
Roblox has an annual revenue of ~$3B. A lot of massive efforts make sense at that scale that don't when you are at the 'several million' range of business.
It is certainly an impressive feat, they all work and perform pretty well. They're doing this to dog food their own engine, mainly the UI side of it.
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
I'm under the impression they've been using the game GUI engine to drive the mobile app since 2018 or so - or at least I remember seeing things about it from way back then.
Roblox uses a heavily customized version of Lua, and in it they've fixed many of the pain points of Lua and JS. One example is their Lua allows value types/copy semantics, native number types like f32 / i32, and simd. These are important if you care about tracking performance carefully which I believe they do.
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.
This scares me. Lua is already pretty niche, they customized it, and it's getting transpiled to js or wasm. There are too many places for that to go wrong, problems will be hard to investigate, and it's added ramp-up time for new hires.
In general, any time you venture away from a platform's default language (Objective C, Swift, Java, Kotlin, JS), things get significantly more complicated.
People have been using Roact and Rodux (Roblox Lua rewrites of React and Redux) to drive in-game GUIs for years. Roblox's GUI system is essentially a DOM, so doing stateful updates to the game objects quickly becomes extremely painful in the same way as building a website does.
…I’m sorry, they rewrote react and redux for Lua? Why not just use JavaScript in the first place?? Surely it’s not a performance or security thing, this is just a silly game for 11 year olds to learn slurs. Moving to Lua because all the app devs have to use it is like the rest of the world switching to Imperial measures!
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!
Sorry, they're reimplementations, not full 1:1 ports from Javascript to Lua.
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.
The game engine side of Roblox has always been Lua, and they have their own GUI classes//paradigm for making UI with the game engine.
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.
Their games have been written in Lua for a long time. They're not "moving to Lua" - they've improved their existing Lua ecosystem by porting over some libraries.
"Just using Javascript" would mean getting people to rewrite their entire games catalog.
Gotcha, thanks for the clarification -- I understand much more clearly now. I think my new take is a little less angry: this is awesome and is basically moving towards the same ideal as Three.js (/react-three-fiber) is, but from the opposite end of the horseshoe, so-to-speak. That is, something like "DOM-ifying 3D space". With LLMs easing a lot of the boilerplate/code-bloat concerns that arise from a big SPA with all the typical middleware knick-knacks, I could see this being a very productive evolution. Basically a unification of the frontend across modalities.
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
I would guess that they want to create more high quality tooling for Lua because that's what every game published on Roblox has to use. By unifying their stack it could be argued that they're reinvesting it what makes Roblox great.
Think less about 'ported javascript to lua' and more 'ported a modern web frontend to be used for a modern game frontend.' Keep in mind Roblox supports a large combination of operating systems, consoles, phones, and phone-like devices.
Wow this sounds like a big undertaking. They translated react 17 to lua and a bunch of other libs. This makes dog fooding more things possible but I don't see how for some of these...
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
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...