Re:Rust Is Hard, Or: The Misery of Mainstream Programming
by EugeneOZ on Friday June 03, 2022 @06:45AM
(#31606621)
Does it have a borrow checker and mutability control?
[ Parent
| on HN ]
Re:Rust Is Hard, Or: The Misery of Mainstream Programming
by kaba0 on Friday June 03, 2022 @07:19AM
(#31606841)
It is a GCd language, a borrow checker is very seldom needed outside of that (and frankly, one should just use try-with and similar constructs for other kinds of resources), so why would it need one?
As for mutability, it is not enforced on a language level (only shallowly), but the standard library, the language primitives and basically everything makes control over mutability very good. In practice it won't be much different than Rust with the interior mutability pattern.
Re:Rust Is Hard, Or: The Misery of Mainstream Programming
by EugeneOZ on Friday June 03, 2022 @07:40AM
(#31606978)
“Side-effect” of borrow-checking - there is always only one who can write to a variable. It's much more important than GC.
Re:Rust Is Hard, Or: The Misery of Mainstream Programming
by kaba0 on Friday June 03, 2022 @07:45AM
(#31607018)
Oh I see. No it does not have it enforced at the language level, but it relies heavily on immutable data structures, and the type system is strong enough to express a complete actor-based concurrency library.
But since it is interoperable with Java and that exposes low-level primitives of concurrency, it can’t really be made guaranteed data-race free.