3 ms·
Why not write the GC in WebAssembly?
by runeks 10y ago
Why not write the GC in WebAssembly?
- readittwice 10y agoHow would you implement determining the root set? So how would you detect which local variables reference an object? The Gc needs to keep these objects alive. AFAIK even conservative root-scanning is not possible right now. Please correct me if I am wrong: With the current bytecodes it is only possible to access the heap but not the stack. To make things worse, object references could also be in registers.
- Rusky 10y agoTwo reasons, beyond the sibling comment's notes that it's currently impossible: 1) You can't integrate it with the Javascript GC for interacting with the DOM and other JS-side objects 2) Now you have to distribute the GC with every app that uses it