bytecodealliance / bytecodealliance/wac
Implement "defaulted" instantiation arguments
- Dominant language
- Rust
- Stars
- 208
- Forks
- 41
- Avg merge
- 2d 7h
- Merged PRs (30d)
- 3
Description
If a component being instantiated with a new expression has a `unlocked-dep` or `locked-dep` import and the import has not been satisfied by an argument to the new expression, `wac` should implicitly resolve and instantiate a (shared) instance of the dependency and project into its exports, passing the result as the argument.
Example:
Package `foo:bar`:
```wat
(component
// ...
(export "f" (func 0))
)
```
Package `bar:baz`:
```wat
(component
(import "unlocked-dep==0.1.0}>" (func))
)
```
Composition:
```wac
let i = new bar:baz { };
```
Then `foo:bar@0.1.0` should get resolved and instantiated, `f` should be aliased from the export, and the alias passed in as the argument for `unlocked-dep=`.
The instantiated dependency would either have all of its imports satisfied by implicit imports or by recursively instantiated dependencies for any `unlocked-dep` and `locked-dep` imports.
It would be an error if the (transitive) dependencies fail to resolve.
Contributor guide
No contributing guide indexed for this repository
Assessment
This issue has not been assessed yet.