Add support for implements clause#1551
Conversation
|
The guest side of things I think is going to be tricky in its own right compared to the host side of things. Notably if an interface is imported twice this'll need to generate two different types for all types contained within the interface. Without that it's not a reflection of the original WIT itself, so this means that (at least from my understanding at a skim) the duplicate-related handling will need to be removed. To handle this though what I'd recommend is updating the |
multiple times under different plain names:
world runner {
import primary: store;
import backup: store;
}
No bindings-generator changes needed. wit-parser surfaces each label as
a plain-name interface import/export, `generate_nominal_type_ids` gives each
its own type identity, and the existing plain-name interface code path emits
label-named modules and `wasm_import_module`s.
The test covers Rust, Go, and WAT runners with Rust and Go tests, composed
via `compose.wac` so the two labels resolve to two independent `store`
instances.
Temporary, until releases catch up:
- `wac` is pointed at the `implements` branch; composition support for the
clause is not yet in a released wac.
- CI's wasmtime is pinned to the `dev` build; the clause has landed on
wasmtime `main` but is not yet released.
Signed-off-by: Bailey Hayes <bailey@cosmonic.com>
The
implementsclause lets a world import or export the same interface multiple times under different plain names:No bindings-generator changes needed. wit-parser surfaces each label as a plain-name interface import/export,
generate_nominal_type_idsgives each its own type identity, and the existing plain-name interface code path emits label-named modules andwasm_import_modules.The test covers Rust, Go, and WAT runners with Rust and Go tests, composed via
compose.wacso the two labels resolve to two independentstoreinstances.Temporary, until releases catch up:
wacis pointed at theimplementsbranch; composition support for the clause is not yet in a released wac.devbuild; the implements has landed on wasmtimemainbut is not yet released.