Smalltalk objectively

There was a time when the ability to write applications in Smalltalk was considered an accolade. Pre-2000, Smalltalk programmers were not only hired for their ability to write programs in a very popular programming language, but they were also reputed to possess a better-honed ability to design large applications using pure OO design principles.

Talking about Smalltalk usually involves talking about the beginnings of commercial programming; indeed, one could argue that programming as a profession started with the appearance of a programming paradigm that did not involve a conscious abstraction from underlying hardware, but used metaphors that were tested on 12-14 year-old teenagers. The Xerox PARC scientists who developed technologies as far apart as the first laptops (or "Interim Dynabooks", as they called them), object-oriented programming languages and windowing systems also had a deep interest in the psychology of creativity.

Object-Oriented Beginnings

Object-oriented programming had clear mathematical foundations in category theory, but appealed to an audience that was far larger than the usual ex-scientists and mathematics dropouts. The research groups at Xerox PARC developing all those technologies were extremely unusual characters and came from backgrounds that reflected much of the culture of the 60s: creativity had not been replaced by productivity yet, and programming languages were regarded as tools that helped people think.

The opportunities realized by object-oriented programming didn't become fully apparent until the arrival of Smalltalk in the early 70s. Like C, Smalltalk was developed by a small team in an industrial laboratory. Unlike C, Smalltalk was developed by the same Xerox PARC team that pioneered windowing systems, the mouse and an integrated approach to personal computing. C and Unix were driven by the need for an efficient multi-tasking operating system. Smalltalk was driven by the incipient personal computing revolution.

Today we tend to take object-oriented constructs like classes, objects, inheritance, polymorphism and data encapsulation for granted. Simula, a language created in Norway in the early 1960s, and Smalltalk, pioneered these concepts in an embryonic form, but Smalltalk became the canonical object-oriented language. It was not always so. Java and its class-based inheritance model co-exist with a C-based syntax that dictates particular control structures to the user. The 1970s and 80s users did not have this heritage to grapple with.

Meaning and Purpose of Smalltalk

Using Smalltalk does not just entail knowledge of syntax, semantics and object-oriented structures. Indeed, the division between an OO part of the language and the rest of Smalltalk would not make any sense. The class libraries, the IDE and the language form one inextricable whole. The underlying virtual machine hides the OS from the Smalltalk program and lets any Smalltalk programmer focus on design, modeling and coding. To speak of classes and objects is to speak of the very first concepts one has to understand before one ever gets to wield a keyboard to produce Smalltalk code.

The current version of Smalltalk is known as Smalltalk 80. It exists on a number of operating systems, including Linux, but most importantly, it is the purest expression of object-oriented design and its mathematical antecedents in category theory available on Linux today. The Smalltalk environment represents a link to a past when programming and creativity were seen as intrinsically linked.

When we talk about object-oriented programming, however, its origins lie in the history of big systems.

Simula was created to write software for oil-drilling platforms. It was meant to simulate large-scale problems using an approach that was more practical than Algol or its dialects. Today, much of the history of Simula and early Smalltalk have become part of the folklore surrounding software history, but it is still difficult to find an adequate account of programming history that makes the success of object-oriented programming understandable.

We are relatively lucky with regard to the historical position of Smalltalk, since one of its main creators, Alan Kay, happens to be extremely open, aware of the wider implications of his own work, and well-known among researchers in programming language design.

A new way to program

Kay had encountered Simula as a student, and soon realised that there were ideas he could use. He had been impressed by Engelbart's demonstration of a working windowing system in 1968. Even earlier, he had encountered Sketchpad, the first graphics-based interactive computing system ever built. There was no overarching cluster of ideas holding the various strands of computer architecture and programming language design together at the time, but it very slowly dawned on Alan that object orientation and the creation of graphical user interfaces were likely to hold the key to a future promising miniaturized, mass-manufactured computers. Intel was unknown, and integrated circuits were a fairly new technology. Anyone interested in what was to become Personal computing had to develop hardware and software components independently.

The Xerox PARC group, which had been founded in 1970, had begun to hire a number of young researchers who had fairly clear ideas where the future of computing was going. Although much of the research money at the time was still heading towards large time-sharing systems, Alan Kay et al believed accessibility and usability were going to be key.

Children and Adults

