Stream: wit-bindgen

Topic: unification of the same construct


view this post on Zulip Mossaka (Joe) (Jul 06 2022 at 00:38):

Hey there, I defined a record in a wit file, imported by two other wit files, one to produce and one to consume. The problem is that these two bindings have different mods, and so they don't work together. Is it possible to unify them by generating a common mod library to be consumed by bindings that uses this library?

wit_bindgen_rust::import!("a.wit");
wit_bindgen_rust::import!("consume.wit");

fn main() -> Result<()> {
    let common = a::get_common_a();
    consume::consume_common(common);
    Ok(())
}
error[E0308]: mismatched types
 --> src/main.rs:8:29
  |
8 |     consume::consume_common(common);
  |                             ^^^^^^ expected struct `consume::Common`, found struct `a::Common`

view this post on Zulip Mossaka (Joe) (Jul 06 2022 at 00:47):

Ah I just saw this issue, which effectively is talking about the same thing as I asked here.

A language binding generator for WebAssembly interface types - Wit-bindgen support for linking multiple wit files together to produce unified bindings · Issue #266 · bytecodealliance/wit-bindgen

view this post on Zulip Dan Gohman (Jul 06 2022 at 00:55):

Yes. That's unfortunately not supported yet, though it's something we know we'll need.

view this post on Zulip Jens Gåsemyr Magnus (Jul 08 2022 at 08:25):

(deleted)


Last updated: Nov 22 2024 at 16:03 UTC