Two languages, twenty minutes

:: Smalltalk, Lisp, Pharo, Racket, Pi

Some notes from my talk at the Raspberry Pi ‘Big Birthday Weekend’; entitled ‘Two languages in twenty minutes’ it introduced a couple of programming languages—Pharo (Smalltalk) and Racket (Lisp) running on the Pi 2 Model B. And some background on why you might want to run them.

(PDF of the slides should you find it useful).

Installation

Ideally you will want to install these on a Pi 2 Model B. They ‘will’ run on a B/B+ but the IDEs will be slow. The Racket language system (not the DrRacket IDE) will run fine for embedded systems on any Pi and is a great tool for these.

Racket has a package available in the Raspbian distribution; but it’s not up to date. Currently there’s no package for Pharo. So there are a few steps to follow…

Pharo Smalltalk

If you want to install on MacOSX, Linux or Windows, you can download everything in one go from the Pharo site. For Raspbian, there are a couple of steps.

The first thing is to install a ‘virtual machine’ runtime. A recent one from Eliot Miranda’s VM site can be obtained with

wget http://www.mirandabanda.org/files/Cog/VM/VM.r3236/stklinuxhtARMv6-15.05.3236.tgz
tar xzvf stklinuxhtARMv6-15.05.3236.tgz

Now you need three files which are the Pharo system

  • the Pharo ‘image’
  • the ‘changes’ file (this stores changes made to the image)
  • the ‘sources’ file (this has source code for the system)

Obtain these with

wget http://files.pharo.org/image/30/Pharo-Image-3.0-latest.zip
wget http://files.pharo.org/sources/PharoV30.sources.zip 

make a new folder say ‘Pharo’ to hold all three files together, and then use the archive tool to extract the contents of the zip files.

Extract

Extract

Now from the path above the VM and image folders you can start Pharo with

stklinuxhtARM/squeak Pharo/Pharo-30863.image

Note, that the same VM will run the Squeak Smalltalk system, you can download image/changes/sources files from the Squeak site, as a comparison.

Tutorials, books

A tutorial is available in the image, and a more documentation can be downloaded or purchased at http://pharo.org/documentation.

There are many free Smalltalk books available at Stéphan Ducasse’s site.

Racket

If you want to try Racket on MacOSX, Linux, Windows visit the Racket download page. For Raspbian…

From the download page, select the snapshot builds and pick one of the download links.

Then pick the ARM6 Linux build and download. (If this build shows ‘build failed’, pick the link to the last successful one).

Youll have a file like racket-6.1.1.8-arm-linux.sh. Run

sh racket-6.1.1.8-arm-linux.sh

and select the default ‘no’ to Unix-style distribution, then option ‘3’ is a good choice to place Racket in /home/pi/racket-version. After the files are extracted you can skip ‘installing new system links’.

Now you can try Racket with

racket-6.1.1.8/bin/drracket

Tutorials, books

There are lots of tutorials at the Racket site. Try ‘An introduction to Racket with Pictures’ to start. The book ‘Realm of Racket’ is a quirky, fun introduction.