3 ms·
Go has it's own GC, so why would it need WebAssembly's? Does web assembly disallow programs from doing their own GC?
by nulltype 11y ago
Go has it's own GC, so why would it need WebAssembly's? Does web assembly disallow programs from doing their own GC?
- ZenoArrow 11y agoGo has a GC that runs on top of an OS. The virtual machines that run WebAssembly are highly likely to have different mechanisms to manage memory compared to an OS that Go runs on, so Go's GC will not work 'out of the box'. This leaves two options: 1. Go developers could write a GC especially designed to enable Go on WebAssembly. 2. Go developers could wait until WebAssembly gets its own GC implementation, and make use of that. Considering option 2 is less work, and that a GC for WebAssembly is on the WebAssembly roadmap (check the GitHib page for details), I'd suggest option 2 is what will end up happening.