Hacker News new | ask | show | jobs
by lantry 7 days ago
I have also been using LLMs (mostly claude code) to develop a game with Rust and Bevy, and it seems to work very well. The strictness of rust seems to really help them get the code right, and the ECS architecture seems to make it easy for them to reason about how things work (because they only need to hold a few systems and components in context at a time).

makes me wonder if ECS will ever catch on outside the gaming industry. not sure if it's really the right architecture for web SAAS. Might be interesting to rewrite some big piece of software with ECS.

4 comments

Games and other specific applications call for such unidirectional data flow with such massive amounts of "independent" entities. It isn't that it'll catch on or not outside the gaming industry, it is more of a unique solution to a typical gaming problem.

So their are apps that do use similar or ECSs architecture under the hood, it is just more problem related not a solve everything solution.

right, I guess what I mean is that in the past you would pick an architecture based on your data structure/flow, performance requirements, things like that. Now there is a new metric: how LLM-friendly it is. Probably it won't be a huge factor, since a properly structured REST server would also be friendly enough, and LLMs are getting better. Still interesting to consider though, IMO.
ECS is used for simulations as well, a game is just a simulation with user input and a pretty renderer.
I'm a Rust dev, but I've been worried Claude might not be able to emit Bevy (or Fyrox) sufficiently well.

I keep seeing Mr.Doob post amazing stuff in Threejs and the vibe coding scene blowing up with all kinds of generative work, and I feel really drawn to it.

Do you feel like Claude gets Bevy well enough? I know it kicks ass at Rust, but Bevy is relatively niche still.

Do you feel like Bevy is pretty performant?

yeah it does fine with bevy. It struggles a bit to structure the components in the best way, so that still requires some human oversight if you want it to be good. It helps a lot to emphasize that you want "idiomatic" bevy code, and ofc it also helps a lot to spend a lot of tokens on design and review (e.g. "is this the most elegant way to structure these systems/components?"). There's also this feature called Bevy Remote Protocol which allows inspecting bevy state via HTTP, which really helps agents debug things. I had claude add a little wrapper that also allows injecting mouse/keyboard events and triggering a screenshot write to disk, and now claude can drive the whole game, which helps it verify things end to end.

I can't really comment on the performance. I haven't noticed any performance issues for the things I'm doing.

ECS is basically column storage, but extended to behavior, not just data.