Learning Clojure
About a year back, I took a programming languages class. I think it was a pretty standard course: boot camp style introduction to several languages across several paradigms. I found two things interesting. The first was formal grammars. I’d never thought of languages in that regard. Even when studying natural languages (I’ve taken a bit of Spanish and Arabic), I didn’t think of them in terms of the formal grammars that structured the language. Anyway, I thought it was really interesting that you could describe languages in such a structured, unambiguous way.
The other thing that I found interesting, and is really the point of this post, were functional languages. We covered Common Lisp and Haskell. It was an eye-opening experience. Most of the languages I had used up until then (Ruby, Python, Java, C) were fairly similar in how they approached problems. Sure, some languages had dynamic typing, others were compiled. But how you actually tried to solve problems was often focused on how to structure your code to attack a problem.
The thing I found interesting about Haskell, Common Lisp, and now Clojure, was that you don’t focus on the actual data you have to deal with. This is less true with Haskell, due to its rigid but powerful type system. With Lisps, data and code are one in the same. And when dealing with collections, it doesn’t matter if you’re dealing with a hash map or a list. It’s liberating.
I’m really focusing on learning Clojure. I think it will be a powerful complement to Ruby and Python. There’s also the possibility that it will be the only language I need to use, as you can target the JVM, CLR, browsers, mobile, etc. It just feels like a more powerful tool.
Edits
- Meant CLR, not CLI. It’s a runtime, not an interface (or whatever else ‘I’ could stand for).
- Note: a bunch of things I’ve said are probably misinformed. I’m learning here…