Stream: git-wasmtime

Topic: wasmtime / PR #13154 Refactor reference types in the C/C+...


view this post on Zulip Wasmtime GitHub notifications bot (Apr 20 2026 at 22:01):

alexcrichton opened PR #13154 from alexcrichton:refactor-gc-c-api to bytecodealliance:main:

In updating wasmtime-py to Wasmtime 44 I noticed a few discrepancies in the C API, and then C++ API, in addition to what was found in #13149. Notably we had both wasmtime_exn_t/Exn and
wasmtime_exnref_t/ExnRef. In sorting this out with some deeper fixes in #13149 I got stuck again in the rat's nest of circular definitions of classes in C++. In the end I gave up trying to incrementally improve things and decided to go with a larger refactoring. The goal here is to more cleanly separate out responsibilities and improve how circular definitions in C++ are handled:

Overall this PR contains quite a lot of code movement and things were shuffled around, as well as adjustments to the exnref C API (removing duplication). Overall though the API is largely as it was before, although for the C++ API if individual headers are being included some new ones may need to be included to ensure all methods are defined.

My hope is that the end result here is a bit more maintainable, types are easier to modify/extend, there's no longer any soups to deal with in C++, and everything should have a uniform API.

<!--
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 (Apr 20 2026 at 22:01):

alexcrichton requested dicej for a review on PR #13154.

view this post on Zulip Wasmtime GitHub notifications bot (Apr 20 2026 at 22:01):

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

view this post on Zulip Wasmtime GitHub notifications bot (Apr 20 2026 at 22:16):

alexcrichton updated PR #13154.

view this post on Zulip Wasmtime GitHub notifications bot (Apr 20 2026 at 23:11):

alexcrichton updated PR #13154.

view this post on Zulip Wasmtime GitHub notifications bot (Apr 20 2026 at 23:14):

alexcrichton updated PR #13154.

view this post on Zulip Wasmtime GitHub notifications bot (Apr 21 2026 at 03:49):

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

view this post on Zulip Wasmtime GitHub notifications bot (Apr 21 2026 at 13:31):

fitzgen submitted PR review:

LGTM

I think in the few other C++ codebases I've touched, the _foo.hh would be foo.hh and the existing foo.hh would be foo-inlines.hh but I don't really care what color we paint the bikeshed.

view this post on Zulip Wasmtime GitHub notifications bot (Apr 21 2026 at 13:31):

fitzgen created PR review comment:

// ============================================================================
// wasmtime_array_type_t

?

view this post on Zulip Wasmtime GitHub notifications bot (Apr 21 2026 at 13:31):

fitzgen created PR review comment:

Awkward indent, I think it should be something like

        )?
    }) => {

to match the opening

view this post on Zulip Wasmtime GitHub notifications bot (Apr 21 2026 at 13:31):

fitzgen created PR review comment:

 * APIs for interacting with WebAssembly GC `structref` type in Wasmtime.

view this post on Zulip Wasmtime GitHub notifications bot (Apr 21 2026 at 14:42):

alexcrichton updated PR #13154.

view this post on Zulip Wasmtime GitHub notifications bot (Apr 21 2026 at 14:43):

alexcrichton commented on PR #13154:

Oh nice! I'll be honest in that I don't really have much experience in C++ codebases. I'm going to flag this for merge mostly out of inertia, but I'm also happy to adjust to that pattern next time I'm in these parts.

view this post on Zulip Wasmtime GitHub notifications bot (Apr 21 2026 at 14:43):

alexcrichton has enabled auto merge for PR #13154.

view this post on Zulip Wasmtime GitHub notifications bot (Apr 21 2026 at 15:16):

alexcrichton added PR #13154 Refactor reference types in the C/C++ API to the merge queue.

view this post on Zulip Wasmtime GitHub notifications bot (Apr 21 2026 at 15:41):

alexcrichton merged PR #13154.

view this post on Zulip Wasmtime GitHub notifications bot (Apr 21 2026 at 15:41):

alexcrichton removed PR #13154 Refactor reference types in the C/C++ API from the merge queue.


Last updated: May 03 2026 at 22:13 UTC