2 ms·
Specifically, he pointed to problems with having two separate virtual machines, both trying to clean up computer memory through a process called garbage collect
by stcredzero 13y ago
Specifically, he pointed to problems with having two separate virtual machines, both trying to clean up computer memory through a process called garbage collection and both trying to control Web page elements through the browser's Document Object Model (DOM) interface. "Two runtimes sharing the DOM adds both bug habitat and a performance tax," Eich said. That's an objection Apple has raised, too.
Why have two garbage collectors sharing the DOM? Couldn't one construct a bridge that synthesizes Javascript under the covers to access the DOM and also maintains a reference for the separate Dart GC for the Dart object trying to access the DOM? This would mean that the native Javascript GC wouldn't have to be aware of Dart at all, apart from the presence of some special Javascript objects that don't get collected by it. Then, when the Dart side is done, and the Dart objects go away, remove the "special" flag from the JS bridge objects and let them be collected normally. (There are a few more wrinkles than that, of course.) Performance would be slower for non-native Dart VMs, but it should be possible to leave Javascript GC mostly untouched.