2 ms·
Shared mutable state is evil, so "not mutable" has been proposed as a solution. Rust is different, because Rust's solution is "not sharing". You can still mutat
by sanxiyn 7y ago
Shared mutable state is evil, so "not mutable" has been proposed as a solution. Rust is different, because Rust's solution is "not sharing". You can still mutate!
- reificator 7y ago> Rust is different, because Rust's solution is "not sharing". You can still mutate! For the record, rust does also default to immutability, and you can share immutable references all you'd like.
- bcrosby95 7y agoI would describe Rust more like a read-write lock than not sharing.
- nine_k 7y agoA lock is acquired and detected at runtime. Ownership and move semantics are checked at compile time, and allow effective "not sharing" without waiting or defensive copies.