This repository contains notes, examples, and local environment provisioning for following along with Abelson and Sussman's Structure and Interpretation of Computer Programs text, available in the public domain at this website, hosted by MIT.
The MIT-hosted SICP now appears to 404 at the above link. The new site hosted by MIT uses JavaScript examples. The best resource we're aware of reflecting the original text in Scheme is here, created by Li Xuanji: https://xuanji.appspot.com/isicp/index.html.
The repo reflects working through the text at a twice-monthly Meetup hosted in Madison, WI in 2022.
SICP uses the Scheme programming language.
Scheme goes by many names. Any implementation that's R5RS-compatible and has a load
procedure should be usable. Consider using one of the following:
- Racket, with #lang sicp. Comes with its own IDE: (DrRacket). Native builds for Apple Silicon.
- Guile. Should be fully compatible with examples used in SICP. Native builds for Apple Silicon.
- mit-scheme. Recommended, as this is the implementation most commonly used with SICP. Not compiled for macOS ARM, so if you're on Apple Silicon, it's necessary to run the x86_64 version through Rosetta. The Vagrant environment described below may be used to run mit-scheme.
This project contains configuration for Vagrant to provision an Ubuntu 22.04 VM with mit-scheme
installed for working through the text. If you'd like to use an isolated local VM for the purposes of the meetup, ensure Vagrant is installed on your machine.
To create the environment, run
vagrant up
Once provisioned, you can ssh into the local VM:
ssh -p 2222 [email protected]
When prompted, use the password vagrant
.
To destroy the environment, run
vagrant destroy
The Vagrantfile copies a ~/.vimrc
file from your host environment to the VM and installs vim-plug. If your vimrc contains directives to install your plugins via Plug
, you can run :PlugInstall
when first launching vim in the VM.
Lisps are best written with a REPL at hand. It's even better when code can be sent directly to a running REPL from your editor. Here are some recommendations for editor/plugin combos with great Scheme REPL support.
Conjure is an excellent neovim plugin that enables interactive development with a variety of Lisp-y languages. The wiki has guides for setting up Scheme (MIT, Chicken, Chez), Guile, and Racket
The quintessential Lisp operating system editor. Geiser provides interactive Scheme development support for Emacs.
If you're new to Emacs and want an easy way to get started, it's recommended to use an Emacs distribution:
- Doom Emacs is great for those who want Vim-flavored Emacs.
- Prelude provides a more traditional, but potentially easier to use Emacs experience.
Both provide pre-configured Geiser modules.
DrRacket is the IDE that comes with the Racket programming language
If your chosen editor doesn't have REPL support, the REPL can be used from the command line.
If you'd like to contribute to this project, please feel free to make a pull request.