First and foremost, Smalltalk was part and parcel of the laptop computing idea. Laptops or "KiddiKomps" as they were called at the time were not only to be equipped with graphical user interfaces and the mouse (another well-known Xerox PARC first, even though the basic design for the mouse had been had been done at Stanford), but also with a programming language that should be usable by children, without sacrificing the power and generality of industrial strength programming languages.

To paraphrase Alan Kay, it was important that programmers should be able to avoid thinking like Turing machines. He was adamant that Smalltalk, although clearly an interpreted language, should be strongly typed. This might sound like a contradiction in terms, but we should not forget that dynamic late binding which is usually associated with interpreted languages does not automatically entail weak typing: the treatment of types is a separate matter.

Smalltalk Rationale

The basic ideas of Smalltalk from its 72 version onwards were fairly simple:

Everything is an object. This rule is to be taken literally. Every constant, class, message, variable and method is in some way to be taken an object. Classes are objects that represent instances of themselves.

Objects communicate by sending and receiving messages. This is a point which tends to create problems. Imagine an operator in C, like the plus sign or modulo. The operator would be considered a message which in turn would be sent to a number or string. This, of course, presupposes that unless we are talking about a unary operator, the message already holds an object before it is applied to another object.

Objects have their own memory. This sounds somewhat trivial today, but the notion that each and every one of Smalltalk's objects managed their own memory seemed revolutionary at the time.

Every object must be an instance of a class (which, in turn is an object). This rule implies that all classes have to be instantiated. Abstract classes are not possible with this approach and only single inheritance is implemented.

The class holds the shared behaviour of its instances. This rule eliminates abstract classes and forces implementations to be written for declared behaviours.

To evaluate a program list, control is passed to the first object and the remainder is treated as its message. This is the only rule that makes a part of syntax explicit. The previous rules imply that it does not really matter what kind of objects the messages are being sent to: polymorphism has been invented.

The revolution in programming paradigms had begun. True, some of the basics had been developed earlier. The British scientist Strachey's ideas on polymorphism predated Alan Kay's, but what is curious about Smalltalk is that syntactical considerations went almost completely out of the window. The complexity of Algol-derived languages, with which C and C++ are afflicted to some extent, has established the expectation in the programmer's mind that writing code almost always occurs while control structures and operators are part of the language used. Functional programming languages, of course, do not usually contain such elements, but object-oriented languages do not need explicit control structures either. It is perfectly possibly to send a particular message a predetermined number of times to the object in question without ever so much as mentioning keywords like "if" or "while".

Consequences

Object-oriented programming using Smalltalk had another side effect: multi-media capabilities became a lot simpler to design and code. Even the earliest reports of Smalltalk mention music synthesizers, painting tools, and video. Coupled with incipient Ethernet experiments, the researchers at Xerox PARC produced a strong brew - perhaps a bit too strong for the Xerox information technology managers of the time. Some attempts were made to kill the projects, but Smalltalk and Interim Dynabooks continued to be developed.

The fundamental difference that Smalltalk made did not necessarily come from rather obvious characteristics like polymorphism, encapsulation, inheritance and so forth. Alan Kay noted that all these can be imitated quite successfully using different programming languages.

What is decisive is the fact that all objects are fenced off against the outside world: they are all "first-class citizens" of the inheritance tree they inhabit. Other programming languages permit the user (or programmer) to weaken data encapsulation strictures. C++ is probably most famous for its "friend" classes that permit previously fenced-off data to be accessed by outsiders.

Simulation's why

It was important to realize that the Smalltalk group tried to prevent programmers from accessing or changing state information inside objects. Programmers were not supposed to rediscover the structure of a Turing machine: they were supposed to focus on the structure and function of the world they were supposed to model. In some ways, the original concepts of OOP in early simulation languages like Simula never entirely disappeared from sight. The objective was to find out how to program creatively, and to build new applications. As Stewart Brand said in 1974: "One informative place to inquire is among the hackers, particularly at night when they're pursuing their own interests". He was referring to Xerox PARC and its Learning Research Group (LRG), the group Alan Kay was a member of.

Smalltalk had an enormous influence on subsequent programming language design as well as the very notion of programming as a creative pursuit. Although it did not resemble any present and future programming language in its (very simple) syntax, its semantics had a permanent influence. The Smalltalk OO model set the trend for all other OO languages coming after it. Simula did some data encapsulation, but its version of object orientation was not as thoroughly thought out as the Smalltalk flavour.

