2 ms·
You can’t do that with C. Nor can you do that with Rust, because it has UnsafeCell. In the absence of UnsafeCell and system calls (and, I guess, unsafe blocks
by SamReidHughes 8y ago
You can’t do that with C. Nor can you do that with Rust, because it has UnsafeCell. In the absence of UnsafeCell and system calls (and, I guess, unsafe blocks), Rust encodes “all” its side effects (conservatively, and not trivially conservatively). All of its information flow, anyway.
- millstone 8y agoIt'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.