Overview

Smalltalk Byte magazine cover

The target audience for this series of articles on Smalltalk is readers that already know at least one programming language. There are many tables that summarize features of Smalltalk. These aim to quickly provide a sense of what is available by including the most useful features and not aiming to be exhaustive.

Smalltalk "is a purely object-oriented programming language (OOP)." Everything is represented by an object that is an instance of some class. This includes classes themselves and all the GUI elements in the development environment. Everything happens by sending messages to objects. The objects decide whether and how to act on the messages.

Simula is considered to be the first object-oriented programming (OOP) language. In Simula, the data that models a simulation are represented by objects, but primitive data types like numbers are not. While Simula preceded Smalltalk, Smalltalk was the first programming language to make OOP popular.

Smalltalk is not an interpreted language. It was the first programming language to use just-in-time (JIT) compilation. Smalltalk code is compiled to optimized bytecode that is executed by a virtual machine (VM). Compilation occurs when method code is saved. This results in better performance than interpreting code.

Running Smalltalk programs requires two parts, a VM and an image file. The VM reads and executes Smalltalk code found in an image file. It is specific to the operating system and CPU architecture being used.

Image files can be moved between operating systems on different CPU architectures. It will render the same windows, pixel for pixel, across Windows, Linux, and MacOS, only differing based on screen size. There is no need to recompile code for different environments. This makes Smalltalk code highly portable.

An image file can be thought of as a snapshot of the current state of the development environment. It describes the collection of all active objects. During development, changes can be saved to the current image or to a new image.

Smalltalk is perhaps most known for its incredible development tools. These support:

Smalltalk is a dynamically typed language. Types of variables, method parameters, and method return types are never specified. Instead, duck typing is used. Any object can be used as long as it is able to respond to all the messages that are sent to it. This is determined at run-time.

Alan Kay, Dan Ingalls, and Adele Goldberg worked at Xerox PARC (Palo Alto Research Center) in the 1970s. They collaborated to create Smalltalk. Alan Kay was the primary designer of Smalltalk and gave it its name. Dan Ingalls was the primary implementor. Adele Goldberg primarily focused on documentation and promoting Smalltalk outside of PARC. The original goal was to use Smalltalk to teach programming.

Many other technologies were invented at PARC including graphical user interfaces, the mouse, drag and drop, model-view-controller architecture, and virtual machines. The office metaphor of applying the terms desktop, folder, and file were also introduced at PARC.

Alan Kay said "OOP to me means only messaging, local retention and protection and hiding of state-process, and extreme late-binding of all things." He also said "I'm sorry that I, long ago, coined the term 'Objects' for this topic, because it gets many people to focus on the lesser idea. The big idea is messaging!".

Late binding means that messages sent to objects are looked up for compatible methods at runtime. A method name is referred to as a selector. However, Smalltalk editors do check for "unknown selectors" when code is entered that sends a message to a literal object (not to a variable).

Smalltalk did not gain much traction outside Xerox Parc until BYTE magazine published an issue focused on Smalltalk in August 1981. The cover, shown at the beginning of this article, featured a colorful hot air balloon.

In the 1990's the popularity of Smalltalk had risen enough that it was seen as a possible alternative to C++. For a time, IBM promoted replacing COBOL with Smalltalk. In 1995, Smalltalk was the second most popular OO language after C++. Smalltalk had a 15% market share compared to 71% for C++.

At the OOPSLA 1997 conference, Alan Kay said "Actually, I made up the term 'object-oriented' and I can tell you I did not have C++ in mind." He also said "Languages like C++ and Java are OOP done wrong. Smalltalk is OOP done right."

Today Smalltalk is still used by the financial industry, manufacturing, utilities, transportation, and academia.

The entire syntax of Smalltalk can be demonstrated on a post card.

Smalltalk on a post card

Why Learn Smalltalk

Some reasons to learn Smalltalk include:

Resources

There is a Cuis Smalltalk mailing list, but no Discord or Slack channel.

There is a Discord channel channel for Squeak Smalltalk.

The following recent podcast episodes discuss Smalltalk:

Pros and Cons

Smalltalk has the following pros:

Smalltalk has the following cons:

History

Implementations

The following implementations of Smalltalk were created after those listed above in the "History" section.

The most popular open source Smalltalk implementations include the following:

Squeak, Pharo, and Cuis all use the MIT license. Both Pharo and Cuis began as forks of Squeak after maintenance of Squeak was turned over to the community and there was a lack of consensus on its future goals.

The number of predefined classes in each implementation above were obtained by printing the result of Smalltalk allClasses size with latest versions as of June 10, 2024.

Commercial Applications

Commercial applications built with Smalltalk are listed at:

Centers of Smalltalk Activity

Conferences

User Groups

Cuis Smalltalk

This blog primarily focuses on Cuis Smalltalk and running in macOS. Most keyboard shortcuts in macOS use the command key, abbreviated as "cmd". In Linux and Windows, the control key is used instead, abbreviated as "ctrl".

Cuis Smalltalk was created by Juan Vuletich who has been active in the Smalltalk community since 1997. Juan began work on Cuis Smalltalk began in 2005 and version 1.0 was released in March 2009.

The objectives of Cuis Smalltalk are to:

Any missing features can be defined by combining the features that are present and by installing more packages.

Some advantages that Cuis has over Squeak and Pharo are that it has built-in support for Unicode and TrueType fonts. Those can be added to Squeak and Pharo through foreign libraries. Cuis also adds support for high-quality vector graphics and rendering Scalable Vector Graphics (SVG).

Cuis Smalltalk uses the same VM as Squeak Smalltalk, now called the Open Smalltalk Virtual Machine. Pharo Smalltalk has its own VM which is a fork of the Open Smalltalk VM.

The Cuis Smalltalk base image is almost entirely implemented in Smalltalk.

It is a goal to have a new stable release of Cuis Smalltalk every six months, typically in June and December.

The Cuis mascot is southern mountain cavy which is a "tailless rodent with short, speckled, greyish-yellow fur, fading to pale grey on the underparts." They look similar to a mouse, but grow to around eight inches in length. They are found in Argentina. Juan Vuletich began development of Cuis Smalltalk in Buenos Aires, Argentina. The word "cuis" in Rioplatense Spanish means "squeak".

GitHub Account

The GitHub account for Cuis Smalltalk is at Cuis-Smalltalk. This hosts many related repositories including the main one that holds the latest code for the Cuis Smalltalk image, Cuis-Smalltalk-Dev. As of May 2024, 96.8% of the code in the repository is written in Smalltalk. Other related repositories include:

Many of these repositories define optional packages. To install them, clone their repository into the same directory as the Cuis-Smalltalk-Dev directory (or Cuis6-2 or Cuis7-0). Then install them using one of the approaches described in the "Packages" section of the "Saving Code" chapter.

For additional packages, search GitHub for repositories whose names begin with "Cuis-Smalltalk-".