3 ms·
Go makes everything mutable with no synchronization, so concurrent slice appends can be lost and map reads and writes can panic. Rust makes you decide which ref
by erik_seaberg 6y ago
Go makes everything mutable with no synchronization, so concurrent slice appends can be lost and map reads and writes can panic. Rust makes you decide which reference is mutable, which takes work but it’s important for the same reasons as static typing.
- hnlmorg 6y agoWhile that's true, it's also true that just because the reference is mutable it doesn't mean the developer is stupid enough to pass mutable references between threads without mutexes to prevent the aforementioned race conditions from happening in the first place. Plus Go also has channels which are a thread safe way of message passing. I'm not taking anything away from Rust but a great many of us have been writing multithreaded code for years before languages like Rust made it safe. These aren't new problem I had to solve. But I'm also not complacent about the risks of multithreaded code and in fact murex's test suite does check for race conditions.