WebAssembly / WebAssembly/component-model
Only require "real" imports during validation of component instantiation
Nobody has claimed this yet.
- Dominant language
- WebAssembly
- Stars
- 1.4k
- Forks
- 130
- Avg merge
- 2d 1h
- Merged PRs (30d)
- 15
Description
Currently I believe the intention for validation of instantiating a component within a component is along the lines of "iterate over all the imports and make sure something is supplied for that name and the supplied item's type is a subtype of what's required", or at least roughly that. This I think can perhaps be simplified in two ways:
-
When a component imports a type with an
(eq ..)bound there's not actually any need to supply that import in the object during instantiation. I would propose that a change to the validation is that if an equality-bounded type is imported then it does not need to be supplied during instantiation. -
Similarly, and perhaps as an extension of the above rule, if a component ends up importing an empty instance there's no actual need to supply such an empty instance at instantiation time. I would propose that empty instances can be omitted from the instantiation arguments.
I think that if something is supplied then it should be type-checked, but otherwise instantiation validation would allow "holes" in the supplied imports for the above cases (equality-bounded type imports and empty instances).
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 by locating the component instantiation validation logic and the tests covering imported types and instances. Confirm the intended rules in this issue: equality-bounded type imports and empty instances may be omitted, while supplied imports remain type-checked; add or update tests to demonstrate those cases.
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
- 35/100