Stream: wasmtime

Topic: Getting component information on host calls


view this post on Zulip Celarye (Nov 13 2025 at 14:09):

Currently I allow components to make host calls for stuff like registrations/logging/etc. I am wondering if there is some way for the host to know which component is making the call so that I can do things like mapping the registration to the correct component. Let me know if you would like to see some examples of what I mean if necessary.

view this post on Zulip Till Schneidereit (Nov 13 2025 at 14:56):

this came up in a conversation in our team just yesterday as well.

One question: do you need to know which component type the call came from, or which component instance? In our case the latter is important, as the same component type could be instantiated multiple times, and with different sets of configuration

view this post on Zulip Celarye (Nov 13 2025 at 15:03):

Yes it's indeed the instance I want to be able to differentiate on. If I understand it correctly they're all the same type anyways (instantiate them with Plugin::instantiate_async, where Plugin is a wit-bindgen generated type).

view this post on Zulip Till Schneidereit (Nov 13 2025 at 20:36):

the type would still be different per specific component, even if the implemented interfaces are the same. The difference is mostly relevant for component graphs, where a nested component could make a call instead of the top-level one, I guess

view this post on Zulip Lachlan Gunn (Nov 18 2025 at 17:31):

We have been working on some changes to Wasmtime to allow this that were briefly discussed here earlier this month. But this is still at the "interesting [to me] academic project" stage rather than something that might be upstreamed as-is. I wasn't able to see a good way of doing it with stock Wasmtime unfortunately.

view this post on Zulip Eduard Smet (Celarye) (Jan 30 2026 at 17:01):

It seems that this topic and a relevant PR by Lachlan Gunn and their team has gone stale. And unfortunately looking at the discussions in that PR I think I'm quite a bit in over my head here.

But I think supporting some way to identifying the component making a host still will be very useful. And as Till Schneidereit's team also seemed to have some interest in this feature I wanted to poll if there has been any progress towards supporting this?

If not I would love to eventually try and put work into contributing a feature like this myself but this would of course require quite some time and guidance for me to learn how Wasmtime's internals and so work.

view this post on Zulip Eduard Smet (Celarye) (Jan 30 2026 at 17:44):

component making a host

I meant "making a host call" but sadly can't edit the above message anymore.

view this post on Zulip Alex Crichton (Jan 30 2026 at 18:11):

My understanding of the conclusions of discussions around this is that ideally wasmtime would not provide caller information to host functions. That is unlikely to ever happen on the web, for example, and has a lot of downsides in terms of long term maintainability and design.

Put another way, ideally the need for this feature would be resolved a different way. If you're up for it we can chat over a new zulip topic perhaps focused on your use case

view this post on Zulip Eduard Smet (Celarye) (Jan 30 2026 at 18:18):

I see, I will make a new post!


Last updated: Feb 24 2026 at 04:36 UTC