Koka: A Functional Language with Effects
github.com
github.com
This seems to imply that they do not handle compaction, which is needed to remedy memory fragmentation.
The mimalloc paper has more information on this, and a lot of other interesting design choices. For instance, it uses no bump pointer, despite the fact functional languages are absolutely allocation hungry — a bump pointer was something I considered near unavoidable, speaking as someone who previously worked on Glasgow Haskell internals. Lean v4 is another functional language that uses this same allocation strategy, and it has excellent performance in practice despite all this, especially when combined with "in place" updates so that memory locations get reused in the first place.
The actual bigger "problem" with it all is that the lack of any garbage collector at all means that things like cycles cannot be handled implicitly by the underlying allocator ala Python, and this impacts the programming model. Neither Lean nor Koka, to my knowledge, contain any built in mechanism to e.g. create and write to global references (Haskell's IORef), and so cannot be used to create cycles; but at the same time, it means you can avoid the need for weak pointers at the user level, and that deallocation/allocation doesn't have such costly hidden tail latencies (see the mimalloc paper about temporal cadence on this note). Lean and Koka also both offer strong FFI support, so in some sense you can "just" (big quotes) punt this over that barrier and do dirty work manually at a big cost, if you absolutely must. In practice I suspect this will be fine for many things; as a Haskell programmer writing code I often get away without newIORef, quite easily in fact, because most of the time you actually don't peek behind the curtain to see who the Wizard of Oz really is.
The paper is here: "Mimalloc: Free List Sharding in Action" by Leijen, et al. https://www.microsoft.com/en-us/research/uploads/prod/2019/0...
(Alternatively, you could use reference counting almost all the time but rarely run a GC to do compaction. This means still being able to identify all pointers in memory, so I'm not sure anyone does it.)
And strictly speaking, this will do as well or badly on fragmentation as the underlying malloc implementation does as the memory allocation itself is deferred to it.
Semi-space, or any copying?
:)