Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Implement export type ascription #913

Merged

Conversation

alexcrichton
Copy link
Member

This commit implements the change described in
WebAssembly/component-model#155 and accounts for the update in WebAssembly/component-model#161. The internal plumbing for this change was relatively easy to implement and shouldn't cause too much of a burden even on Wasmtime as a consumer (it may not have to change at all). I'll be working on a follow-up for wit-component to use this new construct to fix the original underlying issue.

This commit implements the change described in
WebAssembly/component-model#155 and accounts for the update in
WebAssembly/component-model#161. The internal plumbing for this change
was relatively easy to implement and shouldn't cause too much of a
burden even on Wasmtime as a consumer (it may not have to change at
all). I'll be working on a follow-up for `wit-component` to use this new
construct to fix the original underlying issue.
@alexcrichton
Copy link
Member Author

I should also mention that this changes the binary encoding of components and subsequently bumps the version in the binary format header.

@alexcrichton alexcrichton merged commit 49d3adc into bytecodealliance:main Feb 7, 2023
@alexcrichton alexcrichton deleted the export-type-ascription branch February 7, 2023 22:50
alexcrichton added a commit to alexcrichton/wasm-tools that referenced this pull request Feb 8, 2023
This commit leverages the type ascription added to the component model
in bytecodealliance#913 to reimplement how exported instances work within
`wit-component`. Instead of bag-of-exports they're now exported with
instantiations of nested components, where each nested component imports
functions and then simply reexports them with the appropriate type
ascribed.
alexcrichton added a commit that referenced this pull request Feb 9, 2023
* Encode exported instances with nested components

This commit leverages the type ascription added to the component model
in #913 to reimplement how exported instances work within
`wit-component`. Instead of bag-of-exports they're now exported with
instantiations of nested components, where each nested component imports
functions and then simply reexports them with the appropriate type
ascribed.

* Update crates/wit-component/src/encoding/types.rs

Co-authored-by: Peter Huene <peter@huene.dev>

---------

Co-authored-by: Peter Huene <peter@huene.dev>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants