Re:Why Rust helps even if you have to use a lot of `unsafe`
by rstuart4133 on Monday August 07, 2023 @06:15AM
(#37032512)
> Bugs like this aren’t possible at all in Go or C#
As a point of order, such bugs are possible for Go. Eg, hashmap's behaviour becomes undefined if you access from multiple threads at the same time.
Admittedly, that's a Go peculiarity. Making the programmer deal with concurrency on collections undoubtedly gets it a speed boost, but it's not the tradeoff most gc languages take.
The beauty of Rust, is you don't need to trade speed or memory for concurrency.
As a point of order, such bugs are possible for Go. Eg, hashmap's behaviour becomes undefined if you access from multiple threads at the same time.
Admittedly, that's a Go peculiarity. Making the programmer deal with concurrency on collections undoubtedly gets it a speed boost, but it's not the tradeoff most gc languages take.
The beauty of Rust, is you don't need to trade speed or memory for concurrency.