-
Notifications
You must be signed in to change notification settings - Fork 1.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Implement the WebAssembly GC Proposal #5032
Comments
FYI we are now able to run a Kotlin/Wasm HTTP server via KoWasm on Node.js and I would be happy to leverage Wasmtime to run it as soon as it will get GC support. This would be a really good fit since we would like to leverage WASI Preview2+ and Wasm Component Model asap. See also my blog post The huge potential of Kotlin/Wasm for more context. |
Heads up: I am working on an RFC to work out the design of our Wasm GC support. I expect to start implementing Wasm GC once that RFC reaches consensus and merges and I've finished implementing Wasm tail calls. |
RFC is up: bytecodealliance/rfcs#31 |
hey there! any updates on this front? Really looking forward to use Kotlin/WASM with this runtime. |
There is work on parsing and validation, and refactors setting the stage for these things, happening in the |
@fitzgen could you provide links to the issues over there? I want to keep track with the progress due to the impact on Kotlin |
@smndtrl since bytecodealliance/wasm-tools#1346 merged, all GC spec tests are passing in wasm-tools. You can look at https://github.com/bytecodealliance/rfcs/blob/main/accepted/wasm-gc.md#incremental-implementation-plan and https://docs.wasmtime.dev/contributing-implementing-wasm-proposals.html to get an idea of what is still to be done. |
The function references proposal still needs to be exposed in the embedder API. I am actively working on that and the rest of getting Wasm GC implemented. Right now it mostly involves some refactoring to the runtime's internals to pave the way for future changes. Unfortunately, there isn't much that can be split out and implemented in parallel right now. |
FYI: #7943 finishes the function references proposal and takes the first baby steps towards Wasm GC inside Wasmtime, adding support for Wasm GC's |
It looks like all gc types declarations are supported. Can we create an issue to track the progress of the gc proposal, such as
|
Yes all the types are supported now, but instantiating them is not implemented yet; I'm working on it. Then the various instructions. Then the collector itself. (Right now we are reusing the deferred reference-counting collector that Wasmtime already has, so we can collect some garbage, but not cycles). Personally, I'm not a huge fan of opening a bunch of tracking issues for things already effectively tracked by this issue. Happy to cross-link more PRs here as they come in though. |
Hi there! Just wondering if there are noteworthy updates on this front. |
All the Almost done with Still to do:
|
Two notes:
|
@fitzgen Great news! Thanks for the updates! |
@fitzgen, do I understand correctly that storing a |
That was true before a few days ago. Now, And FWIW, all Wasm GC spec tests are now passing on |
@fitzgen, but I got the following error on dev build from
|
@bashor ah! looks like I missed a spot, thanks for finding it. FWIW, I think this should only be reachable from const expressions and host APIs. Will whip up a fix in a minute. |
@fitzgen Thanks! Now it works! 🚀 https://x.com/bashorov/status/1844725893752553957 |
@bashor awesome!! Thanks for kicking the tires :) |
Hi @bashor I'm interested in running Kotlin WASI on Wasmtime, so I gave it a try, but I encountered an error. Do you have any ideas RUST_BACKTRACE=1 ./target/debug/wasmtime -W function-references,gc ./kotlin-wasm-wasi-example-wasm-wasi.wasm
Error: failed to parse WebAssembly module
Caused by:
exceptions proposal not enabled (at offset 0x6750) Envs:
|
@hoangpq you might be interested in this comment perhaps. Wasmtime doesn't yet implement the exception-handling proposal for WebAssembly, so Kotlin won't run until that's implemented. |
Thank you @alexcrichton. |
Hi, @hoangpq! You can uncomment/add these lines to prevent using EH by Kotlin/Wasm toolchain. Note that the option was added only to allow earlier experimentation with VMs with limited/lack of EH support. In this mode, throwing an exception will lead to a trap (~program termination). |
Got it. Thanks, @bashor. |
@fitzgen I get the following error:
|
Looks like I missed a spot! Thanks for the report. Can you share the test case and steps to reproduce? Either here or in a new issue is fine. Thanks! |
I was trying this piece of code: bdd.zip
|
Thanks! I'll take a look soon |
Hey @fitzgen! During experiments with Kotlin Wasm WASI on Wasmtime I found several issues.
Overall, every line from the example above produces an error on it's own :) First four lines produces the following stack trace:
And the last line produces the following:
It works with Node.js and WasmEdge and outputs:
Hope this is fine to leave this here :) |
Thanks for reporting the issue! I just got back from vacation and am slowly catching up on things. Will take a deeper look soon. |
Tracking issue for implementation of the WebAssembly GC proposal
Tasks
GC heap out of memory
errors #9701assertion left == right failed
on Wasm module init in Rust-embedded Wasmtime #9714The text was updated successfully, but these errors were encountered: