3 ms·
From a Rust perspective, this may be true. But from a Haskell perspective, this language promises to completely eliminate the garbage collector, which is a big
by amelius 7y ago
From a Rust perspective, this may be true.
But from a Haskell perspective, this language promises to completely eliminate the garbage collector, which is a big deal.
- _bxg1 7y agoIs it something that could potentially be back-ported to Haskell and friends? I'm afraid it was a bit over my head too
- amelius 7y agoWell, they say that: > Practically, this means that you can write your program in the ordinary lambda-calculus without any extra restrictions or annotations, and at the same time are allowed to control how resources are used in the program. You can rewrite any Haskell program into the ordinary lambda-calculus, and this can be automated. The only possible problem might be that Haskell uses lazy evaluation, and I don't expect this to interfere with the control of resources but I could be wrong.
- _bxg1 7y agoHaskell also allows you to share heap-allocated immutable data structures between threads, right? I think someone said this language doesn't support reference sharing across threads, but that could've been wrong
- amelius 7y agoYes, indeed threads could be problematic. But as long as you're not storing closures in those shared data-structures, these structures will always be acyclic, and could be collected through simple reference counting. Perhaps that's an acceptable compromise.
- ferzul 7y agoisn't: let x = 1:x cyclic, but without closure? unless closure is so broad as to capture essentially any haskell value. it's not going to be obvious when there is a cyclic reference (e.g. if you use `let x = repeat 1` instead of the definition above)