Stream: general

Topic: `Resource` and `ExternRef`


view this post on Zulip Wu Yu Wei (Jun 30 2025 at 08:37):

Hello, I noticed wasmtime has implemented GC types since last November and I'm interested to see if it can be a DOM script engine. For my use case, I need to store most of the data as GC traced object.

I wonder is it acceptable to create another Store and use it to create and push ExternRef to ResourceTable?

view this post on Zulip bjorn3 (Jun 30 2025 at 10:16):

ResourceTable is for wasm components. For a web browser (or javascript engine) you wouldn't use wasm components. They aren't supported by any existing js engines anyway.

view this post on Zulip bjorn3 (Jun 30 2025 at 10:17):

All js code that would be able to directly interact with each other needs to use a single wasm store according to the wasm js interface spec:

Each agent has an associated store. When a new agent is created, its associated store is set to the result of store_init().

view this post on Zulip Wu Yu Wei (Jun 30 2025 at 10:40):

Oh what I mean is using wasmtime directly as a script backend for projects like servo perhaps. A few years ago, servo community had a topic about replacing spidermonkey and I was interested in exploring wasm only backend. But the nature of DOM forces its objects need to be GC traced.


Last updated: Dec 06 2025 at 05:03 UTC