Stream: git-wasmtime

Topic: wasmtime / PR #13497 Loosely integrate `implements` into ...


view this post on Zulip Wasmtime GitHub notifications bot (May 27 2026 at 17:46):

alexcrichton opened PR #13497 from alexcrichton:implements-bindgen to bytecodealliance:main:

This commit is the next step in fleshing out #12698 and following in the footsteps of #13361 to integrate the (implements ...) directive into bindgen!. Notably this world:

world foo {
    import a: thing;
    import b: thing;
}

will only generate a single trait for thing::Host as opposed to the previous 2 traits that were generated. This enables hosts to use the same trait implementation for both, or customize as appropriate.

Additionally the add_to_linker-generated methods for interfaces are now refactored to additionally have an add_to_linker_instance entrypoint. This new entrypoint takes a LinkerInstance instead of a Linker and fills in the provided instance directly. This is in-turn used to fill out a linker for the foo world above.

Notably, however, embedders can call add_to_linker_instance with distinct closures accessing different parts of T, the store's state, meaning that it's possible to have two distinct implementations for a and b above.

Many golden tests were updated with this new add_to_linker_instance method, and codegen/runtime tests were added for a simple world as well showcasing the bindings modes that are possible. The (rarely used) top-level world add_to_linker only uses a single trait implementation, but invoking add_to_linker_instance enables passing in two separate implementations.

<!--
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 (May 27 2026 at 17:46):

alexcrichton requested dicej for a review on PR #13497.

view this post on Zulip Wasmtime GitHub notifications bot (May 27 2026 at 17:46):

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

view this post on Zulip Wasmtime GitHub notifications bot (May 28 2026 at 14:51):

:thumbs_up: dicej submitted PR review.

view this post on Zulip Wasmtime GitHub notifications bot (May 28 2026 at 14:51):

:speech_balloon: dicej created PR review comment:

Would it be valuable to add a test here that verifies that get and/or set calls by the guest are directed to the correct caches, i.e. add a runtime test with a non-dummy component in addition to the instantiation tests?

view this post on Zulip Wasmtime GitHub notifications bot (May 28 2026 at 14:51):

:speech_balloon: dicej created PR review comment:

Suggestion: add crates/component-macro/tests/expanded/** linguist-generated=true to .gitattributes to hide these generated files in diffs by default.

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

alexcrichton requested fitzgen for a review on PR #13497.

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

alexcrichton updated PR #13497.

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

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

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

alexcrichton has enabled auto merge for PR #13497.

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

alexcrichton added PR #13497 Loosely integrate implements into bindgen! to the merge queue

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

:check: alexcrichton merged PR #13497.

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

alexcrichton removed PR #13497 Loosely integrate implements into bindgen! from the merge queue


Last updated: Jun 01 2026 at 09:49 UTC