-
Notifications
You must be signed in to change notification settings - Fork 176
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
rust: Support a more terse form of with
-based remapping
#840
Comments
It would be good if |
Could you clarify what you mean @sehz? I'm not sure I understand what you mean by pass-thru. Do you mean that the same configuration of |
I guess what I am looking for is parity between |
Ah ok makes sense! I definitely agree that this work should go into Wasmtime as well when completed |
This commit implements bytecodealliance/wit-bindgen#840 for Wasmtime. Currently `with` keys to bindgen only support either mapping resources or interfaces. Now they additionally support mapping entire packages or entire namespaces. This can help clean up some references to interfaces through our own bindings to avoid listing all of them.
This commit implements bytecodealliance/wit-bindgen#840 for Wasmtime. Currently `with` keys to bindgen only support either mapping resources or interfaces. Now they additionally support mapping entire packages or entire namespaces. This can help clean up some references to interfaces through our own bindings to avoid listing all of them.
This commit implements bytecodealliance/wit-bindgen#840 for Wasmtime. Currently `with` keys to bindgen only support either mapping resources or interfaces. Now they additionally support mapping entire packages or entire namespaces. This can help clean up some references to interfaces through our own bindings to avoid listing all of them.
Currently
with
works by operating at theinterface
level, requiring a specification such as:This can get cumbersome for a suite of packages, however:
I've seen this come up in the context of WASI where a bunch of WASI interfaces are referenced but the types to use should come from somewhere else. Especially with the
wasi
crate nowadays I think it should be easier to use thewasi
crate wholesale. I'm imagining something like:I'm also thinking you could do:
Where the general idea is that of the "path" that's
pkg:a/b
you could start chopping off pieces from the right and generatepkg:a
andpkg
. Both cases would be considered as covering all "children" of those namespaces, meaning that ifpkg:a
were specified then any interface in thepkg:a
package would use thewith
key forpkg:a
. The projections from that key would use the standard naming scheme thatwit-bindgen
already uses.Ideally I'd like to see this ported to the
wasmtime::component::bindgen!
macro eventually too.The text was updated successfully, but these errors were encountered: