Designed byAlan Kay, Dan Ingalls, Adele Goldberg
First appeared1972; 49 years ago (1972) (development began in 1969)
Stable release
Smalltalk-80 version 2 / 1980; 41 years ago (1980)
Typing disciplineStrong, dynamic
ScopeLexical (static)
Implementation languageSmalltalk
PlatformXerox Alto (74181)[1][2]
OSCross-platform (multi-platform)
Major implementations
Amber, Dolphin Smalltalk, GemStone/S, GNU Smalltalk, Pharo, Smalltalk/X, Squeak, Cuis, Haver, VA Smalltalk, VisualWorks
Influenced by
Lisp,[3] Simula,[3] Euler,[3] IMP,[3] Planner,[3] Logo,[4] Sketchpad,[3] ARPAnet,[3] Burroughs B5000[3]
AppleScript, Common Lisp Object System, Dart, Dylan, Erlang, Etoys, Go, Groovy, Io, Ioke, Java, Lasso, Logtalk, Newspeak, NewtonScript, Object REXX, Objective-C, PHP 5, Python, Raku, Ruby, Scala, Scratch, Self

Smalltalk is an object-oriented, dynamically typed reflective programming language. Smalltalk was created as the language underpinning the "new world" of computing exemplified by "human–computer symbiosis".[4] It was designed and created in part for educational use, specifically for constructionist learning, at the Learning Research Group (LRG) of Xerox PARC by Alan Kay, Dan Ingalls, Adele Goldberg, Ted Kaehler, Diana Merry, Scott Wallace, and others during the 1970s.

The language was first generally released as Smalltalk-80. Smalltalk-like languages are in active development and have gathered loyal communities of users around them. ANSI Smalltalk was ratified in 1998 and represents the standard version of Smalltalk.[5]

Smalltalk took second place for "most loved programming language" in the Stack Overflow Developer Survey in 2017,[6] but it was not among the 26 most loved programming languages of the 2018 survey.[7]


There are a large number of Smalltalk variants.[8] The unqualified word Smalltalk is often used to indicate the Smalltalk-80 language, the first version to be made publicly available and created in 1980. The first hardware-environments which run the Smalltalk VMs were Xerox Alto computers.

Smalltalk was the product of research led by Alan Kay at Xerox Palo Alto Research Center (PARC); Alan Kay designed most of the early Smalltalk versions, Adele Goldberg wrote most of the documentation, and Dan Ingalls implemented most of the early versions. The first version, termed Smalltalk-71, was created by Kay in a few mornings on a bet that a programming language based on the idea of message passing inspired by Simula could be implemented in "a page of code".[4] A later variant used for research work is now termed Smalltalk-72 and influenced the development of the Actor model. Its syntax and execution model were very different from modern Smalltalk variants.


Smalltalk-80 was the first language variant made available outside of PARC, first as Smalltalk-80 Version 1, given to a small number of firms (Hewlett-Packard, Apple Computer, Tektronix, and Digital Equipment Corporation (DEC)) and universities (UC Berkeley) for peer review and implementing on their platforms. Later (in 1983) a general availability implementation, named Smalltalk-80 Version 2, was released as an image (platform-independent file with object definitions) and a virtual machine specification. ANSI Smalltalk has been the standard language reference since 1998.[9]




Cincom, GemTalk, and Instantiations, continue to sell Smalltalk environments. IBM has 'end of life'd VisualAge Smalltalk having in the late 1990s decided to back Java instead and it is, as of 2005, supported by Instantiations, Inc.[12] who renamed the product VA Smalltalk (VAST Platform) and continue to release new versions yearly. The open Squeak implementation has an active community of developers, including many of the original Smalltalk community, and has recently been used to provide the Etoys environment on the OLPC project, a toolkit for developing collaborative applications Croquet Project, and the Open Cobalt virtual world application. GNU Smalltalk is a free software implementation of a derivative of Smalltalk-80 from the GNU project. Pharo Smalltalk is a fork of Squeak oriented toward research and use in commercial environments.

A significant development, that has spread across all Smalltalk environments as of 2016, is the increasing usage of two web frameworks, Seaside and AIDA/Web, to simplify the building of complex web applications. Seaside has seen considerable market interest with Cincom, Gemstone, and Instantiations incorporating and extending it.


Smalltalk was one of many object-oriented programming languages based on Simula.[13] Smalltalk is also one of the most influential programming languages. Virtually all of the object-oriented languages that came after—Flavors,[14] CLOS, Objective-C, Java, Python, Ruby,[15] and many others—were influenced by Smalltalk. Smalltalk was also one of the most popular languages for agile software development methods, rapid application development (RAD) or prototyping, and software design patterns.[16] The highly productive environment provided by Smalltalk platforms made them ideal for rapid, iterative development.

Smalltalk emerged from a larger program of Advanced Research Projects Agency (ARPA) funded research that in many ways defined the modern world of computing. In addition to Smalltalk, working prototypes of things such as hypertext, GUIs, multimedia, the mouse, telepresence, and the Internet were developed by ARPA researchers in the 1960s.[17][18] Alan Kay (one of the inventors of Smalltalk) also described a tablet computer he called the Dynabook which resembles modern tablet computers like the iPad.[19]

Smalltalk environments were often the first to develop what are now common object-oriented software design patterns. One of the most popular is the model–view–controller (MVC) pattern for user interface design. The MVC pattern enables developers to have multiple consistent views of the same underlying data. It's ideal for software development environments, where there are various views (e.g., entity-relation, dataflow, object model, etc.) of the same underlying specification. Also, for simulations or games where the underlying model may be viewed from various angles and levels of abstraction.[20]

In addition to the MVC pattern, the Smalltalk language and environment were highly influential in the history of the graphical user interface (GUI) and the what you see is what you get (WYSIWYG) user interface, font editors, and desktop metaphors for UI design. The powerful built-in debugging and object inspection tools that came with Smalltalk environments set the standard for all the integrated development environments, starting with Lisp Machine environments, that came after.[21]

Object-oriented programming

Main article: Object-oriented programming


A Smalltalk object can do exactly three things:

  1. Hold state (references to other objects).
  2. Receive a message from itself or another object.


Unlike most other languages, Smalltalk objects can be modified while the system is running. Live coding and applying fixes ‘on-the-fly’ is a dominant programming methodology for Smalltalk and is one of the main reasons for its efficiency.


Since all values are objects, classes are also objects. Each class is an instance of the metaclass of that class. Metaclasses in turn are also objects, and are all instances of a class called Metaclass. Code blocks—Smalltalk's way of expressing anonymous functions—are also objects.[23]


Reflection is a term that computer scientists apply to software programs that have the ability to inspect their own structure, for example their parse tree or data types of input and output parameters. Reflection is a feature of dynamic, interactive languages such as Smalltalk and Lisp. Interactive programs with reflection (either interpreted or compiled) maintain the state of all in-memory objects, including the code object itself, which are generated during parsing/compilation and are programmatically accessible and modifiable.

Reflection is also a feature of having a meta-model as Smalltalk does. The meta-model is the model that describes the language, and developers can use the meta-model to do things like walk through, examine, and modify the parse tree of an object, or find all the instances of a certain kind of structure (e.g., all instances of the Method class in the meta-model).

Smalltalk-80 is a totally reflective system, implemented in Smalltalk-80. Smalltalk-80 provides both structural and computational reflection. Smalltalk is a structurally reflective system which structure is defined by Smalltalk-80 objects. The classes and methods that define the system are also objects and fully part of the system that they help define. The Smalltalk compiler compiles textual source code into method objects, typically instances of CompiledMethod. These get added to classes by storing them in a class's method dictionary. The part of the class hierarchy that defines classes can add new classes to the system. The system is extended by running Smalltalk-80 code that creates or defines classes and methods. In this way a Smalltalk-80 system is a "living" system, carrying around the ability to extend itself at run time.






This section needs additional citations for verification. Please help improve this article by adding citations to reliable sources. Unsourced material may be challenged and removed. (June 2014) (Learn how and when to remove this template message)



exampleWithNumber: x
    | y |
    y := self size + super size.
    #($a #a 'a' 1 1.0)
        do: [ :each |
            Transcript show: (each class name);
                       show: ' '].
    ^x < y



Numbers. The following list illustrates some of the possibilities.



Characters are written by preceding them with a dollar sign:


Strings are sequences of characters enclosed in single quotes:

'Hello, world!'











#(1 2 3 4)

defines an array of four integers.

Many implementations support the following literal syntax for ByteArrays:

#[1 2 3 4]

defines a ByteArray of four integers.

And last but not least, blocks (anonymous function literals)

[... Some smalltalk code...]

Blocks are explained in detail further in the text.


Variable declarations



| index |


Multiple variables may be declared within one set of bars:

| index vowels |




vowels := 'aeiou'

Assigns the string 'aeiou' to the formerly declared vowels variable. The string is an object (a sequence of characters between single quotes is the syntax for literal strings), created by the compiler at compile time.

In the original Parc Place image, the glyph of the underscore character ⟨_⟩ appeared as a left-facing arrow ⟨←⟩ (like in the 1963 version of the ASCII code). Smalltalk originally accepted this left-arrow as the only assignment operator. Some modern code still contains what appear to be underscores acting as assignments, hearkening back to this original usage. Most modern Smalltalk implementations accept either the underscore or the colon-equals syntax.


The message is the most fundamental language construct in Smalltalk. Even control structures are implemented as message sends. Smalltalk adopts by default a dynamic dispatch and single dispatch strategy (as opposed to multiple dispatch, used by some other object-oriented languages).


42 factorial


aRatherBigNumber := 42 factorial


2 raisedTo: 4


'hello world' indexOf: $o startingAt: 6



new Rectangle(100, 200);


Rectangle width: 100 height: 200



3 + 4


3 > 4






3 factorial + 4 factorial between: 10 and: 100

is evaluated as follows:

  1. 3 receives the message "factorial" and answers 6
  2. 4 receives the message "factorial" and answers 24






3 + 4 * 5


3 + (4 * 5)

Unary messages can be chained by writing them one after another:

3 factorial factorial log



 | window |
  window := Window new.
  window label: 'Hello'.
  window open


  Window new
    label: 'Hello';


Code blocks

A block of code (an anonymous function) can be expressed as a literal value (which is an object, since all values are objects). This is achieved with square brackets:

[ :params | <message-expressions> ]


[:x | x + 1]

can be understood as:


or expressed in lambda terms as:



[:x | x + 1] value: 3

can be evaluated as

Or in lambda terms as:





True methods for evaluation

ifTrue: trueAlternativeBlock ifFalse: falseAlternativeBlock
    ^trueAlternativeBlock value

False methods for evaluation

ifTrue: trueAlternativeBlock ifFalse: falseAlternativeBlock
    ^falseAlternativeBlock value


Control structures


The following code demonstrates this:

result := a > b
    ifTrue:[ 'greater' ]
    ifFalse:[ 'less or equal' ]

Blocks are also used to implement user-defined control structures, enumerators, visitors, exception handling, pluggable behavior and many other patterns. For example:

| aString vowels |
aString := 'This is a string'.



| rectangles aPoint collisions |
rectangles := OrderedCollection
aPoint := Point x: 20 y: 20.

