cargo-component icon indicating copy to clipboard operation
cargo-component copied to clipboard

Investigation: using `witgen` for default interface definitions?

Open peterhuene opened this issue 2 years ago • 1 comments

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.

peterhuene avatar Apr 20 '22 19:04 peterhuene

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.

peterhuene avatar Apr 20 '22 19:04 peterhuene

Closing this issue for now. We may revisit this in the future.

peterhuene avatar Mar 18 '23 04:03 peterhuene

It seems like witgen is particularly outdated. Would it make more sense to integrate .wit-from-Rust generation here?

jakehemmerle avatar Jun 23 '23 20:06 jakehemmerle