3 ms·
> You'd be constantly fighting the type checker for memory issues. I think you mean borrow checker for ownership issues... > why doesn't Haskell take the same
by bilkow 6y ago
> You'd be constantly fighting the type checker for memory issues.
I think you mean borrow checker for ownership issues...
> why doesn't Haskell take the same route as Rust and ditch its garbage collector?
The Rust language was designed in a way (with ownership) that doesn't need a GC, while Haskell have many different properties (such as lazy evaluate everything) that I don't think would work well without a GC.
The borrow checker is usually a nuisance when you're writing highly mutable code, which isn't a problem for functional code. If you need to store the same data in multiple structures, the sibling is right, .clone() and .to_owned() will usually fix your problem with a very small overhead.