Stream: wit-bindgen

Topic: ✔ bindgen for components


view this post on Zulip Jens Gåsemyr Magnus (Nov 08 2022 at 11:24):

Hey, I've noticed that the new cli expects components for hosts. How are these created? At the moment I compile a guest module in rust with target wasm-unknown-unknown based on a wit file. But I can't figure out how to create the guest bindings

view this post on Zulip Alex Crichton (Nov 08 2022 at 14:43):

The wit-component tool at crates/wit-component is used to create the component right now

view this post on Zulip Jens Gåsemyr Magnus (Nov 08 2022 at 15:05):

Ah right, thanks! That worked :grinning_face_with_smiling_eyes:

view this post on Zulip Notification Bot (Nov 08 2022 at 15:05):

Jens Gåsemyr Magnus has marked this topic as resolved.

view this post on Zulip Peter Huene (Nov 08 2022 at 19:16):

@Jens Gåsemyr Magnus also check out cargo-component which automates that for you

A Cargo subcommand for creating WebAssembly components based on the component model proposal. - GitHub - bytecodealliance/cargo-component: A Cargo subcommand for creating WebAssembly components bas...

view this post on Zulip Peter Huene (Nov 08 2022 at 19:16):

note it behaves a little differently as a wit-bindgen proc-macro isn't used to generate the bindings so the source looks a little different

view this post on Zulip Jens Gåsemyr Magnus (Nov 09 2022 at 09:11):

Peter Huene said:

Jens Gåsemyr Magnus also check out cargo-component which automates that for you

Thanks! Will look into it :grinning_face_with_smiling_eyes:


Last updated: Dec 23 2024 at 12:05 UTC