4 ms·
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 do
by chc4 2y ago
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.
- 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
- DistractionRect 2y agoThe 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.