Hacker News new | ask | show | jobs
by mrichman 730 days ago
Why is manual memory management a virtue? I'd rather fight the Rust compiler than deal with runtime errors, memory leaks, etc.
2 comments

You might find this to be an interesting read:- https://loglog.games/blog/leaving-rust-gamedev/

In this, they make a good point about refactoring more with Rust than other languages. In some cases, "fighting the compiler" is not always want you want to do, especially when mocking some code/game state.

Garbage Collections destroys any real-time guarantees you might need, since the GC can be triggered at any time. So for some classes of applications a GC is not an option (e.g. in 3D-video games you don't want your rendered frames per second to drop under 60 frames per second).
Rust doesn't generally have a garbage collector though. This doesn't apply to the general case (ie. unless you go out of your way to add a GC into your runtime)
You can have a pause-free GC, where the collector runs in a separate thread and never pauses the mutator threads.