First Steps in LISP

The old CS room at my high school wasn’t exactly state of the art at the time, only two decades ago. Nowadays it would look dated to a degree that’s comical. But we were studying C++, and the teacher seemed to think it was one of the best languages in existence. As he was introducing us to a few languages, the contrast between esteem and contempt was no clearer than when he showed the class a monstrosity of nested parenthetical statements, all in uppercase letters.

“This is LISP. What does that stand for?”

(Dramatic pause, since none of us knew the answer, obviously.)

“Lots of Irritating, Stupid Parentheses!”

(chuckling from around the room.)

The slide changed, and the lecture moved on. That was all we learned about LISP, which was obviously such an awful language than no one in their right mind would use it. Even COBOL got more of a nod. This was before the internet was an easy, convenient, and even necessary resource for exchanging information. But it wouldn’t have occurred to me to second-guess my teacher, because he was an experienced programmer and I was just a student who would rather go home and play games than learn a language that I had been told was best left ignored.

So it’s a good thing that I’m more critical and open-minded these days, because I held to that prejudice for twenty years. Recently I committed a form of high-tech heresy: a dedicated Vim user for years, I hopped over to Emacs. If you don’t know much about the editor war, you already know why this is heresy. Otherwise, suffice it to say that Emacs and Vi/Vim have their respective cores of devotees, and the arguments about which editor is better sometimes bear resemblance to a holy war.

But I digress. I needed an editor that could run on a laptop that, in spite of its very up-to-date hardware, exhibited intolerable slowness running Vim with my standard configuration. Emacs ran quite well for some reason I still haven’t sorted out, so I decided to use it instead. You can imagine how annoyed I was to find that its internal scripting language was a dialect of LISP. That made no sense; who would use such a stupid, parenthesis-ridden language for something so important? Fine, I didn’t have to touch any Emacs code; it just needed to work as an editor for my work.

Until I found that I needed to customize things in order to get some features running the way I wanted them, that is. Fine, I decided, I need to keep learning one way or another, so even a silly language like LISP can yield value. Somebody as smart as Richard Stallman likely had a good reason for using the language; maybe I’d figure out what that was.

This is the interesting thing about prejudices like the one I’ve described: they’re often incorrect, if not outright harmful. I picked an online tutorial for LISP, opting to go all the way back to basics as if I were an absolute beginner to programming. A good choice, as it turns out; I knew nothing about the language, and I quickly found that it was nothing like the style I’ve learned and used for years in PHP, Javascript, and Python. Rethinking my approach would have been much more difficult than starting with a blank slate and learning a bit at a time.

I also found that my high-school CS teacher’s blithe dismissal of the language ignored some important facts. LISP is an ancestor language, its original specification published in 1958. Many of its features led the way for future languages. In addition to being one of the oldest programming languages, it’s one of the longest-lived: Common LISP implementations are still maintained today, along with descendants like Clojure and Dylan. And the general-purpose variants see use in a variety of settings including various scientific applications, graphics, finance, and many others.

Programming languages and the history of computing are both subjects of interest to me, so it’s quite the discovery when I happen to pick up a language that has helped drive the development of computers to this day. It’s even better to learn that the technology is still relevant and vital, rather than an obsolete relic like so many other things that have come and gone in this short and frantic history.

Image sources

  • monty_python_holy_grail: Monty Python and the Holy Grail
  • magnetic_core_memory: Wikimedia Commons

Over to you...