Re:Ferret – A free software Clojure implementation
by davidgrenier on Monday August 07, 2017 @08:37PM
(#14952496)
Always look at the memory management story when you stumble upon something like this.
[ Parent
| on HN ]
Re:Ferret – A free software Clojure implementation
by mtm on Monday August 07, 2017 @10:42PM
(#14953441)
It seems well thought out:
* malloc/free (ref counting GC)
* memory pooling (no heap, stack-based for memory constrained systems)
* third party allocators
* third party GC
Details here: http://ferret-lang.org/#sec-4-2
Re:Ferret – A free software Clojure implementation
by tomsmeding on Tuesday August 08, 2017 @04:22AM
(#14955676)
I love the idea of ref counting, but I'm unsure about the handling of memory cycles. In a plain ref counting implementation, these will not be cleaned up, resulting in a memory leak.
I didn't find anything on cycles in the linked page, maybe the problem is not relevant in most real-world clojure code?
Re:Ferret – A free software Clojure implementation
by derefr on Tuesday August 08, 2017 @04:30AM
(#14955736)
I don't know about "pure" Clojure (as this is), but in "pure" Erlang (which has similar semantics), you simply can't make a reference cycle. Functional languages in general don't really allow them.
Re:Ferret – A free software Clojure implementation
by nakkaya on Tuesday August 08, 2017 @04:41AM
(#14955793)
Author here. As derefr said with Clojure semantics you can not create cycles.
Re:Ferret – A free software Clojure implementation
by tomsmeding on Tuesday August 08, 2017 @05:29AM
(#14956011)
Thanks, now I think about it, that makes a lot of sense.
Re:Ferret – A free software Clojure implementation
by agentgt on Monday August 07, 2017 @08:50PM
(#14952573)
You could have provided a link to the memory management section or even mentioned it was ref counting. Otherwise your comment is ... it kills me to say this but pretty useless.
Re:Ferret – A free software Clojure implementation
by tedunangst on Monday August 07, 2017 @09:13PM
(#14952688)
Always look at memory management is more general, and perhaps even more useful, advice than look at the memory management for this one project.