The exception handling mechanism uses blocks as handlers (similar to CLOS-style exception handling):

  some operation
] on:Error do:[:ex |
  ex return

The exception handler's "ex" argument provides access to the state of the suspended operation (stack frame, line-number, receiver and arguments etc.) and is also used to control how the computation is to proceed (by sending one of "ex proceed", "ex reject", "ex restart" or "ex return").


This is a stock class definition:[31]

Object subclass: #MessagePublisher
    instanceVariableNames: ''
    classVariableNames: ''
    poolDictionaries: ''
    category: 'Smalltalk Examples'

Often, most of this definition will be filled in by the environment. Notice that this is a message to the Object class to create a subclass called MessagePublisher. In other words: classes are first-class objects in Smalltalk which can receive messages just like any other object and can be created dynamically at execution time.



    Transcript show: 'Hello World!'

The following method demonstrates receiving multiple arguments and returning a value:

quadMultiply: i1 and: i2
    | mul |
    mul := i1 * i2.
    ^mul * 4



Instantiating classes

The following code:

MessagePublisher new


publisher := MessagePublisher new


MessagePublisher new publish

Hello World example


Transcript show: 'Hello, world!'.


Image-based persistence


Many Smalltalk systems, however, do not differentiate between program data (objects) and code (classes). In fact, classes are objects. Thus, most Smalltalk systems store the entire program state (including both Class and non-Class objects) in an image file. The image can then be loaded by the Smalltalk virtual machine to restore a Smalltalk-like system to a prior state.[32] This was inspired by FLEX, a language created by Alan Kay and described in his M.Sc. thesis.[33]

Smalltalk images are similar to (restartable) core dumps and can provide the same functionality as core dumps, such as delayed or remote debugging with full access to the program state at the time of error. Other languages that model application code as a form of data, such as Lisp, often use image-based persistence as well. This method of persistence is powerful for rapid development because all the development information (e.g. parse trees of the program) is saved which facilitates debugging. However, it also has serious drawbacks as a true persistence mechanism. For one thing, developers may often want to hide implementation details and not make them available in a run time environment. For reasons of legality and maintenance, allowing anyone to modify a program at run time inevitably introduces complexity and potential errors that would not be possible with a compiled system that exposes no source code in the run time environment. Also, while the persistence mechanism is easy to use, it lacks the true persistence abilities needed for most multi-user systems. The most obvious is the ability to do transactions with multiple users accessing the same database in parallel.[34]

Level of access


Just-in-time compilation

Main article: Just-in-time compilation


List of implementations


OpenSmalltalk VM (OS VM), is a notable implementation of the Smalltalk Runtime environment on which many modern Smalltalk implementations are based or derived from.[35] OS VM itself is transpiled from a set of Smalltalk source code files (using a subset of Smalltalk called Slang) to native C language source code (by using a transpiler called VMMaker),[36] which is in turn compiled against specific platform and architecture of the hardware practically enabling cross-platform execution of the Smalltalk images. The source code is available on GitHub and distributed under MIT License. The known Smalltalk implementations based on the OS VM are:


See also


  1. ^ "Alto I Schematics" (PDF). Bitsavers. p. 54. Retrieved 21 July 2016.
  2. ^ "History of Computers and Computing, Birth of the modern computer, Personal computer, Xerox Alto". Retrieved 2016-04-19.
  3. ^ a b c d e f g h Kay, Alan; Ram, Stefan (2003-07-23). "E-Mail of 2003-07-23". Dr. Alan Kay on the Meaning of 'Object-Oriented Programming'. Retrieved 2009-01-03.
  5. ^ "ANSI Smalltalk Standard". 2004. Archived from the original on 2006-02-16. Retrieved 2021-03-02.
  6. ^ Stack Overflow Developer Survey 2017
  7. ^ Stack Overflow Developer Survey 2018
  10. ^ Hobbes
  12. ^ VisualAge Smalltalk Transition FAQ
  15. ^ "About Ruby". Retrieved 17 December 2013.
  16. ^ "Where Did Refactoring Come From?". Retrieved 17 December 2013.
  18. ^ "Engelbart's Role in Early Computer Networking". Retrieved 17 December 2013.
  20. ^ Krasner, Glen; Pope, Stephen (August–September 1988). "A Cookbook for Using the Model-View-Controller User Interface Paradigm in Smalltalk -80". Journal of Object-Oriented Programming.
  21. ^ "Our Influence". Retrieved 16 December 2013.
  23. ^ Goldberg, Adele; Robson, David (1989). Smalltalk-80 The Language. Addison Wesley. pp. 31, 75–89. ISBN 0-201-13688-0.
  24. ^ Clark, A.N. (1997). "Metaclasses and Reflection in Smalltalk". CiteSeerX Cite journal requires |journal= (help)
  25. ^ Ducasse, Stéphane; Lienhard, Adrian; Renggli, Lukas. "Seaside – A Multiple Control Flow Web Application Framework" (PDF). Software Composition Group Institut fur Informatik und angewandte Mathematik Universitaat Bern, Switzerland. Retrieved 16 December 2013.
  26. ^ Foote, Brian; Johnson, Ralph (1–6 October 1989). "Reflective Facilities in Smalltalk-80". Oopsla '89: 327–335. doi:10.1145/74877.74911. ISBN 0897913337. S2CID 14207536. Retrieved 16 December 2013.
  27. ^ Smith, Brian C (1982-01-01). "Procedural Reflection in Programming Languages". MIT Technical Report (MIT-LCS-TR-272). Retrieved 16 December 2013.
  28. ^ Denker, Marcus; Peck, Mariano Martinez; Bouraqadi, Noury; Fabresse, Luc; Ducasse, Stéphane. "Efficient Proxies in Smalltalk" (PDF). Cite journal requires |journal= (help)
  29. ^ [1] [2]
  32. ^ "Image-Based Persistence". Retrieved 17 December 2013.
  33. ^ Kay, Allen (1968). "FLEX – A flexible extendable language". University of Utah MSC Thesis.
  34. ^ Fowler, Martin. "Memory Image". Retrieved 17 December 2013.
  35. ^ OpenSmalltalk/opensmalltalk-vm, OpenSmalltalk, 2020-11-03, retrieved 2020-11-08
  36. ^ "Slang". Retrieved 2020-11-08.

Further reading