3 ms·
> Go's concurrency is unsafe? Rust's concurrency is automatically safe? Yes and yes... Rust statically enforces that you don't have data races, i.e. it's not
by School-Cotton 2y ago
> Go's concurrency is unsafe? Rust's concurrency is automatically safe?
Yes and yes...
Rust statically enforces that you don't have data races, i.e. it's not possible in Rust (without unsafe hacks) to forget to guard access to something with a mutex. In every other language this is enforced with code comments and programmer memory.
- pjmlp 2y agoAs long as that something is in the process's own memory.
- School-Cotton 2y agoCorrect, rust doesn’t magically prevent all bugs. It just makes a large class of bugs harder to write.
- consteval 2y ago.. but most concurrency is done in distributed systems, where Rust provides little to no protection. Although making a Rust monolith would be great!