davexunit 6 months ago

Slower, single threaded, greatly increases binary size, separate heap from JS so bad interop with extern refs. Wasm GC is a great thing.

dzaima 6 months ago

You can't GC together with the host environment if you do a custom GC (i.e. a wasm object and a JS object in a cycle wouldn't have any way to ever be GC'd).

bhelx 6 months ago

yes, it's regularly done. But I think you are misunderstanding. WASM GC isn't a GC implementation.

fulafel 6 months ago

Yes, this is how it's done eg with Python and Go.

An advantage of a common GC could be interop between languages.

James_K 6 months ago

Not really. As I understand it, WASM offers no facility to unwind the stack which is needed for tracing garbage collectors. The only solution here is to manually write your own implementation of the stack on the heap and force all data to live there instead of in registers. This is a huge performance penalty.