I had the chance to do David Beazley’s SICP course towards the end of 2022. I have only good things to say.
There are a lot of free resources out there [1]. Having Dave as a guide, I was amazed at how much we covered in a week. I loved how he cherry-picked topics for the high-level overview, but takes the time to hone in on critical sections. In some cases, Dave even comes up with his own examples to more clearly illustrate concepts being discussed.
What did I learn? It’s hard to describe. I’ll explain by analogy. When I learned about compilers, I discovered that languages have much more in common than I realized; I now see the big picture [2]. With SICP it’s a bit like that, but with the idea of computation more generally.
Let’s review a few key concepts, and then go into what I found especially mind-blowing.
In this section, we build a simple model of computation through the process of substitution. We start with a quick review of Scheme (the language used in SICP), next build a Scheme interpreter in Python, and then take a closer look at substitution.
Scheme is a dialect of Lisp. For the course we actually used Racket, which is similar but easier to set up [3]. For our purposes we only need a small part of the language; here Scheme and Racket coincide. The >
in this subsection represents the Scheme REPL.
Primitives are the simplest entities in the language. We only need integers. When evaluated we simply get it back.
> 1
1
For built-in operations, we need +
, -
, *
and /
. Scheme uses prefix notation, where the operator appears first and then the operands. The example here illustrates adding 2
and 3
.
> (+ 2 3)
5
Next we have special forms. The first one we need is define
, which lets us define variables. Here we define x
to be 2
.
> (define x 2)
> (+ x 3)
5