Journey to Clojure II

I left the previous article with a question. Why did I come back to Clojure last year, and decide that it was probably my favourite general purpose programming language?

I’ll be clean up front – although I love the language, it’s an open relationship. It’s not my language at work. It’s not my only language in my spare time. But it is the language that I reach for when coding up something new, or investigating something.

So why do I keep coming back to Clojure? It’s not the perfect language, but it does have the X-factor for me. For this post, I’ll focus on two features, which aren’t completely technical.

  1. The community.
  2. The culture.

The Community

For a small project, I’ve been taken by how vibrant, smart, and productive the Clojure community is.

I’m lucky enough to work in Toronto, which has a vibrant tech community. And, naturally, it’s Javascript that gets the big crowds – but Clojure does well. There are regularly 10+ people at a monthly talk night. For a supposedly niche language, with small industry penetration and exotic syntax, that’s really good.

This isn’t an elitist community. There’s a genuine feeling that the Clojure idioms are no harder than others, and the problem is more often one of familiarity. There are excellent efforts, such as Clojure Bridge, which are demonstrating that Clojure is an excellent teaching language for computer science concepts.

This isn’t a closed community. Because the majority of people involved will be doing something else in their day jobs, there’s a rich cross pollination.

This is a community that people are excited to be involved in.

The Culture

This is a really interesting one, and something that is not readily apparent on first entering the language. It’s not apparent in the terse description of Clojure as a lisp for the JVM.

It’s not apparent when first wading through Clojure syntax in a basic tutorial. Maybe you skimmed over Rich Hickey’s rationale, and picked out ‘lisp’, ‘JVM’, ‘concurrency’, check, check, check.

Clojure is a well thought out language.

It has a winning mixture of practicality, and trail blazing when it looks like there’s a genuine benefit.

Practical

  • It’s a hosted language, with excellent interoperability with the host.
  • The libraries and build tools are excellent – it’s not a second class citizen.
  • There’s a continual focus on this being a practical language, for real problems, and compromises are made for this.

Trail Blazing

I’m not sure how significant the last two will be, or how widely adopted they will be, but it’s exciting to see these new ideas being rolled out as part of a language.

The team developing Clojure have obviously had a lot of hammock time.

Journey to Clojure I

For the past year, I’ve been using Clojure as my go-to hobby language.

Why?

I tried thinking back to my first lisp experiences. It must have been eight years ago, finally sitting down and doing some Lisp programming.

I’d seen this XKCD before, or maybe this one, but read passing comments connecting it with AI. It had parentheses. It was an old language that refused to die. People were passionate about it. And it had parentheses. And more parentheses.

I was a C++ programmer at an electronics startup at the time. I’d been there around a year, I’d settled on Emacs as my editor of choice. I’d learnt some Tcl, because that was a standard language in the electronics design industry at the time. And then I decided that I should probably learn what this Lisp thing was.

What had I learnt?

That Lisp at its root is simple. That it is powerful with unique macro features. That many modern implementations were weird and sometimes arcane. That there were a few famous examples of it’s use, such as Emacs, Autocad, Paul Graham.

That the Space-Cadet keyboard was a-fricking-mazing.

That languages didn’t have to be essentially un-parseable, like C++.

That people who studied Computer Science at university generally suffered through a term of lisp, (or maybe even SICP), before joyfully pursuing Java, or C, or C++, or Python. I’d studied Mathematics, I’d missed out on that.

So I moved on from the Lisps, the books went back to the libraries. I toyed with the idea of one day writing a DSL around a scheme interpreter. I came back, briefly, to Racket when I was looking for alternatives to PowerPoint. But generally I put Lisps out of my mind as intriguing but impractical.

I knuckled down on the C++.

Years later I moved onto a C# job. I kept learning other languages, because if there’s one thing that I think a professional programmer needs to be, it’s multi-lingual. Not to widen your job pool, but the vast benefit to be gained from appreciating the different idioms in different communities.

I played with Haskell, and Javascript, and Elixir (skimming over Erlang). I read about but then skipped PHP and Perl. I learnt SQL from necessity. I did some useful work in F#. I dipped into many others.

I learnt my weaknesses, and then worked on my weaknesses as a programmer. I learnt the naivety of believing that a language is a silver bullet. And I learnt that a choice is still important.

And I rediscovered Clojure as one of my favourite languages. What had changed?

(Continue to Part 2.)