Installing Pharo

It’s time to install Pharo now. Pharo is a lively development and runtime environment based on the Smalltalk language. It is free and open source with a strong and dedicated community. Beside being a very productive and pure object oriented environments Pharo allows you to run bit identical on several platforms by using a powerful Smalltalk virtual machine. This makes it ideal for our goal as we can develop on a fast desktop machine if we like and deploy later on the Pi. It is also possible to code and use it on the Pi directly.

You can read more about Pharo on http://www.pharo.org. This is also the place where you can grab a copy for your Mac, Linux or Windows machine.

Also do not forget to check out the free books http://books.pharo.org and http://pharo.pharocloud.com/pharobooks.

PHARO VIRTUAL MACHINE

Pharo in the tradition of Smalltalk runs with a virtual machine to abstract from the underyling native system platform and provide a common interface for the Pharo layer. This way Pharo programs are portable and allow for easy reuse.

Usually one can get Pharo virtual machine (VM) and necessary support files

from the Pharo Download page http://pharo.org/download

or the Pharo File server at http://files.pharo.org/

or by using a zero config script from http://get.pharo.org

But the regular Pharo virtual machines for Linux will not work for the Pi — we need a virtual machine with support for the ARM processor architecture.

The Pi virtual machine is accessible only from the Pharo Continuous integration (CI) server: http://ci.pharo.org

(Update 2019: grab the VM from http://files.pharo.org/vm/pharo-spur32/linux/armv6/)

There you will find a build called “RaspberryPi” with “RaspberryPi-Publish”. At the time of this writing this was available from

https://ci.inria.fr/pharo/view/RaspberryPi/job/RaspberryPi-Publish/ws/

and and the latest zip with the VM was available on

https://ci.inria.fr/pharo/view/RaspberryPi/job/RaspberryPi-Publish/ws/61.zip

Lets create a new folder in our home folder for it:

mkdir pharo

cd pharo

to download:

and extract the file:

unzip 61.zip

Alternatively you can grab the VM also from

http://files.pharo.org/vm/pharoS/raspbian/latest.zip

which should give you the latest one.

PHARO IMAGE AND CHANGES FILE

But the virtual machine is not enough. Beside the native virtual machine we need the Pharo Smalltalk image — a platform independent file that includes the whole Pharo environment. It is some kind of snapshot of the object memory of a lively Pharo system.

The so called Pharo ZeroConf scripts can help easily in retrieving such a file:

This will download Pharo 4.0 image and changes file as 4.0 this is the latest release of the community at the time of this writing. Our folder should now have to new files:

Pharo.image

Pharo.changes

If you would like to use the latest Pharo image (which is 5.0 alpha at the time of this writing) you should use

wget -O- get.pharo.org/alpha | bash

Note that such an alpha version of Pharo might be unstable and is only recommended for experienced Smalltalk and Pharo developers.

PHARO SOURCE FILE

Beside the the virtual machine, the image and changes file we need another one: the sources file which will later allow you to browse the full source code in the Pharo environment:

As we have extracted the ZIP files we can remove the now unnecessary archive files to save a little bit of space:

We are ready. Lets use the following commandline to start Pharo on the Pi (running the virtual machine with the image file):

./PharoS Pharo.image &

Pharo running on the Raspberry Pi

We will not go into the details of developing an application with Pharo here and instead use an already prepared one. The Smalltalk language is easy to learn — but as a pure object oriented environment you may have to (re)learn the way of coding. Pharo is not only a lively environment where you can code but also a very dynamic environment where you can change anything: starting from the tools up to the language itself. Did you know that object oriented programming, user interfaces with windows and icons, Unit testing and Extreme Programming — it all can be traced back to have its roots in Smalltalk. Once you get used to the environment a little bit you will notice why all of its revolutionary ideas and tools had such a big influence on many known IT technologies.

I kindly refer to the documentation and books available for more details.