Home Posts Artwork CV

My experience learning Lisp

17 May 2020

“I didn’t know programming could look like this.”

That was my recurring thought (when I wasn’t cursing to myself, that is) as I worked through Common Lisp: A Gentle Introduction to Symbolic Computation.

I went from feeling like a decent programmer to feeling like an idiot. I literally felt like I was learning to program again from scratch. Which, in a sense, I was.

Even the basics are different. In Python, if you want to know the result of one plus two you write:

1 + 2

Easy! Just like you learned in elementary school.

Lisp uses prefix notation and encloses everything in parentheses. To add one and two you would write:

(+ 1 2)

WTF?

It had never occurred to me you could put the plus sign before the numbers to be added. I can’t count how many times I broke my code by forgetting to add a parentheses, or adding too many.

I have the faintest of understanding of why Lisp has been called the most powerful programming language. In Lisp you can modify the programming language. You can write Lisp code that writes Lisp code. You can’t do that in other languages.

I don’t know if I’ll ever use Lisp for anything useful. Nevertheless, learning it has been fun. I learned different ways to express ideas. I understand the languages I do know better.