We've got to maintain a certain level of 'street-cred'.

Clojure: What are the Benefits of Bringing Java and Lisp Together?

Let us open with the following age-old joke about programming:

“There are two kinds of languages, the ones that everyone complains about and the ones no one uses.”

This is not really much of a stretch since programming languages number in the thousands, while the languages that frequently occur in development job requisitions number in the dozens. The languages that "no one uses" address the shortfalls of popular languages that “everyone complains about,” but learning programming languages and tinkering in legacy systems with untested technologies are both large investments, leading us to often stick with the devil that we know.

However, the Clojure language is an interesting mixture of a language that “no one uses” with arguably the most common programming runtime of all – the Java Virtual Machine (JVM). Let us take a look at the benefits of this mashup.

Lisp has an interesting history and we will have to qualify that people DO use it (before the angry comments stream in), but it is a mainstay of artificial intelligence research and more academic programming pursuits. The use of Lisp in commercial systems in rare, though some companies such as Orbitz have made effective industrial use of it.

Lisp is purely functional. Its syntactical trademarks (embedded parentheses everywhere (exactly like this)) not only make for consistent, elegant code, but also assist the developer in thinking in functional terms. Or at least it does for the set of developers who can learn to live without loops and variable declarations - and that difficulty has arguably held back its wider adoption.

Enter Clojure. Lisp has many “dialects,” such as Scheme, that all offer small variations on the principles of Lisp, but Clojure has specifically been built to run on the JVM and interact with Java libraries. There are probably some functional language purists who could look upon this sort of disdain of someone trying to port MS Outlook over to Linux. However, there is legitimate purpose to this.

Rich Hickey, who created Clojure mostly with his own independent expenditure, has argued that developers should start rethinking concepts such as “state, identity, value, time, types, genericity, and complexity” as they are currently used in applications. Given that modern software systems make use of massive parallelism (which is sure to get even more massive as we move into the future), it behooves us to reevaluate the ideas behind traditional development.

It is our luck that functional programs, when written correctly, are actually trivial to scale and parallelize. It is no surprise that Clojure is growing away from “fringe” status and is supported on cloud application platforms such as Google App Engine and Heroku.

Maybe we will also have to soon reevaluate our list of “languages no one uses.”