More than Small Talk

But Smalltalk consisted of rather more than just a programming language and its libraries. The programming language was supposed to be the lowest level at which the user interacted with the computer. In the famous phrase of Dan Ingalls: "An operating system is a collection of things that don't fit into a language. There shouldn't be one." This saying has often been misunderstood as a statement that the operating system is a result of bad language design; of course, Ingalls was making an aesthetic statement - a programming language should make all facilities that are usually available in an operating system available to the programmer. Naturally, this is the dream followed by exokernel designs: almost all hardware facilities are open to the programmer.

In the end, though, the later versions of Smalltalk-80 became constructs that could easily be used by experienced programmers, not by children. At later stages, Smalltalk became a language for the industry rather than a tool enabling universal creativity. Class hierarchies and inheritance organized data and code sharing, but the direction into which Smalltalk evolved had a lot do with software engineering methodologies. The emphasis on communication as the major activity the computer was supposed to enable was lost.

Java is just an imitation

Nevertheless, Smalltalk, as opposed to Java, remained the yardstick by which all OO languages were measured. Java has replaced Smalltalk as the major pure object-oriented language, but the systems could not be any more different. Smalltalk's integration with its IDE is total: indeed, class browsers and documentation are part and parcel of the system. Smalltalk 76 had many of the classes and all of the main IDE features that we would take for granted. But unlike Java, it did not (and does not to this day) have to deal with the problems of having implemented a C-style syntax. At least, unlike C++, a class declaration is actually necessary within Java, in order to declare a method and get its implementation to work. Both languages favor single inheritance and both languages essentially adopted a virtual machine approach to give users an identical interface across platforms.

Where Smalltalk failed was the ease with which Java code could build on an existing base of previous C and C++ programmers. Smalltalk itself always took some getting used to, even though the language was a lot easier to understand than C++. There were no predecessors: Simula did not even have inheritance.

In the end, Smalltalk remained the province of computer scientists interested in programming for teenagers and young adults. Environments like Squeak and its predecessors, Self and Morph had a major impact on the way programming was taught at US universities.

Many other fields have been influenced by Smalltalk, not the least of which is the way GUIs are designed today: Smalltalk aimed to be a complete system and provided one of the first GUI systems anywhere. Operating systems were considered superfluous, although realities dictated that OS dependencies were taken care of. It is one of the true ironies of the Laptop and OOP revolutions that Xerox PARC had both within their grasp, but Sun Microsystems (with Java) and hardware companies made the money. The story is in many ways one of "if only" rather than "what if".


Alan Kay

A mathematics and biology graduate, he worked on almost all projects that spawned modern computing. While studying at the University of Utah, he helped build the first modern architecture that supported 3-D graphics. He was involved in ARPA projects leading to what we now call the Internet. But his multidisplinary approach to the creation of object-oriented programming, several programming languages and a whole new concept of personal computing marked him out among as a visionary and an excellent engineer.
Probably one of the first programmers ever to be called a "hacker", he led the Xero PARC research group for more than 10 years, before joining Atari in 1983 and Apple in 1984. Steve Jobs is said to have been inspired by the windowing system shown to him in a 1979 tour of Xerox PARC.

He joined Disney in 1996, a fairly logical move for a researcher whose main motivation was to enable children's creativity. He has often been called a child of the 1960s, with wild dreams and a gift for inspired leadership. Today, he runs the UN-funded Viewpoints research institute.

His list of rewards would fill a page in this magazine, and of course includes the ACM's Turing award. He is still involved in many research projects and was instrumental in the creation of Squeak, a multimedia-authoring environment delivering many of the promises made by the Smalltalk research group at Xerox.


The astonishing history of Xerox PARC

It is rare to be presented with a time and place in the history of technology that combined so much talent, vision, and success as the Xerox PARC Palo Alto Research Center. Founded in 1970, Xerox decided to set up the research laboratory in what was then a very sedate corner of Silicon Valley. The very term Silicon Valley had not entered common parlance yet and the decision to situate the facilities in Palo Alto was based on the proximity of engineering companies and world-class universities like UC Berkeley and Stanford.

