How to use Pharo/Squeak from the Command-line

Along the way to measure the performance of a Smalltalk implementation for commodity multi-core systems, I tried to use Pharo as a more convenient development platform. Well, and I failed in the first attempt…

To remind myself and document some of the necessary steps in this environment, I wrote up the following tutorial.

Command-line Scripts with a Headless Pharo

For some tasks like benchmarking and automated testing, an integration with other tools comes in handy. For such use cases, Pharo can be used headless, i.e., without its graphical user interface.

This brief tutorial will demonstrate how to use the Debian Language Shootout benchmarks with a fresh Pharo image.

Step 1: Setup Pharo and a Fresh Image

download a Pharo image, the sources file, and a VM from the download page

extract all archives in the same folder

start Pharo, from the commandline, on a MacOSX it should look like this: "Squeak 4.2.1beta1U.app/Contents/MacOS/Squeak VM Opt" \
pharo1.0-10418-BETAdev09.08.3.image

Step 2: Load OSProcess

For output on the shell, we need an extra package from the SqueakSource repository.

It can be loaded by simply executing the following code in a workspace window: