Categories: Programming

Getting to “Hello World” in Dolphin Smalltalk

A colleague at work was telling me about the Smalltalk programming language this week. I have never used it so I asked for compiler recommendations for it. Dolphin smalltalk was one of the suggestions. I downloaded the ZIP of the latest release from https://github.com/dolphinsmalltalk/Dolphin/releases/tag/7.2.0 but unzipping it and launching it fails with a Fail to open image file 'C:\software\DolphinVM\DPRO.img7' error message. Downloading and running the Dolphin7Setup.exe installer got the Dolphin environment up and running.

Building Dolphin Smalltalk

I’m always interested in how different projects are built – this one stands out for being a Windows-only project. The repo I cloned was at commit 2cbc3e72cb.

git clone https://github.com/dolphinsmalltalk/Dolphin

Building Core/DolphinVM/DolphinVM.sln in Visual Studio takes less than a minute on my desktop. Pressing F5 shows an error dialog: Unable to start program 'C:\repos\Dolphin\Core\DolphinVM\Debug\DolphinVM8.dll'. Changing the startup project from VM to Launcher just shows the Fail to open image file 'C:\repos\Dolphin\Core\DolphinVM\Launcher\DPRO.img8' error. Looking at the repo home page, I think I have only built the virtual machine.

Building the Dolphin 8 Product Image

The instructions say to run git lfs pull but that doesn’t appear to do anything. Next step is to run BootDPRO.cmd. It calls Dolphin8 with the DBOOT.img8 argument. GitHub displays a note that this file is Stored with Git LFS. This note links to Managing large files – GitHub Docs and this is the first time I’m really looking at this. I don’t really understand why a file that’s less than 2MB needs this so I will skip this LFS detail for now. Running the command in BootDPRO.cmd in my MINGW shell does not do anything.

saint@desktop MINGW64 /c/repos/Dolphin (master)
$ ./Dolphin8.exe DBOOT.img8 DolphinProfessional

Switching to a Windows command prompt does the trick! I’m still in the dark about what this machine is and what exactly this image being compiled is.

C:\repos\Dolphin>BootDPRO.cmd
Dolphin Smalltalk Boot
Copyright (c) Object Arts Ltd, 1997-2021.
Boot started at 2024-06-27T21:33:14.671937943-06:00
Loading boot script...
Reloading BCL constants pools...
Updating ClassBuilder...
Reloading BCL class definitions...
Recompilation of OpcodePool required because class variables/constants are being added
...
Reloading 'Dolphin Message Box' ...
Loading source package 'Dolphin Message Box' from: C:\repos\Dolphin\Core\Object Arts\Dolphin\System\Win32\MessageBox\Dolphin Message Box.pax
Deleting obsolete boot image methods...
Removing obsolete boot image method Compiler class>>#notificationCallback:
...
Recompiling references to ICONDIR (size 22)...
Recompiling references to PROCESS_INFORMATION (size 16)...
Recompiling references to STARTUPINFOW (size 68)...
Boot completed at 2024-06-27T21:36:03.2736891-06:00, duration 2.81 minutes

Launching Dolphin8

We can now run Dolphin using this command:

Dolphin8.exe DPRO.img8

The program launches successfully. Note that Dolphin8.exe is the output of the Launcher project. To debug the application:

  1. Set Launcher as the startup project in Visual Studio.
  2. Open the Property Pages of the Launcher project.
  3. Navigate to the Configuration Properties > Debugging pane.
  4. Set the Command Arguments to “DPRO.img8”
  5. Set the Working Directory to the root of the git repo, e.g. “C:\repos\Dolphin”
  6. Press OK then launch the program.

Ideally, these steps should be built into the solution and the launcher project’s configuration but it was straightforward to figure out. This is what I get.

Dolphin Smalltalk Professional - DPRO.img8

Hello World in Smalltalk

I’m not quite sure where to start. I search for a smalltalk tutorial for beginners – Search (bing.com) decided to try the GNU Smalltalk User’s Guide: Saying hello by creating a new workspace then pasting 'Hello, world' printNl into it but it grumbles:

I ask Microsoft Copilot to “print hello world in dolphin smalltalk”. It suggests Transcript show: 'Hello World!'. explaining that

The Transcript class allows you to print messages by sending the show: message to it, with the string you want to display as the parameter

smalltalk Tutorial => Hello World in Smalltalk (riptutorial.com)

I evaluated this line, but nothing appeared to be happening. I reread the quote then search for the Transcript window. It is the System Transcript window shown below (whose icon is in the Dolphin Smalltalk Professional screenshot above). Sure enough, it contains the Hello World message.

System Transcript Window
System Transcript Window

As pointed out by my colleague and others like Dolphin Smalltalk 7 (randycoulman.com), picking up this language can make you a better programmer. I’ll need to find a decent program to implement in Smalltalk to learn about this programming language.

Article info



Leave a Reply

Your email address will not be published. Required fields are marked *