Standard histories of computing emphasize the decision of Congress to move basic research in the sciences away from ARPA and let the NSF that was rather underfunded at the time handle the outcome. The decision did not quite work out the way it was intended. Industrial research laboratories picked up many researchers from a variety of universities, Xerox PARC being the most prominent.

Robert Metcalfe from MIT, the Ethernet inventor ended up working in Palo Alto, making Xerox Corporation the most wired company in the 1970s until Ethernet began to enter the mainstream during the 1980s.
Research in learning psychology was probably the most important overarching source of ideas supporting the work of Adele Goldberg, Dan Ingalls, Alan Kay, Bill English and other luminaries of early interactive computing. It is perhaps not appreciated today quite so much, but one of the great strengths of the research group was the strong interdisciplinary approach they were taking: happy to mine Leibniz' metaphysics for inspiration or reading Piaget to learn from his experiments with children, object-oriented programming was pioneered in the laboratory as much as the use of icons or the laptop. Of course, individuals outside the learning research group where most programmers worked were just as influential: laser printing was demonstrated in the early 1970s at Xerox PARC as well and wireless networking was being worked on throughout the 1980s.

It is perhaps astonishing that the group stayed together for more than 10 years. They were not averse to hiring the very same teenagers they had encouraged to try out Smalltalk to produce new applications. It is intriguing though, that the group was crucial in hardware as well as software innovation: the Alto, which we would see today as an office PC, had bit-mapped screens, a mouse and a windowing system. WYSIWYG text editing was standard and networking built in. It also cost US$18,000, a sum that - at least in 1973  - turned any dreams of mass marketing into a near-impossibility.


Frank Pohlmann


References

Smalltalk.org
www.smalltalk.org/main/

Alan Kay
www.smalltalk.org/alankay.html
 
Supporting the Smalltalk Community
www.whysmalltalk.com

GNU Smalltalk
www.gnu.org/software/smalltalk/smalltalk.html

Smalltalk design principles
http://users.ipa.net/~dwighth/smalltalk/byte_aug81/design_principles_beh...

Books about Smalltalk
http://www.iam.unibe.ch/~ducasse/FreeBooks.html

Alan Kay references
http://minnow.cc.gatech.edu/squeak/378




Comments

Four other things helped Java

You imply that Java surpassed Smalltalk because of the the C/C++ -style syntax. As a Smalltalk programmer in 1997 sho jumped ship to Java, I think you missed four other compelling things that Java added:

  1. Namespaces. I remember trying to include two external Smalltalk "modules" into a ParcPlace Smalltalk application. They both had a class by the same name. Since Smalltalk did not have namespaces, there was no way to resolve this without refactoring the name of one of the external modules -- which was difficult without...

  2. Strong typing. Sure Smalltalk was more flexible, but it also demanded much more runtime testing since you could send any message to any object. With strong typing came interfaces, which allowed for easier API standards.
  3. Packaging. At the time, Smalltalk applications were essentially a snapshot of the VM, including all the development tools. Packaging up a Smalltalk application involved judiciously ripping unneeded classes out of the VM while testing that the application was still stable. And with no strong typing, this was not necessarily an easy feat.
  4. Security Sandboxing. Sure Java as applets never really lived up to the potential (due to some FUD), but in 1997 the internet was new and Java was tied to it as an internet-designed programming language. This gave it a hype and interest that catupulted it forward.

Smalltalk experts has work-arounds for some of these issues, but they weren't built into the language design and so were not easily accessible to new or junior programmers.

The best quote I heard in those days from a Smalltak guru was:

    Java: All the elegance of C++ with the blinding speed of Smalltalk.

I agree....

with most of what you said. The article was not only meant to talk about Smalltalk, but also about Alan Kay's considerable input in this and other projects. This is why I decided to forgo talking about the design of Smalltalk or the (considerable) practical problems to deliver large Smalltalk applications.

I endorse your comment about Namespaces and the sandbox; strong typing comes with some baggage of its own, as you are likely to be aware.


Java, pure object-oriented language?


"Java has replaced Smalltalk as the major pure object-oriented language..."

Given Java's primitive types you cannot call it *pure* OO language. If you are not convinced try sending a message to value of type 'int'.


A question classes and types

A number of OO languages have primitive types you can't send "messages" to. It does not mean that they are less *pure* than other OO languages. Perhaps we shouldn't be too spell-bound by vocabularies and conceptual frameworks here.


Back to top