Our Technology Stack

The Principia Mathematica
Ah, those happy days before Gödel [stole our innocence][godel].

To fully explain our technology choices is more or less impossible. For one thing, they’re constantly evolving with the technology itself. For another, this is a blog, not Principia Mathematica — we want to inform, not stupefy.Put another way, we’re going more for Leibniz than Newton. That said, we’re going to try explaining ourselves anyway.

The Stack

First, let’s consider what our stack looks like. As of this writing, we use CoffeeScript as our main programming language. On our servers, we’re typically running Node. For storage, we use ElasticSearch.Crazy, right? Not really. Remember, premature optimization is the root of all evil. More on this in another post. We use Redis for messaging and configuration management. We use Amazon for cloud computing.We’re also experimenting with Joyent. They’re doing some pretty interesting things. And I suppose those are the big things.

An Existential Crisis

Let’s start with CoffeeScript. In order to talk about CoffeeScript, we need to start with JavaScript, since CoffeeScript ultimately compiles into JavaScript. We don’t really need to explain why we would use JavaScript in the browser, since it’s the only language that runs natively in the most widely used browsers. That leaves explaining our choice of JavaScript on the server, which means explaining Node on the server.

As it happens, part of the appeal of Node, at least for us, was CoffeeScript. I’m not sure we would be using Node if it weren’t for CoffeeScript.I consequently find the general disdain for CoffeeScript amongst many Node fanboys mildly amusing. So … what is it about CoffeeScript that we find so appealing?

Part of the answer to that is, of course, Node. Lest we go in endless circles, I’ll summarize and then we can move onto other reasons. CoffeeScript allows us to develop in one language across both the client (the browser) and the server (Node). We can easily reuse code, which is particularly useful for presentation-related code. We can do single-page apps or generate HTML pages on the server — and use the same code for both.

The Importance Of Being Expressive

And, in our opinion, CoffeeScript is a really elegant language. Douglas Crockford once wrote a nice essay on why JavaScript was so poorly understood.

JavaScript's C-like syntax, including curly braces and the clunky for statement, makes it appear to be an ordinary procedural language. This is misleading because JavaScript has more in common with functional languages like Lisp or Scheme than with C or Java. It has arrays instead of lists and objects instead of property lists. Functions are first class. It has closures. You get lambdas without having to balance all those parens.

I’d say CoffeeScript reveals that aspect of JavaScript far better than JavaScript itself. You get lambdas without having to balance all those curly braces and parenthesis. This is often dismissed as being mere “syntactic sugar”, but, in my experience, the expressiveness of a language profoundly impacts what can be expressed. I’ll talk more to this theme in future posts, but, for now, I’ll just say that CoffeeScript is considerably more expressive than JavaScript, and that makes it possible to do things in CoffeeScript that, while also possible in JavaScript, no one would actually do.

And, Also, We Really Like Arrows

The combination of CoffeeScript’s expressiveness and it’s availability across both client and server platforms is the killer one-two punch.We really like Factor, too, but that’s a whole different blog post. CoffeeScript is also relatively easy for JavaScript programmers to learn, which means there’s a large pool of JavaScript developers to draw from. According to Red Monk, JavaScript is the most widely used programming language, while CoffeeScript is the fastest growing.

Next time around, I’ll talk a bit about why we like Node. We get a lot of questions about this. The answers may surprise you.