3 ms·
No, but Rust provides this memory safety without GC, which is AFAIK, unique in a mainstream language. The type system knowing about ownership and borrowing als
by liara_k 7y ago
No, but Rust provides this memory safety without GC, which is AFAIK, unique in a mainstream language.
The type system knowing about ownership and borrowing also allows the elimination of race conditions (outside of `unsafe`, of course...). I don't know of a GC language that also does that, though obviously that doesn't mean there isn't one... ;)
- echelon 7y ago> elimination of race conditions Rust doesn't get rid of race conditions. It lets you write memory safe concurrent code. These are two separate things. You still have to be cognizant that code may not run in the order you expect. This is still a great language feature.
- xfer 7y agoData races shouldn't be happening with a GC'd language with a proper memory model, getting this right is important. Haskell has no dataraces if you don't use IORefs in safe code. Afaik java has a happens-before memory model that can be used to detect races.