3 ms·
People should probably stop saying that rust is about memory safety, its design has impact on a lot of others things (that I arguably, care much more about). >
by nestorD 4y ago
People should probably stop saying that rust is about memory safety, its design has impact on a lot of others things (that I arguably, care much more about).
> many interacting systems resulting in unpredictable behavior[0], buggy level geometry[1], or poorly scripted missions not accounting for all player behavior[2].
[0]: Rust borrowing system (you know exactly who is allowed to touch each ressource at a given point in time) is great at pushing you away from architecture with too much mutable interaction. That is a side effect of the system rather than its design purpose but, for my point of view, it is one of the main draw to write large projects in rust rather than C++.
[1]: probably not something Rust will help you with.
[2]: Rust type system (and overall coding conventions) is really good at building things such that it will only compile if you check for all cases or, at the very least, leave some explicitly unchecked cases.
- t8sr 4y agoSorry, I think "system" is an overloaded term. I'm not talking about "thread X changed my state", I'm talking about a scenario where the physics system wants to move the player collider, but you want to control its motion with hand-tuned code, so you set it to cinematic, which now causes everything in the scene to go flying when it touches it, because it has effectively infinite inertia. Or maybe you have a system that regenerates your health and an area where healing effects turn into damage and your health regen is now draining the health bar. These types of interactions exist at a layer where Rust can't help you. Even outside of gamedev, I would claim that most software bugs we run into every day are in this category: too high-level for the borrow checker. (Button not connected to anything. Scrollbar hidden, but the page is too long. Microservices that upgrade independently without API stability.) > [2]: Rust type system (and overall coding conventions) is really good at building things such that it will only compile if you check for all cases or, at the very least, leave some explicitly unchecked cases. I invite you to try to teach Rust's type system to level designers.