4 ms·
I'da wagered dollars to doughnuts you were going to say Rust. I believe Rust hits each of those topics head-on, as well.
by ghayes 6y ago
I'da wagered dollars to doughnuts you were going to say Rust. I believe Rust hits each of those topics head-on, as well.
- amelius 6y agoRust doesn't work well as a purely functional language. You'd be constantly fighting the type checker for memory issues. (Or otherwise, why doesn't Haskell take the same route as Rust and ditch its garbage collector?)
- trevyn 6y agoNah, just .clone() gleefully the 99% of the time that you're not in the hot path. Most of the other cases, you can use typed_arena or bumpalo. The other 0.1% of the time, you'd have to be pedantic about allocation anyway and might appreciate the compiler's help.
- 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.