Structure and
Interpretation
of Computer
Programs

Fall 2021
course
site
-->

Sep 2 - getting started

hello

Welcome to the Fall 2021 SICP course.

Hang on to your hats - you're in for a ride. 🤨

SICP is a classic textbook in the history of computer science education, published back in 1980 before the internet was a glimmer in Tim's eye. There aren't many other computing books that are in regular use after 30 years, and it's not called "the wizard book" for nothing.

There are versions of this course today in JavaScript, for example at the National University of Singapore, but we're going to stick to the original coding language, scheme, one of the dialects of lisp - an old, elegant language.

The goal of the text is to study and explore the essential ideas of programming languages, starting from first principles. Along the way it looks at functions, recursion, variables, scope, data structures, O() efficiency, state, lazy evaluation, and finishes up with compilers, writing a lisp evaluator in lisp.

I've never taught this course before, and so fully expect that we'll adjust things as we go depending on how it goes.

The schedule for the MIT OCW course using this textook is roughly

                             MIT OCW schedule
       week    section                                 text exercises
       ----    -------                                 --------------
        1       1.1           scheme basics            1.1 - 1.8
        2       1.2           O(), recursion           1.9 - 1.28
        3       2.1, 1.3      data abstraction         2.1 - 2.16, 1.?
        4       1.3, 2.2.4    higher order procedures
        5       2.3, 2.4      tagging
        6       3.3           mutatation
        7                     trees, graphs, search
        8       3.1,3.2       environment model
        9                     object oriented programming
       10       4.1           lisp interpreter in lisp    |  Matt Might's
       11                     ... miscellaneous topics    |  compiler class?
       12
       13                                                 |  Haskell??
       14                                                 |

The book itself has 5 chapters. I fully expect that we will do part of it, perhaps through some of chapter 3, reading it and working through the problems, and then finish up with a related topic using other resources, perhaps part of Matt Might's compiler course (which uses this same racket language to implement a python compiler) or take a look at Haskell (a strongly typed functional language) to continue with some of the themes from SICP.

I've posted the first assignment, which just to start at the beginning of the book, do some exercises, and tell me how that goes.

I will use the beginning of each class to point you in the right direction, then let you work here, and answer questions as needed.

today

I'll go over a few starting ideas today, to get us going.

I have set up the environment at jupyter.bennington.college so that "scheme" runs a guile which is configured to be consistent with the SICP textbook, along with some other bells and whistles that I liked. On jupyter.bennington, both the built-in browser editor and nano both understand .scm (scheme) files.

Here's a sample terminal session with a "hello world" scheme file on jupyter.bennington.

jim@jupyter:2021-09$ ls
fizz.js  hello.py  hello.scm
jim@jupyter:2021-09$ cat hello.scm
;; hello.scm
;;
;;   $ scheme hello.scm
;;   Hello!
;;
(display "Hello!\n")
jim@jupyter:2021-09$ scheme hello.scm
Hello!
jim@jupyter:2021-09$ scheme
Guile 2.2.7. Enter ',help' for help.
Language: scheme for SICP with some extras.
> (define (foo x y) (+ x (* 2 y)))
> (foo 3 4)
11
>
jim@jupyter:2021-09$ 

Are we having fun yet?

https://cs.bennington.college /courses /fall2021 /sicp /notes /09-02
last modified Thu September 2 2021 12:10 am