Mark Miller (2013-07-31T16:27:46.000Z)
domenic at domenicdenicola.com (2013-08-05T15:08:18.153Z)
Where does the w-symbols module come from? Remember that initially w1.1 is loaded into realm A without knowledge of realm B and vice versa. Let's also say, to emphasize the point, that they're also under disjoint module loaders, so at the time they're initialized they can't use a common module loader as a rendezvous point for new definitions. > Other options include storing the symbol in some kind of global > registry (which the module registry is doing above). I know of only two such notions of a global registry: * One that would also serve as a global communications channel, which is therefore disqualified * The equivalent of an interning table, as in the symbol tables of smalltalk that Dean mentions. An interning table from JS strings to unique symbols would have the property that intern(str1) === intern(str2) iff str1 === str2 The cool thing about an such interning table is that it is global mutable state that does not provide a global communications channel. To avoid accidental collision on the interned symbols, you must avoid accidental collision on the strings used as keys in this registration table. This demands exactly as much collision resistant of string choices as using the strings directly. And therefore also demands strings which are just as ugly.