Friday, November 17, 2017

Emulating Smalltalk-76

If you got as excited as me about Dan Ingalls' live Smalltalk-76 demo on an actual 1970's Xerox Alto, you may have wanted to try it yourself. This is actually possible, and here is how:

First, you need an emulator for the Alto computer. Ken Shiriff posted a nice piece on how to run ContrAlto on Windows. It is written in C# and I got it to work on my Mac using Mono. So here's a step-by-step:

  1. Install Mono from http://www.mono-project.com/download/
  2. Download ContrAlto-mono.zip from https://github.com/livingcomputermuseum/ContrAlto/releases
  3. Download this Smalltalk-76 disk image: http://www.bitsavers.org/bits/Xerox/Alto/disk_images/chm/xmsmall.zip
  4. Unzip both ContrAlto-mono.zip and xmsmall.zip in the same folder.
  5. In a terminal, change to the ContrAlto directory and run mono Contralto.exe. This opens the Alto screen in a new window, and the emulator control in the terminal. 
  6. (if you get an error about a missing SDL library at this point, install that via homebrew)
  7. At the emulator's ">" prompt, type load disk 0 xmsmall.dsk and then start:
    $ mono Contralto.exe
    ContrAlto v1.2.2.0 (c) 2015-2017 Living Computers: Museum+Labs.
    Bug reports to joshd@livingcomputers.org

    You are at the ContrAlto console.  Type 'show commands' to see
    a list of possible commands, and hit Tab to see possible command completions.
    >load disk 0 xmsmall.dsk
    Drive 0 loaded.
    >start                  
    Alto started.

    >
  8. In the Alto screen window, type resume xmsmall.boot to start up Smalltalk-76:
      
  9. And now you should see Smalltalk-76 running!
  10. There is no explicit "save" option. The OOZE object swapping system continuously writes objects to the disk. Use "quit" from the main menu to flush all objects back to disk.
Note that you will need a 3 button mouse to properly interact with the system. On my MacBook, I installed MagicPrefs to emulate a third mouse button. After installing, in MagicPref's "MacBook Trackpad" section, for "Three Finger Click" choose "Middle Click".

You will also need some keyboard shortcuts to access the special characters in Smalltalk-76:
ctrl A             ≤ (less or equal)
ctrl B             bold
ctrl C             user interrupt
ctrl F             ≡ (identical)
ctrl G             ◦ (index operator)
ctrl I             italic
ctrl N             ≠ (not equal)
ctrl O             ↪ (quote)
ctrl Q             ⇑ (return)
ctrl R             ≥ (greater or equal)
ctrl S             's (eval operator)
ctrl T             ┗  (prompt)
ctrl U             ¬ (unary minus)
ctrl X             clear emphasis
ctrl /             ⇒ (if then)
ctrl =             ≡ (identical)
ctrl shift =       ≠ (not equal)
ctrl \             ≠ (not equal)
ctrl ]             ⌾ (create point)
ctrl [             ◦ (index operator)
ctrl :             ⦂ (open colon)
ctrl '             ↪ (literal quote)
ctrl <             ≤ (less or equal)
ctrl >             ≥ (greater or equal)
shift -            ¬ (unary minus)
cursor down        doit (in dialog view)
To learn Smalltalk-76, the User Manual is a good starting point:
http://xeroxalto.computerhistory.org/Filene/Smalltalk-76/.document.press!1.pdf

Have fun!