Skip to content

API to instantiate a module from a bytes #477

Open
@kgtkr

Description

@kgtkr

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:

  • compiling files or bytes into a module;

https://github.com/WebAssembly/module-linking/blob/main/design/proposals/module-linking/Example-SharedEverythingDynamicLinking.md#runtime-dynamic-linking

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions