Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

If what I want is not an executable but a shared library, does this get me anything?

I currently have a use case that uses a server running an emscripten build (using SMODULARIZE and some exports, I suppose it’s not a true dylib)



Importing a wasm module from a wasm module is (non)surprisingly impossible to do -- you have to have a linker, abi and all that.


It is possible provided some care. I was looking into this with WAForth which compiles the wasm and loads it via a host function (ie. it is the hosts responsibility to make it available). I wanted to enable dynamic loading of words from disk which requires some book keeping and shuffling a bunch of bytes around during compilation to write out the bits necessary to have the host do that linking. It isn't impossible to do, just tedious and in my case, having to write it in WAT is a pain.


Yep, you need to do the nasty bits by hand, that's what I mean.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: