4 ms·
"that the problems with data races and memory safety arise when you have both aliasing and mutability. The functional approach to solving this problem is
by sambeau 12y ago
"that the problems with data races and memory safety arise
when you have both aliasing and mutability. The functional
approach to solving this problem is to remove mutability.
Rust’s approach would be to remove aliasing."
This is the crux of the argument and it makes sense to me.
- cousin_it 12y agoI can't help but wonder if mutability and aliasing are secretly the same thing. For example, we can't optimize memcpy by reordering reads if the source and destination arrays are aliased. But if we had a hypothetical language where arrays can be mutable or immutable, we could require the source array to be immutable and the destination array to be mutable. Then we'd be able to reorder reads just fine, because writing to the mutable destination array can't affect the immutable source array!