Currently in Wasmtime's API we have Func::call{,_async}. When calling these functions we additionally require embedders to call Func::post_return{,_async}. The intention here was to enable hosts to type guest return values with WasmStr and WasmList<T> to enable zero-copy usage of wasm return values.
In practice, however, bindings generation never uses WasmStr nor WasmList. Additionally they're cumbersome and not super well documented. So my theory at this current time is no one is using this capability despite perhaps wanting such a capability in the future.
The reason I ask is that call_concurrent, added with component-model-async, already acts quite differently. The call_concurrent function automatically calls post-return for async reasons. This split has been a source of bugs and headaches and in talking with @Joel Dice we're concluding that the best route forward would be to (a) remove the embedder-level API of Func::post_return and (b) in the future add a method of calling a function where the results are communicated via a closure. This closure would be able to use WasmStr/WasmList and would work with call_concurrent.
I wanted to ask, though, is anyone using this functionality? If so we can plan more on keeping it in the meantime and/or game out what this closure-based API would look like.
This change is landing in https://github.com/bytecodealliance/wasmtime/pull/12498
Last updated: Feb 24 2026 at 04:36 UTC