4 ms·
Can't wait to build a world of memory management tools in Haskell with the help of -XLinearTypes. What this article mentions about non-global allocators will f
by whateveracct 6y ago
Can't wait to build a world of memory management tools in Haskell with the help of -XLinearTypes.
What this article mentions about non-global allocators will fit perfectly.
- Ericson2314 6y agoSorry, but you cannot write malloc in linear Haskell. I wish you could too.
- whateveracct 6y agoI could mmap some virtual memory and write malloc's API to allocate chunks, kept safe by linear haskell I can write a variety of memory allocators, kept safe by linear haskell more generally, anything you can do in C, you can do in Haskell. So malloc is fair game (although i'd just call the C one from Haskell)
- Ericson2314 6y agoNo I mean linear arrows vs linear kinds means you can't write malloc without CPSing.
- whateveracct 6y agoyeah i don't especially expect that to matter in practice. monads used to require CPSing all over the place too.