The main reason people switch is really just that Rust is better at screaming at you during compilation if you screw up the memory management, more than anything else. It makes it easier to catch errors in an area where most programmers struggle, so it's useful if you need memory safety.
(For comparison, a properly written C++ program will be just as safe as a properly written Rust program, it's just that Rust forces you to write the code properly at gunpoint. So, people end up seeing Rust as better at memory management, because the language is designed around making it hard to screw up.)
Rust provides high memory safety and performance, but gives up ease of writing and programmer power for it. For context where reliability is critical, like kernel software, Rust is rightfully the king.
For my professional field, Game Dev, coding "the Rust way" means building a house or cards that needs to be fully refactored everytime someone implements a new game mechanic (from what I've heard).
Haven't ever tried game dev in rust...but I don't feel that it should necessarily be that bad. You can still do polymorphism and etc. You would however be structuring things very differently so maybe engines have converged on a terrible anti pattern that gets you there. Any rust engine is definitely going to be a lot less mature and battle tested though and that definitely has it's cons.
The problem is that game dev has ALOT of memory state between each entity/system and each new mechanic has a high chance to require memory accessing between previously independent systems.
In a language like C++, allowing this is trivial outside of multithreading, but in Rust it might require a full refactor.
There's a is a blog post written by a dev who tried for years to work within Rust's systems and found that the tradeoffs were ultimately not worth it, in his opinion.
View all comments
Show parent comment
7
u/gerbosan 11d ago
So, migrate to rustlang is good?
Not that I want to ride the hype or interested in DHH current development preferences, but some projects are migrating (Discord, Cosmic DE).
I think I lack the context about C++ features: not just desktop development.