I am creating the compiler for a pure, functional programming language. This compiler will output
There is some data that can live in the stack, but most of it will need to live in the heap, and managing the heap manually is a recipe for disaster. So the obvious option here is to add a memory allocator, like
I saw that
wasi-sdk, by extension) offers the entire
libc, but at the moment, the only thing that I need is an allocator. Bringing everything would be overkill. And
wasi isn’t really widely supported by browsers yet, too.
.wasm files that results from the compilation process of my language will be blissfully unaware of the heap. They will only need to mention
dlfree, because I am assuming that
wasm-ld should be able to link
dlmalloc to my
What are the steps for me to achieve this?