wasmtime-dotnet icon indicating copy to clipboard operation
wasmtime-dotnet copied to clipboard

WasmGC

Open cyraid opened this issue 5 months ago • 8 comments

Now that version 34 is pretty much here(?), will there be support WasmGC? Reading blog post it looks like it arrived in wasmtime with version 27.

Benefits would be smaller wasm modules needed from what I read? I would definitely be interested in this!

cyraid avatar Jul 29 '25 06:07 cyraid

Unfortunately the Wasm GC proposal as it stands does not have enough for dotnet GC

yowl avatar Jul 29 '25 16:07 yowl

@yowl In what way if I may ask? Could you give me a bit more information? :) (and perhaps they'll have what they need in post-v1?) maybe we can voice our input on what it needs in the webassembly spec?

cyraid avatar Jul 29 '25 16:07 cyraid

https://github.com/dotnet/runtime/issues/94420 Has a good technical description of the current state of play.

yowl avatar Jul 29 '25 16:07 yowl

Thanks @yowl for the link. That's the kind of conversation I was looking for.

cyraid avatar Jul 29 '25 16:07 cyraid

Unfortunately the Wasm GC proposal as it stands does not have enough for dotnet GC

@yowl Am I missing something or does this entire discussion apply to .NET code compiled to WASM, which is not the same thing as running something else with its own GC needs, compiled to WASM?

Concretely, I have implemented a small language which compiles to WASM, the compiler is written in .NET but I don't need the .NET runtime in any way, shouldn't it be possible to run my lang (compiled to WASM or WAT) from .NET test code via wasmtime dotnet?

ddotlic avatar Aug 05 '25 09:08 ddotlic

Correct, I was referring to using WasmGC as a replacement for dotnet's GC. Your own language can do as it likes.

yowl avatar Aug 05 '25 12:08 yowl

I'm a bit confused. What's blocking Wasmtime.NET from supporting GC? What would need to be done to support it?

Context: I'm working on a WASM plugin for Resonite, a VR sandbox game. To access game objects inside of WASM, I'll need GC to support languages such as Rust which don't support externref (I need to write the externref to a table).

ColinTimBarndt avatar Oct 10 '25 15:10 ColinTimBarndt

I found https://github.com/bytecodealliance/wasmtime-dotnet/pull/337 which adds the WithGC config option. Is that all?

ColinTimBarndt avatar Oct 10 '25 16:10 ColinTimBarndt