3 ms·
The answer was kind of known before hand. It was to enable the use of GCed languages like Python on Ruby to create WASM applications. Meanwhile, non-GCed langua
by goku12 1y ago
The answer was kind of known before hand. It was to enable the use of GCed languages like Python on Ruby to create WASM applications. Meanwhile, non-GCed languages like Rust, C and C++ were supposed to continue to work as before on WASM without breaking compatibility. This is what they seem to have finally achieved. But I needed to make sure of it. So, here are the relevant points from the WASM GC proposal [1]:
* Motivation
- Efficient support for high-level languages
- faster execution
- smaller modules
- the vast majority of modern languages need it
* Approach
- Pay as you go; in particular, no effect on code not using GC, no runtime type information unless requested
- Don't introduce dependencies on GC for other features (e.g., using resources through tables)
[1] https://github.com/WebAssembly/spec/blob/wasm-3.0/proposals/gc/Overview.md https://github.com/WebAssembly/spec/blob/wasm-3.0/proposals/...
- larodi 1y agoto also consider this one https://github.com/6over3/zeroperl https://github.com/6over3/zeroperl
- wffurr 1y agoNote that the high level language needs a sufficient abstraction in its own runtime to allow substituting the Wasm GC for the runtime’s own GC. Work has been done for Java and Kotlin, but Python, C#, Ruby, Go can’t yet use the Wasm GC.
- goku12 1y agoAgreed. That's what I guessed too. WASM GC is probably a low level component which high level languages can wrap to get their native/idiomatic GC behavior. > Work has been done for Java and Kotlin I'm unaware of this development. What did they do? Did they create an interface to the GC specification in the draft proposal?
- wffurr 1y agoWell, for Java it's actually a separate compiler that targets Wasm and integrates with WasmGC: https://github.com/google/j2cl https://github.com/google/j2cl The Google Sheets team used it for their calc engine: https://v8.dev/blog/wasm-gc-porting https://v8.dev/blog/wasm-gc-porting For Kotlin it's similar but the compiler backend is from Jetbrains themselves, targets Wasm and adapts the Kotlin runtime to use WasmGC: https://kotlinlang.org/docs/wasm-overview.html https://kotlinlang.org/docs/wasm-overview.html. https://seb.deleuze.fr/introducing-kotlin-wasm/ https://seb.deleuze.fr/introducing-kotlin-wasm/ has some low level detail on how Kotlin works with WasmGC. A bit more on Kotlin/Wasm here, seems like also Dart/Flutter uses WasmGC: https://developer.chrome.com/blog/wasmgc#kotlin_wasm https://developer.chrome.com/blog/wasmgc#kotlin_wasm https://github.com/dotnet/runtime/issues/94420 https://github.com/dotnet/runtime/issues/94420 has some notes on why C# can't use WasmGC (yet?).
- goku12 1y agoGood info! Thanks!