Stream: git-wasmtime

Topic: wasmtime / issue #10932 Access to memory and globals from...


view this post on Zulip Wasmtime GitHub notifications bot (Jun 05 2025 at 19:29):

simon-bourne opened issue #10932:

Hi,

I have some code that hosts a wasm module and is able to snapshot it (in a similar way to Wizer).

I'd love to be able to host the wasm module as a component using wasmtime::component::bindgen on the host and wit-bindgen::generate on the guest. This makes communicating between the host and guest much easier and safer.

The trouble is, for snapshotting I'm using various methods on wasmtime::Instance that don't seem to have equivalents in the component API. For example:

For a component instantiated like the bindgen hello world example, I don't think there's any way to access the low level wasmtime::Instance. Would it be possible to give access the globals, memories, tables and functions?

view this post on Zulip Wasmtime GitHub notifications bot (Jun 05 2025 at 19:38):

pchickey assigned fitzgen to issue #10932.

view this post on Zulip Wasmtime GitHub notifications bot (Jun 05 2025 at 21:50):

fitzgen commented on issue #10932:

Wasmtime will only give access to things that the module/component exports, it won't expose the module/component's implementation details.

Because components can only import and export component-level things, we intentionally don't expose any of the core-level implementation details.

You can look at the component-init project for an example of how to do Wizer-style instrumentation despite these constraints.

view this post on Zulip Wasmtime GitHub notifications bot (Jun 05 2025 at 23:20):

simon-bourne closed issue #10932:

Hi,

I have some code that hosts a wasm module and is able to snapshot it (in a similar way to Wizer).

I'd love to be able to host the wasm module as a component using wasmtime::component::bindgen on the host and wit-bindgen::generate on the guest. This makes communicating between the host and guest much easier and safer.

The trouble is, for snapshotting I'm using various methods on wasmtime::Instance that don't seem to have equivalents in the component API. For example:

For a component instantiated like the bindgen hello world example, I don't think there's any way to access the low level wasmtime::Instance. Would it be possible to give access the globals, memories, tables and functions?

view this post on Zulip Wasmtime GitHub notifications bot (Jun 05 2025 at 23:20):

simon-bourne commented on issue #10932:

Thanks for the quick reply! I wasn't aware of component-init. It looks as though it just exports getters for the memory and globals. That gives me something to think about anyway.


Last updated: Dec 06 2025 at 06:05 UTC