George Orwell wrote 1984 from a particularly remote part of a remote Scottish island. Beautiful though it is, Jura is an unfortunate place to be dying of tuberculosis. But Orwell was too committed to waste time with doctors: instead he struggled through a 125,000-word hand-written manuscript as his symptoms worsened. Then came the typing. When it proved tricky luring a stenographer to work with a consumptive patient in a desolate farmhouse, Orwell again took on the task himself. Too weak to stand he wrote from his bed, chain-smoking and copying four thousand words every day, in between bouts of fever and coughing up blood. The final typescript appeared, ash burns and all, twenty days later – and about a year before the death of the author. 1984 “wouldn’t have been so gloomy if I had not been so ill.”[1]
Unlike Orwell, I remain happily unencumbered by any old-fashioned maladies. But while not hacking up my lungs, I am hacking away on my codebase, and with a similar purpose in mind: to turn my rough draft into more refined TypeScript. In this case that’s not a typed manuscript but a variant of JavaScript, the programming language that powers the web. I’ve written a little about why I’m porting Raven’s compiler to TypeScript, and will have more to say, but for now some background on the language itself.
A decade ago, the idea of using JavaScript for polish would have been laughable. JS started as a simple and informal “language for the masses”, designed in about ten days in 1995, and unapologetically aimed at simple scripting and prototyping. Despite the name, it also had little to do with the (unapologetically corporate) Java language – it just happened that Java had spent hundreds of millions on advertising, and JavaScript’s creators wanted to ride the wave.