Smalltalk80LanguageImplementation:Preface

From 흡혈양파의 번역工房
Jump to navigation Jump to search
Preface

Preface

Advances in the design and production of computer hardware have brought many more people into direct contact with computers. Similar advances in the design and production of computer software are required in order that this increased contact be as rewarding as possible. The Smalltalk-80 system is a result of a decade of research into creating computer software that is appropriate for producing highly functional and interactive contact with personal computer systems.


This book is the first detailed account of the Smalltalk-80 system. It is divided into four major parts:

Part One -- an overview of the concepts and syntax of the programming language.
Part Two -- an annotated and illustrated specification of the system's functionality.
Part Three -- an example of the design and implementation of a moderate-size application.
Part Four -- a specification of the Smalltalk-80 virtual machine.


The first part introduces the Smalltalk approach to information representation and manipulation. Five words--object, message, class, instance, and method-make up the vocabulary with which Smalltalk is discussed. These terms are defined and the syntax of the Smalltalk-80 programming language is introduced.


The second part of the book contains specifications of the kinds of objects already present in the Smalltalk-80 programming environment. New kinds of objects can be added by a programmer, but a wide variety of objects come with the standard system. The messages that can be sent to each kind of object are listed, commented upon, and illustrated.


The third part of the book is an example of adding new kinds of objects to the system. It describes the addition of an application to model discrete, event-driven simulations such as car washes, banks, or information systems. Some readers may find it useful to read the third part of the book immediately after reading the first part, referring to the specifications in the second part whenever the meaning of a Smalltalk-80 expression is not clear.


The fourth part of the book specifies how the Smalltalk-80 virtual machine can be implemented. This virtual machine provides object-oriented storage, message-oriented processing and graphically-oriented interaction. It is primarily of interest to readers who wish to implement a Smalltalk-80 system, or to readers who wish to understand the implementation of a message-oriented system in detail.


The Task of Book-Writing

Writing this first book about the Smalltalk-80 system was a complex task, partially due to the sociology of the system's creation, and partially due to the diverse kinds of information people require about such a system. We can divide the different reasons for the complexity of this task into four categories:

  • Smalltalk is a vision.
  • Smalltalk is based on a small number of concepts, but defined by unusual terminology.
  • Smalltalk is a graphical, interactive programming environment.
  • Smalltalk is a big system.


Smalltalk is a vision

In the early 1970's, the Xerox Palo Alto Research Center Learning Research Group began work on a vision of the ways different people might effectively and joyfully use computing power. In 1981 the name of the group was changed to the Software Concepts Group or SCG.


The goal of SCG is to create a powerful information system, one in which the user can store, access and manipulate information so that the system can grow as the user's ideas grow. Both the number and kinds of system components should grow in proportion to the growth of the user's awareness of how to effectively use the system.


SCG's strategy for realizing this vision has been to concentrate on two principal areas of research: a language of description (a programming language)which serves as an interface between the models in the human mind and those in computing hardware, and a language of interaction (a user interface) which matches the human communication system to that of the computer. Smalltalk research has followed a two-to four-year cycle: create a system embodying current understanding of the software needs; implement applications that test the system's ability to support these applications; and finally, based on the resulting experience, reformulate the understanding of software needs and redesign the programming language and/or the user interface.


The Smalltalk-80 system marks the fifth time through this cycle. The research is still in progress. We hope that presenting a detailed description of the current research results will contribute to the community working towards SCG's vision. The continued unfolding of the research means that the software system described in this book is literally a "moving target" and the information in this book represents only one station on a long track. Holding the train in the station long enough to write about it a book made the writing task complex.


Smalltalk has few concepts

Smalltalk is based on a small number of concepts, but defined by unusual terminology. Due to the uniformity with which the object-message orientation is carried out in the system, there are very few new programming concepts to learn in order to understand Smalltalk. On the one hand, this means that the reader can be told all the concepts quickly and then explore the various ways in which these concepts are applied in the system. These concepts are presented by defining the five words mentioned earlier that make up the vocabulary of Smalltalk-object, message, class, instance, and method. These five words are defined in terms of each other, so it is almost as though the reader must know everything before knowing anything.


Smalltalk is an environment

Smalltalk is a graphical, interactive programming environment. As suggested by the personal computing vision, Smalltalk is designed so that every component in the system that is accessible to the user can be presented in a meaningful way for observation and manipulation. The user interface issues in Smalltalk revolve around the attempt to create a visual language for each object. The preferred hardware system for Smalltalk includes a high-resolution graphical display screen and a pointing device such as a graphics pen or a mouse. With these devices, the user can select information viewed on the screen and invoke messages in order to interact with that information.


One way to present the details of the Smalltalk-80 system would be to start with the user interface and to describe each facility for accessing objects. Such a presentation might begin with scenarios of the ways in which the programmer might interact with the system. Each scenario would be a snapshot of a dynamic system. In a linear, static way, the book would try to convey the dynamics of multiple access paths to a large and diverse amount of information.


These aspects of the system are an important part of what Smalltalk provides as an applications development environment. However, in order to explain how this graphical user interface really works, the reader first has to understand the programming language. Thus, this book inverts the presentation of the system by starting with the language itself. Information about the system objects that support the user interface has been separated out and, except for the kernel graphics classes, is not presented in this book. Another book on the Smalltalk-80 user interface presents a detailed treatment of the implementation of these system objects (Smalltalk-80: The Interactive Programming Environment by Adele Goldberg).


Smalltalk is a big system

The Smalltalk-80 system is made up of many components. It includes objects that provide the functions usually attributed to a computer operating system: automatic storage management, a file system, display handling, text and picture editing, keyboard and pointing device input, a debugger, a performance spy, processor scheduling, compilation and decompilation. There are a lot of kinds of objects to learn about.


Smalltalk is built on the model of communicating objects. Large applications are viewed in the same way as the fundamental units from which the system is built. The interaction between the most primitive objects is viewed in the same way as the highest-level interaction between the computer and the user. Objects support modularity--the functioning of any object does not depend on the internal details of other objects. The complexity of the system is reduced by this minimization of interdependencies of system components. Complexity is further reduced by grouping together similar components; this is achieved through classes in Smalltalk. Classes are the chief mechanism for extension in Smalltalk. User-defined classes become a part of the system on an equal footing with the kernel classes of the system. Subclasses support the ability to factor the system in order to avoid repetitions of the same concepts in many different places.


Managing complexity is a key contribution of the Smalltalk approach to software. The early examples of the language are very simple, taken from the kinds of programming exercises common in many programming language books. This is so examples can be short, illustrating one or two points. The value of Smalltalk may not be apparent in these examples. After all, they can be done in other languages, and probably just as well. The value of Smalltalk becomes apparent when designing and implementing large applications, or when trying to make a modification to the system itself. For example, consider a dictionary, a frequently-used data structure in the Smalltalk-80 system. It is possible to design, implement, test, and install a new representation for dictionaries without in any way disrupting the running system. This is possible as long as the message interface upon which the functioning of other system objects depends is not destroyed.


The Smalltalk-80 system supports a number of interesting design tools, notably classes and instances as units for organizing and sharing information, and subclassing as a means to inherit and to refine existing capability. Combined with the interactive way in which the program development process is carried out, the Smalltalk-80 system provides a rich environment for prototyping new applications and refining old ones.


Writing a book about such a rich system means that some things must be left out. Again, we chose to omit in this first book the details of the programming interface and the way in which interactive graphical applications can be created. We focus on the language and the kernel classes of the system.


The Task of Book-Reading

This book takes for granted a certain amount of computer literacy on the part of its reader. We assume that the reader

  • knows why software systems are a good idea;
  • is a programmer or programming-language designer who knows at least one language well;
  • is familiar with the idea of expression syntax and of evaluation of expressions by an interpreter;
  • is familiar with sequencing of instructions in a computer, control structures such as iteration and recursion, and the role of data structures;
  • is concerned with the need to have better control of the representation and manipulation of information in a computing system; and
  • is seeking new ideas for how to create a software (application) system that supports the ability to express a software solution in a way that is closely associated with the natural expression of the solution.


Part of this book is for programmers interested in how to implement the language and its development environment on a particular kind of hardware system. Because of the variety of hardware systems on the market, the issue of "portability" has been emphasized. Portability means that only a small kernel of functionality must actually be created for each hardware system in order to realize a running system. This book provides an example of how to attain such portability.


Sharing the Credit

The Smalltalk-80 system is based on ideas gleaned from the Simula language and from the visions of Alan Kay, who first encouraged us to try to create a uniformly object-oriented system. The current embodiment of these ideas is the result of two related activities: research carried out at the Xerox Palo Alto Research Center, and cooperation with a group of stalwart participants in a project to review the research results.


In August, 1980, several hardware manufacturers were invited to re view the pages of our second attempt to write a book about Smalltalk nd its latest realization. Our first attempt described the Smalltalk-76 system and was abandoned in response to our desire to create a more portable system for distribution outside the Xerox research centers. Our second attempt was a book that was partially historical in nature, partially statements about a vision for personal computing, and partially functional specification for a new Smalltalk system. We thought we would entitle it Smalltalk Dreams and Schemes as a reflection of the dual purpose of our writing. The manufacturers who patiently reviewed our material were from Apple Computer, Digital Equipment Corporation, Hewlett-Packard, and Tektronix. These companies were chosen because they designed hardware systems. We hoped that, in reviewing the material, they would learn about our unusual software goals and would devote some time to the problem of creating hardware systems specifically for Smalltalk-like systems. We knew that hardware systems currently on the market, and even ones planned for the near future, would have insufficient power to support our goals. Instead of designing software to fit the hardware we could buy, we decided to try to get the hardware designed to fit the software we wanted.


The manufacturers assigned personnel from their research laboratories to the task of reading the second version of the book. This book has benefited from much discussion and hard work on the part of these reviewers. The early part of the book was completely rewritten as a result of their constructive criticism. The reviewers are responsible for our continuing to try to complete the distribution process and for our completing this book, but not for any faults in its ultimate form. Each set of reviewers implemented the system at least once in order to test our specification of the Smalltalk-80 virtual machine. The current specification reflects their careful review.


As authors of this book, we took responsibility for creating the written description of the Smalltalk-80 system. But credit for the creation of the system goes to all the members of the Software Concepts Group. To these people, we state our debt, our thanks, and our love. Dan Ingalls manages the overall systems design and development effort. Peter Deutsch on the Dorado, Glenn Krasner on the Alto, and Kim McCall on the Dolphin (also called the Xerox 1100 Scientific Information Processor), contributed expertise to the virtual machine implementations on the Xerox computers. User interface ideas, implementations, and management of the release process were carried out by James Althoff (user interface development), Robert Flegal (design of the graphics editor), Ted Kaehler (while laboring over virtual memory problems), Diana Merry (our text guru), and Steve Putz (version management). Peggy Asprey, Marc Meyer, Bill Finzer, and Laura Gould, in trying to keep their applications studies in pace with the system development, tested major changes. Copious reading of the manuscript at various stages of inception was done by Michael Rutenberg, Michael Madsen, Susanne Bodker, and Jay Trow. Editing assistance was given by Rachel Rutherford and Janet Moreland.


Chapter 18 on the Smalltalk-80 graphics kernel was revised from a paper written by Dan Ingalls for Byte magazine; Chapter 30 was initially written by Larry Tesler. Graphical images in Chapters 18, 19, and 20, were created by Robert Flegal (especially Figures 18.1 and 20.1), Dan Ingalls, and Adele Goldberg (especially Figures 20.2 and 20.3). Steve Putz offered valuable assistance in creating the images for Chapter 17. Images for the openings to Parts One and Two, and all images for the opening pages of Chapters 1 through 20, were created by Adele Goldberg. Images for Parts Three and Four, and all images for the opening pages of Chapters 21 through 30, were created by Robert Flegal. These images were created using the Smalltalk-80 graphics editor in combination with a low-resolution image scanner designed by Joseph Maleson.


To the participants in the review process, we also give our thanks. With them we have set an example of cooperative scientific exchange that we hope will evolve and continue to grow. Encouragement to begin this project came from our laboratory manager, Bert Sutherland. Reviewers and implementors were: from Apple, Rick Meyers and David Casseres; from Digital Equipment Corporation, Stoney Ballard, Eric Osman, and Steve Shirron; from Hewlett-Packard, Alec Dara-Abrams, Joe Falcone, Jim Stinger, Bert Speelpenning, and Jeff Eastman; and from Tektronix, Paul McCullough, Allen Wirfs-Brock, D. Jason Penney, Larry Katz, Robert Reed, and Rick Samco. We thank their companies and administrators for their patience and willingness to depart from industry standards, at least for one brief moment -- at Apple, Steve Jobs and Bruce Daniels; at Digital, Larry Samburg; at Hewlett-Packard, Paul Stoft, Jim Duley, and Ted Laliotis; and at Tektronix, Jack Grimes, and George Rhine. The folks from Tektronix prepared detailed reviews on audiotape, so we could not only see the errors of our ways, but hear them as well! It is our hope that this book and its companion will facilitate the distribution of the Smalltalk concepts in the computer community. If it succeeds, then that success is shared by us with our colleagues at the Xerox Palo Alto Research Center.


Postscript on the Production of This Book

The original text for this book was supplied to the publisher on magnetic tape. The tape included formatting codes identifying the various types of textual entity in the manuscript. The actual format of each type of entity was supplied by the publisher. This process worked smoothly thanks in large part to the efforts and patience of Eileen Colahan of the International Computaprint Corporation and Fran Fulton, our production editor, as well as the cooperation of Sue Zorn, Marshall Henrichs, and Jim DeWolf of Addison-Wesley.


Many of the graphical images that represent Smalltalk-80 screen graphics and the Part and Chapter artwork were printed on the Platemaker system developed by Gary Starkweather and the Imaging Sciences Laboratory of PARC. We would like to thank Gary, Eric Larson, and Julian Orr for making the Platemaker available to us.


Adele Goldberg
David Robson
Palo Alto, California
January, 1983


Notes