Jeffrey M. Barber

Tombstone

HUROX compilers: JavaScriptMaster and Pudding

Nov 2006 โ€“ Jun 2007 ยท age 24โ€“25

What it was

Two small C# compilers that fed hurox.com. JavaScriptMaster parsed a deliberately strict subset of JavaScript with an ANTLR 2.7.5 grammar, stripped comments, hoisted loop bounds and repeated property chains, renamed every local to a short name based on its place in the scope chain, and printed the program back on one line. Its trick was to serialise the parse tree as Lisp text and re-read it, so each optimiser simply wrote Lisp and compiled it. Run over the site, it cut 267 KB of JavaScript to 202 KB. Pudding turned HTML templates with holes into JavaScript functions, joining the string pieces lightest-first into a balanced tree, and it rebuilt the site's front page chrome at 3:44 on the final morning. JavaScriptMaster was written in six weeks from April 26, 2007.

Wins, for the age

What it taught

Genealogy

Ancestors: JavaScript Pro: the ANTLR JavaScript parser that renamed every local to a short name. Mathml: a markup tree compiled into an expression string. Descendants: none on record. Closure Compiler and YUI Compressor won this category soon after. Part of: HUROX.

Epitaph

Here lies a compiler for exactly the JavaScript its author allowed, and a template compiler that weighed its strings before joining them. One left a zero-byte file behind; the other rebuilt the front page at 3:44 on the last morning.