|
|
|
|
|
by mafribe
3308 days ago
|
|
Could you not have a radical separation between data to be collected
by Scala.js GC, and data GCed by Javascript? Data that crosses the
boundary is deep-copied so as to avoid interference between both
collectors? Not good for performance, but possible in principle, and a stop-gap measure until the WASM GC lands. |
|
Moreover, typical Scala.js code constructs cyclic dependencies between Scala objects and JS objects routinely. If Scala.js has its own GC, you'll have to manage those cyclic heap references, which will involve weak maps and other trickery so complicated that we would most likely lose all the performance that wasm would otherwise bring us.
It's just not worth it.