cargo-component
cargo-component copied to clipboard
Investigation: using `witgen` for default interface definitions?
Right now we create a interface.wit
file to represent the default interface of the component (i.e. what the component itself exports as functions rather than named instances).
There's a really cool effort underway to use proc-macros to generate wit
files from Rust types called witgen.
It would be really fantastic if Rust developers could author at least their default interface definitions using Rust types, if desired, as that would be a pretty natural fit for DX.
This might be more of an issue for upstream wit-bindgen
to provide an integrated way to define both the interface and the implementation in Rust, but I thought I'd open this issue to raise awareness.
Closing this issue for now. We may revisit this in the future.
It seems like witgen is particularly outdated. Would it make more sense to integrate .wit-from-Rust generation here?