Gaining Clojure in Baltimore

Clojure Guest Blog

Republished and modified with permission from author Jason Lewis + Yet Analytics. Check out the original post on their site.

A Little Background

Although Clojure itself is a relative newcomer on the programming language scene, first appearing in 2007, its roots run deep. Clojure is a dialect of Lisp, the second-oldest high-level programming language (created in 1958), predated only by FORTRAN. Lisp is scary to most programmers, and I don’t think it’s just the parentheses. It requires a different way of thinking, but gives you a more powerful tool for turning ideas into software. And some of these ideas end up in places that are really reminiscent of Baltimore itself.

A City of Neighborhoods

Paul Graham introduces the concept of programming bottom-up in his book, On Lisp.

Experienced Lisp programmers divide up their programs differently. As well as top-down design, they follow a principle which could be called bottom-up design — changing the language to suit the problem.

So Lisp programs tend to be very specific to the problem domain, and in the process of writing a Lisp program, you end up with (at least partially) a domain-specific language.

Baltimore evolved as a city in a similar fashion. Baltimore is a less a coherent whole as a “city” than an agglomeration of neighborhoods. Hampden is unlike Sandtown is unlike Pigtown is unlike Remington. Except they’re all still Baltimore. Hampden started as a neighborhood of affordable housing for mill workers, now it’s a hipster haven. Neighborhoods evolved to meet the conditions. Other cities have gradations of socioeconomic status across geographic regions, but I seldom have the experience of crossing a street and feeling like I’ve crossed a national border in other cities that so often occurs here in Baltimore.

I should mention that this property of Lisp is often brought up as a criticism; this ability to change the language itself makes it very easy to create code that is incomprehensible to other programmers.

As Alan Kay once said, “Lisp isn’t a language, it’s building material.” Many people take this to be a criticism, but he also called Lisp “the single greatest programming language ever designed.”

The Design

Lisp was never designed to be an enterprise-y programming language; in fact, one could argue that it wasn’t designed at all. John McCarthy described a hypothetical language called LISP (for LISt Processing) in his 1958 paper, “Recursive Functions of Symbolic Expressions and Their Computation by Machine”. According to legend, one of McCarthy’s graduate assistants (against his wishes) implemented the eval function on an IBM 704 computer and the first LISP interpreter was born.

I’ll skip over the intervening years, except to mention that Common Lisp and Scheme, the two dominant Lisp dialects prior to Clojure have been used effectively for applications from AI research to e-commerce for many, many years. If you’ve ever booked a flight on Orbitz, you’ve encountered Lisp; ITA (now owned by Google) wrote the flight scheduling software used by Orbitz and many other travel sites in (mostly) Common Lisp.

Paul Graham and Robert Morris also wrote Viaweb, which became Yahoo! Stores, in Lisp. More on this later.

Common Lisp and Scheme were designed by committee and standardized through ANSI.

See this guy? That’s the creator of Clojure.

That is Rich Hickey. Rich spent two years pondering and designing Clojure before writing a line of code. Clojure has features unique among Lisps such as immutable data structures, software transactional memory, asynchronous channels, and many more. It also runs on the Java™ Virtual Machine. Again, more on this later.

Clojure is a beautifully designed and elegant Lisp.

Beating The Averages

In Paul Graham’s essay of that name, he recounts the following:

Our hypothesis was that if we wrote our software in Lisp, we’d be able to get features done faster than our competitors, and also to do things in our software that they couldn’t do. And because Lisp was so high-level, we wouldn’t need a big development team, so our costs would be lower. If this were so, we could offer a better product for less money, and still make a profit. We would end up getting all the users, and our competitors would get none, and eventually go out of business. That was what we hoped would happen, anyway.

It’s great startup logic, and an argument I would make for Clojure. Clojure gets even better, though. Because it runs on the JVM, you not only have the ability to run your software anywhere you can run Java (which is pretty much anywhere at all), but you have access to the entire Java standard library and the world of open-source Java libraries as well. You can call Java straight from Clojure. If you’re already building software in Java, transitioning to Clojure is fairly easy. There’s also a version of Clojure for the CLR, for you .NET folks.

For web development, there’s Clojurescript, a version of Clojure that transpiles to Javascript. You can leave behind the mess of entangled callbacks and write functional frontend code in a fraction of the time.

Why This Matters

Many successful companies are already using Clojure, from Deutsche Bank to Netflix to Groupon, whether it’s for backend infrastructure or devops or web development.

Almost more importantly, much of the top programming talent out there is doing Clojure — or looking for another job where they can.

Clojure is addictive; once you experience the power of Lisp, it’s painful to go back to using a less powerful language. And if there’s a more powerful language available,why would you choose a less powerful language?. So Clojure is also a good move if you want to attract the best engineers.

If you want to get involved with Clojure in Baltimore join the Baltimore Clojure Meetup group. We founded it a little over a year ago and today we’re at 63 members.

I want to see Baltimore become the burgeoning hub of innovation it’s promising to become.

And Clojure is going to be a big part of that. So get involved, you’ll never go back!

Come build something with Clojure during Betamore’s “Welcome to Clojure” workshop next Monday + Wednesday with Jason! Link to register:

Sign up for our weekly list of classes & events: