Monthly Archives: June, 2012

Meaning-preserving modularity

Sharing code is like sharing knowledge—the knowledge of how to write that code. I think we can simplify the meaning of program imports by making them queries to an oracle of all possible shared code.

This frees us from some complexity in maintaining the modules installed in a system: The modules’ effects on what the language can accept is declarative—as in they’re commutative, associative, and idempotent, like a mathematical set—and their effect on what the language’s programs mean is zilch. If the module oracle fails to find a match in its search, that just means there isn’t enough knowledge installed, not that the application itself is defective or should behave in a different, unintended way (like choking at run time).

When I talk about searching “all possible shared code,” I do mean searching every revision of every library, including every possible future revision, where the names may have been replaced with every possible combination of other names. This means we can’t identify modules by name, the way most module systems do.

Continue reading →

Introducing Cairntaker, a garbage collector

I’ve been using JavaScript for a while now, and I’m finally getting fed up with it in ways that I just can’t deal with. Or can I? Now that I’m fed up with its memory model, I’ve built a garbage collector. In JS.

I call it Cairntaker. It’s for programmers who want well-tended heaps.

Continue reading →