https://loglog.games/blog/leaving-rust-gamedev/
It’s an interesting post on Rust, not just for game dev, though mostly (does it translate to other domains, e.g. science? Seemingly to other exploratory programming), but I note also sections “GUI situation in Rust is terrible” and “Positives of Rust” (“If it compiles it often kinda just works. This is both a meme but in some sense not really.”), nor is it just about [Bevy’s] Entity Component System (but such systems could be good in Julia, or not, or other languages):
https://bevy-cheatbook.github.io/programming/ecs-intro.html
That being said, there is an overwhelming force in the Rust community that when anyone mentions they’re having problems with Rust the language on a fundamental level, the answer is “you just don’t get it yet, I promise once you get good enough things will make sense”. This is not just with Rust, if you try using ECS you’re told the same thing. If you try to use Bevy you’ll be told the same thing. If you try to make GUIs with whichever framework you choose (be it one of the reactive solutions or immediate mode), you’ll be told the same thing. The problem you’re having is only a problem because you haven’t tried hard enough.
I believed this for years. I tried, very hard, for years. […]
But, and I say this having spent the past ~3 years and written over 100k lines of game-related code in it across the whole ecosystem of frameworks/engines and having made my own, many if not most of the problems don’t go away if one isn’t willing to constantly refactor their code and treat programming as a puzzle solving process, rather than just a tool to get things done.
[…]
My take is, while that is 100% true, there’s a fundamental problem of games being complex state machines where requirements change all the time. Writing a CLI or a server API in Rust is a very different experience than writing an indie game. Assuming the goal is to build a good experience for players rather than an inert set of general purpose systems, the requirements might change from day to day just after having people play the game and you realize some things need to fundamentally change. Rust’s very static and overly-checked nature fights directly against this.
[…]
I’d argue as far as maintainability being the wrong value for indie games, as what we should strive for is iteration speed. Other languages allow much easier workarounds for immediate problems without necessarily sacrificing code quality.
[…]
What would be 3 lines of code in C# suddenly becomes 30 lines of Rust split into two places.
[…]
ECS solves the wrong kind problemBecause of the way Rust’s type system and borrow checker works, ECS comes up as a naturally occurring solution to the problem of “how do we have stuff reference other stuff”. Unfortunately, I think there’s quite a bit of terminology mixup, and not only do different people mean different things, but also that the large part of the community attributes some things to ECS that aren’t actually ECS. Let’s try to separate things out.
[…]
Generational arena is basically just an array, except instead of having our id be an index, it’s a tuple of(index, generation)
. The array itself then stores tuples of(generation, value)
[…]
The key point being, this allows a language like Rust to completely side-step the borrow checker and allow us to do “manual memory management with arenas” without actually touching any hairy pointers, and while remaining 100% safe. If there was one thing to point at that I like about Rust, it’d be this. Especially with a library likethunderdome
it really feels that this is a great match, and that this data structure very well fits the language as it was intended.Now comes the fun part. What most people attribute as benefits of ECS are for the most part benefits of generational arenas.
Found this at:
https://www.reddit.com/r/Zig/comments/1cf3dj9/leaving_rust_gamedev_after_3_years/
Maybe Zig is the better replacement for lower-level (non-GC) language, when you need that, rather than Rust or C…