Re:Uber Go Style Guide
by apta on Friday October 11, 2019 @12:22PM
(#21225823)
Another solution is to use immutable and/or persistent data structures. Of course, because golang doesn't have generics, it becomes unwieldy to have a library of them, unlike what we see in Java, Scala, etc. where these enjoy a wider adoption.
[ Parent
| on HN ]
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!
Re:Uber Go Style Guide
by reificator on Friday October 11, 2019 @12:49PM
(#21226097)
> 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.
I would describe Rust more like a read-write lock than not sharing.