Rust is a poor language for Game dev. Games and a borrow checker don't work together. You will end up using unsafe mode most of the time. Making a game revolves around doing the hackiest shit and making something cool work. Every function has side effects and variables will need to be modified in multiple places in the same frame. Don't get me wrong I like Rust but I need a language I can abuse, not the other way around, when I am making a game.
Rust is a fantastic language for game dev. It just requires you to think completely differently if you want to have a good time. You can totally write the traditional game loop or my preference ECS (bevy as one example). ECS still let's you do the crazy mutations without having to worry about ownership. Each system can focus on the components they care about and you can specify the order they run. If you want to be reckless and mutate global state, then you need to explicitly decide between things like RwLock<T> and RefCell<T> for example. I'm not saying everyone should drop whatever they prefer to instead use rust. It's ok to stick with what you know or enjoy. Good games are agnostic to the tools used to make them. I just don’t think Rust deserves to be dismissed the way your statement does.
Every function has side effects and variables will need to be modified in multiple places in the same frame
We try to avoid exactly that, because it is what caused us man-years of bug-hunting and bug-fixing over our past projects. Our end-goal (that is still very far away...) would be to have the state from the previous frame and the user inputs, do only pure computations based on this data, and write out a new state before rendering the current frame.
We do use C++ though (because Unreal, and console platforms), what makes this extra hard, because C++ is a language for writing bugs, not for writing software.
@programming.dev
Welcome to the game development community! This is a place to talk about and post anything related to the field of game development.
go to feed...
@programming.dev
Welcome to the game development community! This is a place to talk about and post anything related to the field of game development.
go to feed...
I would still prefer Rust over C++ even in GamrDev.
save