by darksaints · 6y ago · 0 comments
My theory that it won't happen without some form of inheritance-like structure. Games, like many forms of simulation, are inherently stateful and tends to fall hard on the OO-side of the Expression Problem spectrum. Traits tend to give you the best of both worlds, but in very important aspect it falls short: the traits themselves do not have data members. I saw a proposal where you could link object data members explicitly to data members that the trait required, which would probably fill that gap...but I don't think it has gone anywhere. Anybody know what I'm talking about so I can look up the progress?
As someone who's poked around in the current Rust gamedev ecosystem a bit, the publicly available libraries and frameworks aren't quite there yet for mid-large games (and are probably 1-2 years away at least for serious 3D development), though recent developments like the Legion ECS[2] (Amethyst, imo the most promising Rust 3D game engine seems like it will be switching from specs to Legion[3]), and Ultraviolet[4] (linear algebra library specifically for games & graphics which is faster than the alternatives for both runtime and compile times) are very promising.
1. https://twitter.com/AndreaPessino/status/1021532074153394176
2. https://crates.io/crates/legion
3. https://github.com/amethyst/rfcs/issues/22 for a discussion about potentially moving from specs to Legion
`specs` takes advantage of Rust’s compiler to provide very clean separation of concerns, opportunities for parallelism, and a clear path for unit testing. It just takes longer for entrenched technologies to change in the big-budget space.
I’d contrast this with a more traditional “OO” game or Unity’s actor/prefab way of doing things.
I write rust professionally and people seem to strangely hype the language for many of it's non-usecases. A jackhammer should not be used to change your car tires.
Personally doubt the benefits outweigh the extra energy expenditure required over traditional options but good luck to them I guess, especially in an ever-monetised MMO world rife with cheating.