WebAssembly / WebAssembly/component-model
Question: Why is it not possible to refer to exported types in imports?
Nobody has claimed this yet.
- Dominant language
- WebAssembly
- Stars
- 1.4k
- Forks
- 130
- Avg merge
- 2d 1h
- Merged PRs (30d)
- 15
Description
The Component Model does not currently allow you to refer to exported types in imports, which feels asymmetric given that one can easily refer to imported types in exports. This becomes a practical concern when attempting to virtualize interfaces such as wasi:http/incoming-handler, which contains a handle function with parameters which are handles to resources which the guest is importing. The most natural way to virtualize that interface is unfortunately impossible since it would require importing a function with parameters which are handles to resources which the virtualizing component is exporting.
Is there a fundamental reason why this is not possible, e.g. by allowing a component to declare a type, refer to it in an import, and later export it?
Contributor guide
No contributing guide indexed for this repository
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 with the Component Model specification rules for imports, exports, and type declarations, then trace the wasi:http/incoming-handler interface and its handle signature. Done would require a documented design decision explaining whether exported types can be referenced by imports and, if so, the required model changes.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- wasm
- Domain
- compilers
- Issue type
- Feature
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 25/100