Sunday 15 November 2015

How to get a Smalltalk up and running

Scope: This how-to covers Squeak, Pharo, Cuis, Amber and Dolphin.  

Many of the concepts also apply other Smalltalks. 

Smalltalk installations come in two principal parts.

The first part is known as the "Virtual Machine" 

More usually called the "VM".  This is the underlying engine that Smalltalk runs on.  It interfaces with the operating system of the computer that you are running the Smalltalk on, and also provides low-level services e.g. garbage-collection. 

Most Virtual Machines are cross-platform.  When you use a cross-platform VM, all the Smalltalks that run on top of the VM are cross-platform too. 

Cuis, Pharo and Squeak can all run on the same Virtual Machines, which run on MacOS, Windows and Linux.  

Dolphin Smalltalk is designed to run on its own Virtual Machine, which runs on Windows. 

The second part is called the "image" .  

The image holds a bunch of Smalltalk code.  And it holds more, too. It holds a bunch of data.  And it holds all the information about the Smalltalk GUI as it was when the image was last saved.  Which windows the user had open, and where they were positioned. 

It holds everything that Smalltalk knew about, and all information relevant to running the Smalltalk installation. 

The image file can be considered to be a collection of all information about a particular installation of  Smalltalk from just before it went into hibernation. 

Choosing a Smalltalk 

A little bit about each Smalltalk, and platform-specific notes

Squeak has given rise to both Pharo and Cuis, and also both the Seaside and AidaWeb web applications frameworks, along with much else.


The Scratch graphical programming language is written in Squeak, for example.

A lot of work goes in to getting Squeak running fast on the Raspberry Pi , because Scratch is written in Squeak. Scratch is a key package for teaching children to program, and the Rasberry Pi is a platform designed for teaching children to program. This work is done so that Scratch will run fast on the Pi, but it has a very useful side-effect for people who want to use Smalltalk on the Pi.

Cuis is a fork of Squeak, intending to radically simplify the numbers of libraries in the distribution, and radically simplify the way GUIs are drawn and coded.

It contains only 500 classes, compared to the 2,300 in Squeak and the 5,000 in Pharo.

This makes it a good candidate for understanding a Smalltalk from top to bottom. Potentially it might lead to speedy performance.

Pharo is a fork of Squeak where the focus is on extending the functionality and ability of Squeak, without much regard to backward compatibility.  Considerable effort goes in to making sure that Pharo always remains a capable platform for the Seaside web server.

Pharo evolves rapidly, with vast majority of the additional functionality added by academic computer science research groups.  Nonetheless, the Pharo management team intend it also to be a useful platform for commercial application developments - as can be seen by the effort that goes into keeping the GUI and desktop themes looking clean and professional.

Cuis, Pharo and Squeak can all run on the same Virtual Machines, which run on MacOS, Windows and Linux.  

Squeak 5.0 includes extensive optimisations for when it runs on the Raspberry Pi


Dolphin Smalltalk is designed to run on its own Virtual Machine, which runs on Windows

The key advantages are that Dolphin is designed to provide a Windows native look-and-feel; and a working system can be packaged up as a .exe install file. This means there is no learning curve for Windows end-users when they are installing an end-user app written in Dolphin Smalltalk. 


Dolphin Community Edition cannot store code and classes to repositories in the cloud, or automatically retrieve packages from the internet.  Downloading packages that other people have already written for you to use from the internet is really useful as you start out. So you'd be better to download Squeak or Pharo, to start out with - unless you really want native look-and-feel from day 1.    

Downloading packages from the internet is available in the paid-licence version of Dolphin.  I have not yet used this, so cannot vouch for how well it works.

So unless you want to learn only Windows-GUIs, I personally advise you to start on a different Smalltalk, and then later come back and learn the Windows-GUI facilities in Dolphin, once you are used to Smalltalk.

Amber Smalltalk runs in your web-browser.
This makes it really convenient for trying code snippets, anywhere. 
It also allows you to write JavaScript apps in Smalltalk.  These apps happily integrate with the rest of the JavaScript ecosystem.
 

If you want to start writing web applications as you learn, then you can use a package called Seaside, which has a once-click installer for Pharo and Seaside, all in one step. 

Seaside will also run on Squeak, but I don't know of any current All-in-one installer for it.

Licencing Issues

Cuis, Pharo and Squeak all use the MIT licence.  This allows commercial use, and is also GPL-compatible. 

Dolphin's licence allows you to distribute the DLLs and the Dolphin VM as an integral part of executable applications created by you using Dolphin Smalltalk. 

Download a  Smalltalk

With all Smalltalks

If you have a specific pre-existing application, package or library you want to use, you may need to use an older version.  If you just want to get started with the latest version, choose the latest version. 

On Windows

All of the cross-platform Smalltalks can be installed as a 'portable' installation.  You can copy the installed folder to anywhere on your PC and the Smalltalk will still run. The folder contains all the necessary code and .dlls to run successfully. 

For specific Smalltalks

Amber:

Go to http://amber-lang.net

Click on the "Try Amber in your Browser" link.

Cuis:

Cuis currently has you download the Smalltalk VM and the Cuis image separately. Probably best to start with one of the others, then come back to Cuis once you have got the hang of  VMs and Images. 

The Cuis Image is available from 
https://github.com/Cuis-Smalltalk

Any Squeak VM should work with Cuis. 


Dolphin:

http://www.object-arts.com/downloads/downloads.html 

Dolphin Smalltalk download page


At time of writing (2015-11-11), there is one download link 
Dolphin X6.0 (Community and Pro Editions) 

This downloads a .exe file.   (And the first time it runs, it will prompt you to email for a (zero-cost) Community edition licence number). 

If later you wish to prepare .exe files for your application's end-users, you can upgrade to the Pro Edition for a fee of ~£160(GBP) or approx.  $225(USD)/€225(EUR) 



Pharo: 



At time of writing (2015-11-11), the site offers Pharo 4.0 via three download links, one for each of MacOS, Windows and Linux. 


Windows : http://files.pharo.org/platform/Pharo4.0-win.zip
Linux : http://pharo.org/gnu-linux-installation

Once you have a little experience with VMs and images, you can download the latest Pharo 5.0 development image from  http://files.pharo.org/get-files/50/pharo.zip


Seaside



Squeak:

http://squeak.org/downloads/ 



At time of writing (2015-11-11), there are two versions listed under "Quick Download" 
All-in-One (Spur)  - Version 5.0 
All-in-One (Non-Spur) - Version 4.6 

"Spur" / "Non-Spur" refers to the Virtual Machine (VM) included in the download.  Cog is currently the most prevalent VM in the Squeak/Pharo/Cuis worlds. 

A recent improvement to Cog was labelled "Spur".  So '(Spur)' means that the install includes the latest Cog VM with added Spur.  '(Non-Spur)' means that it includes a slightly older version of the Cog VM. 

To start A Smalltalk

Once you have the files unzipped and installed on your computer: 

For Amber

If you followed the installation guide, you already have it started!

For Cuis

On Windows 
Open the folder with the VM in it. 
Drag the Cuis .image file you want to use and drop it on the VM 

On Linux

To be determined. If anyone knows how, please let me know, and I'll include it here. 

on MacOS

To be determined. If anyone knows how, please let me know, and I'll include it here. 


For Dolphin (Version 6)

On Windows 
Open the folder you have installed Dolphin to. 
Drag the 'Professional (Fresh Install).img' file and drop it on Dolphin.exe


For Pharo 4.0

on Windows 
Open the folder you have unzipped Pharo to. 
drag the .image file you want to use and drop it on Pharo.exe 

On Linux 
Move to the folder you have unzipped Pharo to 
In a shell or terminal window, type: 
./PharoS Pharo.image & 

on MacOS 

To be determined. If anyone knows how, please let me know, and I'll include it here. 



For Seaside 3.1

on Windows 
Open the folder 
Double-click on Pharo.exe

On Linux 
To be determined. If anyone knows how, please let me know, and I'll include it here. 



on MacOS 


To be determined. If anyone knows how, please let me know, and I'll include it here. 



For Squeak 5.0

on Windows 
Open the folder you have unzipped Squeak to. 
Double-click on squeak.bat 

on Linux 
navigate into the Squeak folder  
In a shell or terminal window, type: 
bash squeak.sh 

on MacOS

To be determined. If anyone knows how, please let me know, and I'll include it here. 
I imagine you double-click on Squeak-5.0-All-in-One.app 


Version 0.9, published 2015-11-12

1 comment: