Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

I think Chris makes an excellent point that is the mortal flaw of GC-s, anyone who argues about overhead or pauses or throughput is getting it wrong - the problem is determinism, and interaction with native objects.

You cannot reason about when the computer can/will get rid of native objects that are referenced by the GC, and doing so raises a billion of hairy questions, many of them discussed at length in the article.

Why is this important?

This is implies the model of SPA frameworks, which rely on this exact thing, fundamentally cannot be made to work well, since they rely on referencing native objects from JS.

This invalidates the entire way we build GUIs/websites nowadays. I'd say that's a pretty darn important issue.



Could you elaborate how this is connected to js and SPA frameworks? I totally get how reasoning and determinism is critical for sound processing, embedded low level, operating systems etc. But why would this be relevant for normal application or web development?


SPA frameworks manipulate the DOM through JS, which means they need to take a reference to DOM elements.

In a static website, once you navigate away from a page, the browser can deallocate all the DOM resources related to the old page, which can be quite heavy (images etc.).

In an SPA-driven website, the DOM is created by JS. Once you 'navigate' away (you tell the framework to render a different set of DOM components), the old ones still linger around in memory until the next GC cycle, meaning the browser has to wait for the GC to run before it can free them.

Even worse, GC's tend to be tuned for GC memory pressure, and if you have a ton of GC objects holding onto native resources, the GC has no way of telling it needs to run, because from its perspective, the GC heap is small and it has no idea about the native objects.


Still dont get it. Obviously a dom implementation that is tied to a garbage collected script language has to be tied to the garbage collection in some way to free connected resources, this fact only shows that it is not a trivial task which is obvious. i still do not see how this is an argument why a garbage collected language is a bad idea for that usecase.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: