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

feat: preliminary support for WIT templates #964

Draft
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

dicej
Copy link
Collaborator

@dicej dicej commented Mar 20, 2023

This is a minimum viable implementation of WIT templates per WebAssembly/component-model#172. It supports interfaces with at most one wildcard function, which may be expanded (i.e. monomorphized) with a set of substitutions provided by the application developer when generating guest bindings. I will be posting separate PRs to the wit-bindgen and wasmtime repos to implement and test guest and host binding generation, respectively.

}
let func = self.resolve_function(&value.docs, value.name(), func)?;
let prev = if matches!(value.name, VariableId::Wildcard(_)) {
self.interfaces[interface_id].wildcard.replace(func)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think we'll want to handle prev.is_some() (indicating multiple * appears textually) here and return a concrete syntax error positioned at the span of the wildcard.

This is a minimum viable implementation of WIT templates per
WebAssembly/component-model#172.  It
supports interfaces with at most one wildcard function, which may be
expanded (i.e. monomorphized) with a set of substitutions provided by
the application developer when generating guest bindings.  I will be
posting separate PRs to the `wit-bindgen` and `wasmtime` repos to
implement and test guest and host binding generation, respectively.

Signed-off-by: Joel Dice <joel.dice@fermyon.com>
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.

None yet

2 participants