Smalltalk is a purely object oriented programming language (OOP) that was originally created in the 1970s for educational use, specifically for constructionist learning, but later found use in business.
It was created at Xerox PARC by Learning Research Group (LRG) scientists, including Alan Kay, Dan Ingalls, Adele Goldberg, Ted Kaehler, Diana Merry, and Scott Wallace.
In Smalltalk, executing programs are built of opaque, atomic, so-called objects, which are instances of template code stored in classes.
A relatively small number of objects, called primitives, are not amenable to live redefinition, sometimes being defined independently of the Smalltalk programming environment.
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".
The first Smalltalk interpreter actually implemented was for Smalltalk-72, and was written by Dan Ingalls in about 700 lines of BASIC in October 1972 for the Data General Nova.
Smalltalk-80 added metaclasses, to help maintain the "everything is an object" (except variables) paradigm by associating properties and behavior with individual classes, and even primitives such as integer and Boolean values (for example, to support different ways to create instances).
[13] Xerox only distributed Version 1 to Apple, DEC, HP, and Tektronix, but these companies were allowed unrestricted redistribution via any system they built.
VisualWorks is derived from Smalltalk-80 version 2 by way of Smalltalk-80 2.5 and ObjectWorks (both products of ParcPlace Systems, a Xerox PARC spin-off company formed to bring Smalltalk to the market).
As an interesting link between generations, in 2001, Vassili Bykov implemented Hobbes, a virtual machine running Smalltalk-80 inside VisualWorks.
During the late 1980s to mid-1990s, Smalltalk environments, including support, training and add-ons, were sold by two competing organizations: ParcPlace Systems and Digitalk, both California based.
The merged firm never managed to find an effective response to Java as to market positioning, and by 1997 its owners were looking to sell the business.
The open Squeak implementation has an active community of developers, including many of the original Smalltalk community, and was used to provide the Etoys environment on the One Laptop per Child (OLPC) project, a toolkit for developing collaborative applications Croquet Project, and the Open Cobalt virtual world application.
[citation needed] Virtually all of the object-oriented languages that came after—Flavors,[19] CLOS, Objective-C, Java, Python, Ruby,[20] and many others—were influenced by Smalltalk.
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.
Alan Kay has commented that despite the attention given to objects, messaging is the most important concept in Smalltalk: "The big idea is 'messaging'—that is what the kernel of Smalltalk/Squeak is all about (and it's something that was never quite completed in our Xerox PARC phase).
In Smalltalk, types such as integers, Booleans and characters are also objects, in the sense that they are instances of corresponding classes, and operations on them are invoked by sending messages.
[31] As with message sending Smalltalk-80 virtual machines optimize away the expensive use of contexts internally, providing the illusion and flexibility of a spaghetti stack without most its costs.
The remainder of the language, including control structures for conditional evaluation and iteration, is implemented on top of the built-in constructs by the standard Smalltalk class library.
And last but not least, blocks (anonymous function literals) The following takes two arguments and compares any two objects which can understand "less than", for example, numbers, and stringsBlocks are explained in detail further in the text.
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).
These allow mathematical and logical operators to be written in their traditional form: which sends the message "+" to the receiver 3 with 4 passed as the argument (the answer of which will be 7).
Because the meaning of binary messages is not coded into Smalltalk-80 syntax, all of them are considered to have equal precedence and are evaluated simply from left to right.
The following code demonstrates this: Blocks are also used to implement user-defined control structures, enumerators, visitors, exception handling, pluggable behavior and many other patterns.
This is typically assigned to a variable: However, it is also possible to send a message to a temporary, anonymous object: Smalltalk is one of the first systems to be based around an Integrated Development Environment.
If an exception results from a doesNotUnderstand:, or subclassResponsibility send, then the notifier will include a "Create" button, allowing the programmer to choose where in the receiver's hierarchy to define an "initial draft" of the method to be implemented.
Clicking on the Debug button opens the Notifier into a Debugger allowing inspecting the call stack and editing and continuing from any method activation.
Even the statement true become: false is valid in Smalltalk, although executing it is not recommended except for demonstration purposes (see virtual machine, image-based persistence, and backups).
Smalltalk programs are usually[citation needed] compiled to bytecode, which is then interpreted by a virtual machine or dynamically translated into native machine-code.
[42][43] The OS VM derives from the original Back-to-the-Future[44] (BTTF) Squeak interpreter implemented by Dan Ingalls, Ted Khaeler, John Maloney and many other contributors.