ezyang’s blog

the arc of software bends towards understanding

March, 2013

The single export pattern

From the files of the ECMAScript TC39 proceedings Single export refers to a design pattern where a module identifier is overloaded to also represent a function or type inside the module. As far as I can tell, the term “single export” is not particularly widely used outside the ECMAScript TC39 committee; however, the idea shows […]

  • March 31, 2013

The duality of weak maps and private symbols

From the files of the ECMAScript TC39 proceedings I want to talk about an interesting duality pointed out by Mark Miller between two otherwise different language features: weak maps and private symbols. Modulo implementation differences, they are the same thing! A weak map is an ordinary associative map, with the twist that if the key […]

  • March 19, 2013

What is a membrane?

If you hang out long enough with a certain crowd (in my case, it was the ECMAScript TC39 committee), you will probably hear the term membrane tossed around. And eventually, you will start to wonder, “Well, what is a membrane, anyway?” As is the case with many clever but simple ideas, membranes were first introduced […]

  • March 15, 2013