Re:Is your programming language unreasonable? (2015)
by nyanpasu64 on Saturday October 10, 2020 @08:44AM
(#24738584)
Rust's borrow checker would prevent Example 5 from compiling, since once you add `cust` to the collection, you can't touch it anymore (unless you insert a clone or etc.). So in this case at least, the inability to reason about code can be resolved by banning mutable aliasing, without eliminating mutability.
[ Parent
| on HN ]
Re:Is your programming language unreasonable? (2015)
by masklinn on Saturday October 10, 2020 @10:06AM
(#24739089)
Rust's ownership system would prevent example 5 from working (because you have to move the instance into the set).
The borrow checker is about validating that references don't outlive their target, and R^W.
Re:Is your programming language unreasonable? (2015)
by nyanpasu64 on Saturday October 10, 2020 @06:46PM
(#24742453)
Oops.