2 ms·
> implement their own GC when that would be so easy, maybe. But especially on top of the browser restrictions that will be even harder.
by merb 10y ago
> implement their own GC
when that would be so easy, maybe. But especially on top of the browser restrictions that will be even harder.
- sspiff 10y agoGarbage collection is not magic. It's a fairly simple (but byzantine) matter of tracking references, and allocating and freeing memory. Why would this be so much harder for WebAssembly? Why can't existing garbage collectors be compiled to WA?
- chrisseaton 10y ago> Why can't existing garbage collectors be compiled to WA? Yes I think that's the idea.
- sspiff 10y agoExactly. From what I've seen of WebAsm, you can request pages of memory using grow_memory. Upon this, you could implement a memory pool system to handle malloc and free. Using this, it is trivial to port existing GC's. I don't understand why people moan about GC in WebAsm. WebAsm is a compiler target for lower level languages, not the JVM.