There is long standing gap in wasmtime C API for working with WASIp2 guests. I think this is because core team mostly works with Rust.
If I wanted to use WASIp2 features of wasmtime while embedding inside of dotnet I'm depended on those features to be exposed as C API first and then I need to build C# projection.
But we already have great language independent IDL, WIT+component model. So I realized that we could use wit-bingen to expose the wasmtime embedding APIs and consume it it C# by wit-bindgen. Instead of hop thru C language.
@Christof Petig told me last year that he is using component model for interop between different languages of the same process and address space.
I don't know if maintaining embedding WIT is easier than finishing the C embedding API. But doing it in WIT would make consumption language independent. And the new features of the embedding API would be available in any language at the same time.
There's actually been some steady progress from a contributor MangoPeachGrape in adding C API support to the component model. It's not based on WIT but I've long wanted to have an option for something based on WIT. Basically the exact ABI for more efficient function calls I think is still an open question where WIT provides a nice answer
Sorry, this thread simply got scrolled past on my side.
Indeed I have been completing a design for WIT between native shared objects which eliminates most copies (eliminating all require an API change).
I call this symmetric mode, https://github.com/cpetig/wit-bindgen/tree/work-in-progress has the most recent version of it. Currently I also have streams and futures working in C++ and Rust, async calls are on the implementation list for "tonight".
If you want a sneak peek simply run the normal WIT runtime tests (including a few of the async) with --symmetric and watch them compile for and run on native. Not everything is perfect but most is working fine.
I would like to add a hash (of the binary WIT subset) to the function to cause linker error on the slightest chance of incompatible changes to arguments and results - and also work on a zero-copy publisher (multiple) subscriber extension which is compatible between native and wasm (see https://github.com/WebAssembly/component-model/issues/398#issuecomment-3116844798 )
PS: While there is a draft merge request on wit-bindgen https://github.com/bytecodealliance/wit-bindgen/pull/1098 I tend to stall pushing to that branch to minimize CI load.
@Christof Petig you're not going to be at OSS Summit EU by any chance, are you?
I didn't plan for it, but it looks very interesting.
Last updated: Dec 06 2025 at 06:05 UTC