/ tutorials

Setting up MIT-Scheme on Mac OS X with Homebrew

Recently I've been reading SICP to learn Scheme which uses MIT-Scheme. In this tutorial I am gonna walk through step-by-step on how to install mit-scheme and have fun with it's REPL.

If you don't have homebrew already follow the link & come back. If you already have it then open up your terminal and follow the steps.

  1. Intsall Brew Cask :
    brew install caskroom/cask/brew-cask

  2. Tap X11 formulas for homebrew:
    brew tap homebrew/x11

  3. Install xquartz (Required):
    brew cask install xquartz

  4. Install mit-scheme:
    brew install mit-scheme

Scheme REPL is not so fun compared to python or node.js REPL. Follow the optional steps bellow to make it more fun to play with.

  1. To Get navigation key, history, paren matching :
    brew install rlwrap and use rlwrap scheme to use repl.

  2. Get tab completion with rlwrap:
    Download this file for auto completion and paste the codes bellow to your ".bashrc" or ".zshrc" :
    alias scheme="rlwrap -r -c -f /Users/path/to/mit_scheme_bindings.txt scheme"

Fire up scheme by entering scheme on your terminal and that's it!

Feel free to leave a comment bellow if you are facing any problem or have any suggestion :).