我们可以在另一个 wasm 模块中导入一个 wasm 模块吗?

can we import a wasm module in another wasm module?

https://developer.mozilla.org/en-US/docs/WebAssembly/Understanding_the_text_format#importing_functions_from_javascript 说明我们可以在 wasm 中导入 javascript 函数。我们如何在另一个 wasm 中导入 wasm 函数?我的意思是想象我有两个 wasm 模块:A 和 B。我想在模块 B 中的模块 A 中调用一个函数。所以我需要导入它。我该怎么做?

虽然这在今天是不可能的,但目前正在通过一项名为 Module Linking (see the explainer for more background.) At the time of this posting, this feature is in the early proposal phase 的提案进行处理,部分原因是它依赖于其他一些功能才能先着陆。