2 ms·
> 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 pr
by amelius 4y ago
> 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.
- zozbot234 4y agoYou 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/ 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.