radu-matei/wasm-components-example

Question: Dynamic Loading of WASM components.

Opened this issue · 0 comments

Hi,

Thanks for this excellent example. It works well.

I am not sure this is the right "forum" to ask, but please point me to alternatives. However, I have a question: The example loads the modules statically. I have a use case in mind where I dynamically load WASM modules - depending on a configuration - and there can be different type of module combinations, so it does not make much sense to combine all possible modules together into one big fat binary (e.g. security issues, updating individual modules, hot reloading of new module versions etc.). Nevertheless, the modules have standard interfaces, so one can assume that at runtime the interfaces do not change, but just the underlying implementation. Maybe to facilitate the understanding, one can compare it to a plugin system.

I just wonder how one would realize this using WASM components. For example, the Wasmtime documentation provides an example that loads dynamically a module. I would like to do the same, but with wasm-components to avoid all the laborious work of copying data into a shared memory, interpreting it, validating the correctness etc.

Thank you.

Best regards