A Live Developer Journal

Setting up Pharo Smalltalk Developer Environment

There are a few variations of the Smalltalk programming language. I chose Pharo for no particular reason than to get started with one of them. Pharo is a pure object-oriented programming language and a development environment.

Will be updating these instructions to include setting up test cases.

The download instructions I am following can be found on Pharo's Setting up a project Github page

Install Pharo with Brew

brew cask install pharo-project/pharo/pharo-launcher intallation result for pharo

Search for PharoLauncher in finder and open it.

pharo when it has been launched
for the first time

In the Pharo launcher

When you launch your image, Pharo gives you the option to select a white or dark theme. I nearly missed that.

Create a package and a class

To make your first package, click on the "Tools" option in the top menu bar, and then click on "System Browser". According to the tutorial, the System Browser is the main tool to develop a project in Pharo.

The leftmost panel in the system browser shows all of the packages that already exist in your project. To create a new one, right click anywhere in the leftmost panel and choose the option "New package", which will open a new small window.

Give your package a name and click 'ok'. I called mine "Hello-World", which follows the package naming convention I observed accross the other package names. Two capitalised words seperated by a hyphen.

To create a class, click on your package name. You will see a class stub template in the panel that spans accross the bottom of the screen. Change the name of the class to your own name. In this case, I named my class 'HelloWorld'. The classname here is prefixed by a hash symbol. So when you replace the template name be sure to keep that in place.

Save your class with command-s (for Mac). After doing this you will see the middle pane of your system browser now has 'ClassName !' in it, and the panel to the right will contain 'instance side'.