Posted by: generalmaximus on: July 12, 2008
A few months ago, I had started learning Common Lisp from the freely available Lisp text Practical Common Lisp. As the following posts might have indicated, I gave up the pursuit in favor of learning Ruby instead. Afterwards I mentioned that I was going to learn a functional programming language, any language, so I could become a “better” programmer. Since then I have been trying to dabble in Haskell, Erlang and OCaml. All of them are interesting languages, and all of them provide wildly differing approaches to whatever problems are supposed to be plaguing programmers these days.
But none of them is Lisp.
I’ve been going through the basics of all these languages one by one just to see which one catches my fancy. I couldn’t go ahead with learning OCaml because of lack of books, and I couldn’t stick with Haskell because even the best books on the language devoted the first 3 or 4 chapters to theory and mucking about in the interactive toplevel and didn’t get into real code until chapter 6 or 7. Erlang has a nice book, but I’ve put learning it off for now.
In the meantime, I kept writing programs in the one language I know and love : Python. In particular, I was trying to solve the problems listed at SPOJ. As I got further into solving the algorithmically intensive problems at SPOJ, Python started to feel limiting. This is partly because even though I know Python, I really don’t have much programming experience. Yet, there always seemed to be just one small feature it lacked. Nothing was actually impossible for me to express in Python, but the way of expressing it usually got unintutive and ugly. This, I repeat, might be because of my own ignorance of advanced Python wizardry, but these small hurdles slowed me down nevertheless.
After all this time, I’m back to reading a Lisp book. And I have realized that all the features I found missing from Python are not only present in Lisp, they are also among the preferred way of doing things. I remember thinking about “programs that write programs” back in 11th grade when I was learning C++. Little did I know that there was actually a language that would let me do just that! The concept of “programs that write programs” is realized in Lisp by the use of macros. I don’t know much about them right now, but I have been given a little sample of what’s in store in chapter 3 of Practical Common Lisp, and I like what I see.
Is it that my mind is used to thinking in a certain way that makes Lisp a natural choice for me, or is Lisp just a super-kickass language that anyone with half a brain would instantly fall in love with? I really can’t say, since I haven’t done much Lisp programming. But I’m sure that for me, the future is full of parentheses.
(By the way, it is said that given enough time, any existing mainstream language will slowly become Lisp. The C++ 0x standard proves this right. Also see Greenspun’s Tenth Rule.)