WebAssembly / WebAssembly/WASI
API to instantiate a module from a bytes
Nobody has claimed this yet.
- Dominant language
- Rust
- Stars
- 5.8k
- Forks
- 333
- Avg merge
- 2d 13h
- Merged PRs (30d)
- 3
Description
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;
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by comparing the JavaScript WebAssembly.compile and WebAssembly.instantiate APIs with the existing WASI surface. Read the linked module-linking proposal, especially its runtime dynamic-linking discussion, and define a host API that can compile module bytes and instantiate them with supplied functions or memory.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- wasm
- Domain
- api, operating-systems
- Issue type
- Feature
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 25/100