3 ms·
Can someone help me understand why?
by whalesalad 2y ago
Can someone help me understand why?
- jackkonof 2y agoResume building? If there’s one language worse than JavaScript, it’s Lua. But that’s ok, the “engineers” at Roblox must know better. How long was their outage a couple years ago? 3 days? Lol
- deaddodo 2y agoWhat makes you think Lua is worse than JavaScript? Hell, what metric are you even using to determine that? 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.
- nusl 2y agoPerhaps it's easier to build the game's plugins with. I can't think of other good reasons without digging into this properly. 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.
- sosodev 2y agoI 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.
- chc4 2y agoPeople 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.
- bbor 2y ago…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!
- chc4 2y agoSorry, 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.
- vidarh 2y agoTheir 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.
- bbor 2y agoGotcha, 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
- darzu 2y agoRoblox 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.
- dehrmann 2y agoThis 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.
- mid-kid 2y agoIf there's any language where that ramp-up time might not even be a problem, it's Lua.
- rhelz 2y agoSurely having one less programming language in the stack is a benefit.
- chucky_z 2y agoThink 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.