Description
Feature
Add component model support to the c-api (particularly the ability run a component from a c-api host).
Benefit
Much of the WebAssembly world is currently (re)tooling around the component model as it approaches MVP. The ability to run components will quickly become more critical with the finalization of the wasi preview 2 abi. Currently C/C++ is the largest fully-supported language with a clear path to producing component guests (through wit-bindgen
) that does not have a path to run from a host in the same language.
Implementation
I can take a first pass at this modeled roughly around the Rust crate with the current c-api idioms (for example wasmtime_config_wasm_component_model(conf, true);
, a component aware linker (perhaps wasmtime_linker_define_component_model(linker);
), etc. I haven't looked deep enough into the implementation yet to see if there is significant core functionality to enable this past the standard glue code and lifecycle management for c objects.
Alternatives
Eventually this will become necessary - it's a matter of timing. I suspect that this has just not yet been implemented due to the instability of wasmtime::component
.
CC: Discussed with @sunfishcode at the BA hackathon