Hey all,
I'm interested in surfacing an API from a Rust host to a given Wasm guest program. Wasmtime looks like a good fit for my host engine. For the API encoding/schema, I've been trying to catch up on the last few years of discussion/progress on WebAssembly Interface Types, WebAssembly Components, Canonical ABI, etc. and am a touch confused as to the "recommended" path forward _today_. I understand that everything is still in flux, so I figured I'd ask directly and see if anyone has a "current" answer:
1) Is wit-bindgen + *.wit
files the currently recommended tooling for "encoding" an API between a Wasmtime host and guest and providing the language-specific generated code?
2) If *.wit
is the format of record for encoding this API, is there a good IDL explainer (akin to this one for flatbuffers or this one for protobuf?) as to how to write a schema file?
I've looked at the WebAssembly Interface Types explainer but everything there is written in S-expressions and framed in terms of low level semantics instead of being a high-level introduction to the schema that I see wit-bindgen accepting.
I'm hopeful that I've just overlooked something obvious. My apologies if my Google-fu was weak.
Any help would be greatly appreciated. Thank you.
1) Yes. 2) This is a pretty good intro, though note that some parts of the system are still evolving, so please ask here, or file an issue, if something doesn't work. There are also some examples in the wit-bindgen tree, wasi-filesystem is another.
Amazing, I had exactly the same set of questions and this answers it, lots of confusing/outdated/contradicting information floating around :smile:
Last updated: Nov 22 2024 at 17:03 UTC