hyperlight-dev / hyperlight-dev/hyperlight-wasm
Implementing multiple worlds
Nobody has claimed this yet.
- Dominant language
- Rust
- Stars
- 728
- Forks
- 39
- Avg merge
- 2d 6h
- Merged PRs (30d)
- 23
Description
It doesn't seem possible today to register multiple worlds. For instance, if I wanted my app to support both wasi:cli and wasi:http.
I thought it might be possible to create two different modules and then register them like:
let rt = cli::bindings::register_host_functions(&mut sb, state);
let rt = http::bindings::register_host_functions(&mut rt, state);
This doesn't work due to export WIT_WORLD which must be set to one and will only generate guest bindings for one of them.
The work around for now is combine the worlds into one world.
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 tracing register_host_functions and the export WIT_WORLD setting shown in the issue, then inspect how guest bindings are generated for a selected world. Determine how both wasi:cli and wasi:http could be registered without combining their worlds. Done means an application can support both worlds through separate registrations and generated bindings.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- rust, wasm
- Domain
- backend
- Issue type
- Feature
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 30/100