Are there any plans for WasmGC integration? #23273
Unanswered
arximboldi
asked this question in
Q&A
Replies: 1 comment 2 replies
-
You might want to look at the previous work to allow using
|
Beta Was this translation helpful? Give feedback.
2 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
There is a whole set of interesting use-cases that open with WasmGC: https://github.com/WebAssembly/gc
It seems most major browsers support it now.
For example, I develop applications where complex data-models are modeled using simple types combined with immutable data-structures (via Immer: https://github.com/arximboldi/immer). One limitation of this approach is that operating on these data-types from JS is too cumbersome because of the need for
delete()
which goes completely against the expectations of JS, particularly when operating with immutable data.For now, I am working around this by having C++ own all the data and expose only references (see #23271). I have also considered just letting those objects "leak". Since they only own memory, it is not strictly a leak if the object is never finalized because it was never collected. The problem with this approach is that because the JS GC does not see into the C++ heap, it may not collect objects from JS even if the C++ heap is getting full.
What would be most interesting is to leverage the JS GC heap directly for all these simple Immer based value trees (Immer does support GC's, e.g Boehm's GC). This would have multiple advantages, even beyond
Are there any plans to expose WasmGC to C or C++? I am also considering that maybe this doesn't even need to be done via Emscripten, but I can do it myself directly. Any of the devs here can give me some hints on how to do this?
Beta Was this translation helpful? Give feedback.
All reactions