News for hackers. Stuff that matters.
Re:Rust vs. Haskell by amelius on Tuesday February 14, 2023 @09:07AM (#34789429)
> The borrow checker just makes sure that a closure never outlives its captures or any of its references.

The point is that the borrow checker forces you to program in a fundamentally different style than idiomatic Haskell.

Re:Rust vs. Haskell by zozbot234 on Tuesday February 14, 2023 @09:38AM (#34789910)
You are not forced into any design choice. You can use explicit reference counting to enable closure captures to add to object lifetime, or even a lightweight tracing GC implementation (such as the recently developed Samsara https://redvice.org/2023/samsara-garbage-collector/ ) to collect cycles as Haskell does. Of course, Rust makes the performance tradeoffs involved quite clear, even though the implementations it can use are quite possibly leaner than Haskell's.