3 ms·
It's trivial in Rust to share mutable memory via RefCell, Rc, others. These are core, not exotic. We can imagine a language in which these don't exist, but it'
by millstone 8y ago
It's trivial in Rust to share mutable memory via RefCell, Rc, others. These are core, not exotic.
We can imagine a language in which these don't exist, but it's not Rust and would not enjoy the ergonomics of Rust. That's why Rust is not pure functional, or even "almost" pure functional.
- SamReidHughes 8y agoRefCell uses UnsafeCell inside. Everything that does mutation, under shared ownership, has UnsafeCell somewhere -- IIRC this is or was a requirement to guarantee the compiler won't do certain optimizations. > but it's not Rust That's why I stipulated Rust without UnsafeCell.