The way this compiler currently works is it builds a shim.wasm and a core.wasm. The shim had both the export and the import shims in it. This works fine when using wasm-merge, but creates a circular dependency when trying to dynamically load the modules. So i moved the imports into their own module. They could maybe be wasm-merged with core.wasm though?
When compiling count-vowels.wasm e.g., we get 3 modules in our build directory (hard coded to my home directory ~/py-out):
See my EIP for more details on this
How this experiment works
The way this compiler currently works is it builds a shim.wasm and a core.wasm. The shim had both the export and the import shims in it. This works fine when using wasm-merge, but creates a circular dependency when trying to dynamically load the modules. So i moved the imports into their own module. They could maybe be wasm-merged with core.wasm though?
When compiling count-vowels.wasm e.g., we get 3 modules in our build directory (hard coded to my home directory ~/py-out):
core.wasm
exports the__invoke
:import_shim.wasm
just has the__invokeHostFunc*
exports.main.wasm
has the final export:These all get wasm-merged together in the end. But i left the build directory so i could try dynamically linking them. And it works: