Is it possible to link two Wasm components at runtime with the wasmtime::component::Linker?
I have one component exporting one function and another component importing that function. I instantiate the component with the export in the linker and then try to instantiate the component importing that function but get an error message saying a matching implementation was not found in the linker. Is this supported without adding a hostcall implementation for the import that calls the export of the other component?
Not currently, no, it's required that the values travel through the host or that the component is composed ahead of time with tooling such as wac
For having the values travel through the host, is there an example you can point me to?
I don't have an exact example off-hand but one example would be to use func_new plus Func::call to funnel everything through component::Val. That may not be super efficient depending on the context though so if you know the types ahead of time you can use the typed versions of the APIs
I know the types involved so I'll use the typed APIs. Thanks for the help!
Jeff Charles has marked this topic as resolved.
Last updated: Dec 06 2025 at 06:05 UTC