04:29
<kriskowal>
Anyone know whether any VMs GC registered symbols? My impression is that none do but also that they could without observable differences.
13:48
<akaster>
Anyone know whether any VMs GC registered symbols? My impression is that none do but also that they could without observable differences.
Is your question whether any JS implementations put primitive Symbol objects on their GC heap? Because LibJS (ladybird) has always done that. https://github.com/LadybirdBrowser/ladybird/blob/master/Libraries/LibJS/Runtime/Symbol.h
14:00
<akaster>
Oh, GC registered symbols meaning, "remove unreferenced symbols"?
14:03
<akaster>
In that case we don't do anything to remove global symbols from the global symbol registry. We don't even destroy the VM at process exit. https://github.com/search?q=repo%3ALadybirdBrowser%2Fladybird%20GlobalSymbolRegistry&type=code
15:03
<kriskowal>
Yeah, I do mean the latter. It’s technically possible to drop entries from the registry since that is not an observable outcome. But that requires ephemeral book-keeping that I doubt any engine considers worth-while. That informs whether it’s a good idea to use registered symbols to reïfy distributed symbols over a network protocol. There’s a potential registry stuffing hazard and attack. So, I’ve been advising folks against using registered symbols to reflect the analogous interned symbols in scheme over OCapN. Just here to check my premises.
15:05
<kriskowal>
(It’s also my understanding that Guile scheme does collect unreferenced interned symbols, so there’s no corresponding risk in that language.)
15:08
<akaster>
Well. Not really familiar with your use case at all. But at least in LibJS, the spec's distinction between "global" and "not global" symbols is taken to heart. Calling the Symbol constructor creates a local symbol that will be GC'd. Calling Symbol.for (https://tc39.es/ecma262/#sec-symbol.for) will create a global symbol attached to the VM that outlives even the realm that was executing when it was created.
20:03
<Ashley Claymore>
I thought SpiderMonkey does collect registered symbols 
23:34
<kriskowal>
If V8, JSC, and XS do too, that would change my mind about using them. Think JSON but with support for symbols. Should they be registered symbols?