3 ms·
Why is manual memory management a virtue? I'd rather fight the Rust compiler than deal with runtime errors, memory leaks, etc.
by mrichman 2y ago
Why is manual memory management a virtue? I'd rather fight the Rust compiler than deal with runtime errors, memory leaks, etc.
- simon_void 2y agoGarbage 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).
- pebal 2y agoYou can have a pause-free GC, where the collector runs in a separate thread and never pauses the mutator threads.
- packetlost 2y agoRust 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)
- masfoobar 2y agoYou might find this to be an interesting read:- https://loglog.games/blog/leaving-rust-gamedev/ 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.