4 ms·
If someone is claiming the garbage collection means freedom from data races, they are unambiguously wrong. Garbage collectors solve double-free bugs and usuall
by Groxx 4y ago
If someone is claiming the garbage collection means freedom from data races, they are unambiguously wrong.
Garbage collectors solve double-free bugs and usually memory leaks due to cyclic references.
- eru 4y agoYes. Though garbage collectors can have an indirect influence on the design of the language, that makes it easier to handle data races. (As an example, image how much simpler Rust would be, if they went with garbage collection. Or how much more machinery Haskell would need, if they went with Rust's memory management strategies.)
- Groxx 4y agoI'm not sure what Rust would gain from a garbage collector - it'd still need all of lifetimes for instance, because ownership is the necessary piece for preventing races.