You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
JavaScript API has WebAssembly.compile and WebAssembly.instantiate.
There seems to be no equivalent to this in wasi.
For example, if wasi have this, it should be able to realize a JIT compiler by generating a wasm module bytes and instantiating it by passing a function or memory. We can already do this with the JavaScript API.
Module-linking proposal
This looks like a problem that the module-linking proposal doesn't solve.
The general case of runtime dynamic linking in the style of dlopen, where an a priori unknown module is linked into the program at runtime, is not possible
to do purely within wasm with this proposal. Additional host-provided APIs are
required for:
I agree, I expect we will eventually want APIs for dynamic instantiation from module bytes. To do this, we'll likely want first-class type for holding references to dynamically created instances. These instance references could then be passed into other instances, potentially forming reference cycles, which means it'll probably need some form of GC.
Also, the ability to create code dynamically will need to be coordinated with the content-security-policy.
The WITX to WIT transition does not add dynamic instantiation from wasm module bytes.
JavaScript API has
WebAssembly.compile
andWebAssembly.instantiate
.There seems to be no equivalent to this in wasi.
For example, if wasi have this, it should be able to realize a JIT compiler by generating a wasm module bytes and instantiating it by passing a function or memory. We can already do this with the JavaScript API.
Module-linking proposal
This looks like a problem that the module-linking proposal doesn't solve.
https://github.com/WebAssembly/module-linking/blob/main/design/proposals/module-linking/Example-SharedEverythingDynamicLinking.md#runtime-dynamic-linking
The text was updated successfully, but these errors were encountered: