3 ms·
I like the idea, and it could work in many cases, but it's hard to make it truly universal. For example languages like Lua, Java and C# have finalizers, and Jav
by azakai 13y ago
I like the idea, and it could work in many cases, but it's hard to make it truly universal. For example languages like Lua, Java and C# have finalizers, and JavaScript GCs do not, so you can't reuse the outer GC. Other possible issues are weak refs, etc.
So even if we duplicate by compiling another GC, we are enabling new types of GCing, it isn't an exact clone.
- stormbrew 13y agoThat's a good point, and a shame as well. Hopefully they both get added to the language at some point and we can move towards something like this.
- mzl 13y agoWhile Java does have finalizers, there is no guarantee that they will run. In other words, a valid implementation could just skip running them at all.