Stream: git-wasmtime

Topic: wasmtime / PR #13235 Fill out GC type reflection in the C...


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

alexcrichton opened PR #13235 from alexcrichton:c-api-reftypes to bytecodealliance:main:

This commit fills out APIs necessary to reflect on value types to get the full type hierarchy of WebAssembly. Currently types in the C API are primarily inherited from wasm.h which notably doesn't handle proposals such as simd or GC or typed function references. This puts us in a bit of an awkward position where much of our API relies on wasm.h, but there's obvious holes in wasm.h that would otherwise require modifications.

This commit takes the route of adding a parallel wasmtime_valtype_t definition fully tailored for Wasmtime's use case. Conversions are then provided between wasmtime_valtype_t and wasm_valtype_t. The Wasmtime version notably has a different representation which enables, for example, constructing primitive types without function calls.

This then fills out the corresponding C++ APIs and fills gaps in the preexisting types. For example FieldType is much different from before and now follows C++ idioms and semantics. Additionally it now has the ability to express the full breadth of all wasm types in fields and they can both be constructed and read.

This is all necessary for some implementation work to fill out the GC proposal in the wasmtime-py bindings where the lack of type information was otherwise leading to a pretty awkward API relative to the rest of the package.

<!--
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 30 2026 at 00:39):

alexcrichton requested fitzgen for a review on PR #13235.

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

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

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

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

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

alexcrichton updated PR #13235.

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

alexcrichton updated PR #13235.

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

alexcrichton updated PR #13235.

view this post on Zulip Wasmtime GitHub notifications bot (May 01 2026 at 18:41):

:thumbs_up: fitzgen submitted PR review:

LGTM!

view this post on Zulip Wasmtime GitHub notifications bot (May 01 2026 at 18:41):

fitzgen added PR #13235 Fill out GC type reflection in the C API to the merge queue.

view this post on Zulip Wasmtime GitHub notifications bot (May 01 2026 at 19:07):

github-merge-queue[bot] removed PR #13235 Fill out GC type reflection in the C API from the merge queue.

view this post on Zulip Wasmtime GitHub notifications bot (May 01 2026 at 19:35):

alexcrichton updated PR #13235.

view this post on Zulip Wasmtime GitHub notifications bot (May 01 2026 at 19:35):

alexcrichton has enabled auto merge for PR #13235.

view this post on Zulip Wasmtime GitHub notifications bot (May 01 2026 at 19:52):

alexcrichton added PR #13235 Fill out GC type reflection in the C API to the merge queue.

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

github-merge-queue[bot] removed PR #13235 Fill out GC type reflection in the C API from the merge queue.

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

alexcrichton added PR #13235 Fill out GC type reflection in the C API to the merge queue.

view this post on Zulip Wasmtime GitHub notifications bot (May 01 2026 at 23:24):

:check: alexcrichton merged PR #13235.

view this post on Zulip Wasmtime GitHub notifications bot (May 01 2026 at 23:24):

alexcrichton removed PR #13235 Fill out GC type reflection in the C API from the merge queue.


Last updated: May 03 2026 at 22:13 UTC