Stream: git-wasmtime

Topic: wasmtime / PR #12366 Refactor core wasm host entrypoints


view this post on Zulip Wasmtime GitHub notifications bot (Jan 16 2026 at 23:07):

alexcrichton opened PR #12366 from alexcrichton:more-func-refactor to bytecodealliance:main:

This commit refactors the internals of how guest functions call out to the host. Previously Wasmtime had a split where Func::new-style constructors used one entrypoint and Func::wrap-style entrypoints used a different entrypoint. This was required long ago when we had an array and native ABI calling convention, but nowadays this is no longer required. This refactors things to have a single base-level signature which is the narrow waist through which all other function entrypoints go through. This enables having a single function handle all the things like panicking, call hooks, etc, and everything further builds on top of it.

This commit additionally pushes the async-ness of a function down even further. Previously many *_async constructors would quickly delegate to their non-async counterpart, but this is expected to more-or-less become not the right way to do things as wasmtime moves into the future. Historical refactorings related to GC, for example, have pushed async further down within Wasmtime and this continues that trend. There's no immediate benefit just yet, but this is hoped to make future refactorings easier.

Along the way some minor API changes happened too:

Finally, another eventual goal of this work is to share more between core wasm and components in terms of implementation. Right now the component host function entrypoints are quite different than the core wasm ones and that ideally wouldn't endure forever.

<!--
Please make sure you include the following information:

Our development process is documented in the Wasmtime book:
https://docs.wasmtime.dev/contributing-development-process.html

Please ensure all communication follows the code of conduct:
https://github.com/bytecodealliance/wasmtime/blob/main/CODE_OF_CONDUCT.md
-->

view this post on Zulip Wasmtime GitHub notifications bot (Jan 16 2026 at 23:07):

alexcrichton requested fitzgen for a review on PR #12366.

view this post on Zulip Wasmtime GitHub notifications bot (Jan 16 2026 at 23:07):

alexcrichton requested wasmtime-core-reviewers for a review on PR #12366.

view this post on Zulip Wasmtime GitHub notifications bot (Jan 17 2026 at 00:39):

alexcrichton updated PR #12366.

view this post on Zulip Wasmtime GitHub notifications bot (Jan 17 2026 at 01:00):

alexcrichton updated PR #12366.

view this post on Zulip Wasmtime GitHub notifications bot (Jan 17 2026 at 01:00):

alexcrichton requested wasmtime-default-reviewers for a review on PR #12366.

view this post on Zulip Wasmtime GitHub notifications bot (Jan 17 2026 at 02:23):

github-actions[bot] added the label wasmtime:api on PR #12366.

view this post on Zulip Wasmtime GitHub notifications bot (Jan 17 2026 at 02:23):

github-actions[bot] added the label wasmtime:c-api on PR #12366.

view this post on Zulip Wasmtime GitHub notifications bot (Jan 20 2026 at 20:08):

fitzgen created PR review comment:

A while back we found that our pub fn new(impl AsContextMut)/pub(crate) fn _new(&mut StoreOpaque) pair conventions were hiding when the latter constructor was dead code due to its underscore prefix.

Do we want to avoid the underscore prefix here as well?

view this post on Zulip Wasmtime GitHub notifications bot (Jan 20 2026 at 20:08):

fitzgen submitted PR review:

Looks great, thanks for this clean up!

view this post on Zulip Wasmtime GitHub notifications bot (Jan 20 2026 at 20:08):

fitzgen created PR review comment:

ensure!?

view this post on Zulip Wasmtime GitHub notifications bot (Jan 20 2026 at 20:08):

fitzgen created PR review comment:

Nitpick: newlines between methods in the impl block.

view this post on Zulip Wasmtime GitHub notifications bot (Jan 20 2026 at 20:24):

alexcrichton updated PR #12366.

view this post on Zulip Wasmtime GitHub notifications bot (Jan 20 2026 at 20:24):

alexcrichton has enabled auto merge for PR #12366.

view this post on Zulip Wasmtime GitHub notifications bot (Jan 20 2026 at 20:40):

alexcrichton added PR #12366 Refactor core wasm host entrypoints to the merge queue.

view this post on Zulip Wasmtime GitHub notifications bot (Jan 20 2026 at 21:05):

alexcrichton merged PR #12366.

view this post on Zulip Wasmtime GitHub notifications bot (Jan 20 2026 at 21:05):

alexcrichton removed PR #12366 Refactor core wasm host entrypoints from the merge queue.


Last updated: Jan 29 2026 at 13:25 UTC