by fulafel · 3y ago · 0 comments
This is why I don't understand the WASM GC proposal, which I understand to be an attempt to make a GC that works for all languages. Can you really write a GC that performantly supports both Java and Go given the different tradeoffs/approaches each makes with respect to memory management, layout semantics, etc?
Keep in mind that typical builds of Hotspot support four or five garbage collectors, and most of them with two different pointer sizes. The required read and write barriers differ widely between collectors and in some cases even collector modes.
I'm not saying that it's going to be easy (an incredible amount of effort went into Hotspot over the years). But it's definitely possible to support wildly different GC strategies efficiently with sufficiently late code generation.
Webassembly, as I see it, is about creating VM which provides acceptable performance with ultimate sandboxing.
It's a replacement for JavaScript transpilation, not for JVM.
Of course it's tempting to do it all without sacrificing anything, but I guess you can't have a cake and eat it too.
I mean, the Graal JVM GC supports a ton of languages, especially if you include their LLVM support. Many of them are quite high performance. Truffle Ruby I believe is still (one of if not) the fastest Ruby implementation(s).
[1]: https://users.cecs.anu.edu.au/~steveb/pubs/papers/g1-vee-202...
That is the cool thing about having multiple implementations.