The future reinvented with Open CroquetBy Dafydd Rees
Squeak - Powerful multimedia authoring and programming for children
Why you should care
Is Object-Technology really in crisis?
Open Croquet can be likened to many things: a multimedia authoring environment, a programming system, a collaborative, distributed, three dimensional virtual environment and ultimately, system software for a new kind of machine. Open Croquet is an open source research project being developed by ViewPoints Research Institute VPRI in California. ViewPoints Research Institute is focused on improving education by enabling children of all ages to learn by interactively constructing models of complex systems.
Perhaps the first reason to take a serious interest in VPRI is the calibre of the participants. To name just a few: Doug Englebart inventor of the mouse, and major contributor to research on hypertext, Richard Dawkins evolutionary biologist, Adele Goldberg a major innovator in the field of object technology, Marvin Minsky and Nicholas Negroponte both leading figures at MIT, Seymour Papert a pioneer in the field of computer aided learning and the inventor of Logo and David Reed a major contributor to the design of the Internet. Even the late Douglas Adams is listed under the heading "advisor ethereous"!
VPRI is led by Alan Kay, a former researcher at Xerox Parc where he played an active role in many of the ideas that led to interactive, graphical, personal computing. In several recent talks Kay has suggested that the last thirty years in computing have been boring because few real innovations have been adopted by industry. He cites the fact that Linux, one of the hottest topics for many technologists, is merely a refinement of the Unix family of operating systems that have been around since 1973.
Kay blames this lack of innovation on the fact that most adults employ instrumental reasoning to evaluate and apply new ideas. This means that adults have difficulty evaluating new ideas because theyre carrying too many existing goals, and too much context to be able to see the full potential of new ideas. One way to overcome this problem is to work with children. Children wont know that something is difficult or that hundreds of papers have been published explaining the intricacies of some particular problem. They are more likely to experiment where adults would have given up, and to ask, "So what else can I do with this?"
Figure 1: A simple-looking e-toy that allows children to program by assembling little scripts by composing "tiles" together. "Wire up the car, so that it can be steered by rotating the wheel."
Croquet runs inside Squeak, which is a refinement of the Smalltalk-80 language developed by Kay and his team at Xerox in the late seventies. In order to better understand Croquet, we should first examine Squeak.
Unlike most programming languages, Squeak and its older brother Smalltalk-80 are conceived along the lines of system software for an entire machine. This follows from work in the sixties and seventies on Lisp machines and Smalltalk machines. The intention here is to create a seamless environment where there are no separate applications as we know them, merely clusters of software "objects" that cause things to happen in the machine by sending messages to other objects.
Since all these little fragments of software are organized by a common system, there is no special programming environment or build process. The programming tools are merely collections of objects in exactly the same way as the end-user software. This makes for a very powerful programming environment where programmers can simply "pick-up" running pieces of software and inspect the state of those objects as they run. This unusual approach means that programmers are always, directly modifying the environment in which they are working. There simply isnt any need to code, compile, link and re-run a program to see results. Changes become live as soon as they are entered at the keyboard.
Programming in conventional, file-based languages like C, C#, Delphi and Java is like creating a glass sculpture - where a small change means rebuilding the entire piece of work. Programming in Squeak on the other hand is more like shaping clay, where programmers get a productivity boost because they dont have a build process to worry about and can think fluidly thanks to direct feedback.
Squeak includes many multimedia features, such as painting tools, sound editing and animation software, and digital video support. These features have been packaged with a simple scripting language designed for children. On the face of it, this tile-language is simple, but in reality it is only a thin veneer over the Smalltalk programming language. Squeak has been used in primary schools to help teach scientific and mathematical ideas by exploring programmable multimedia.
Figure 1 above, shows a simple e-toy tutorial in Squeak where children are encouraged to write simple programs that drive a car object, by rotating a steering wheel object. The key tiles here spell out messages to the Car: "Car forward by 7" and "Car turn by Wheels heading //5". The script window itself is just another graphical object. What else could we use to steer the car? The program window is just another graphical object, so it has a size, position and heading. It turns out that driving the car by rotating the program itself is no more complicated: just replaced the "Car turn by Wheels heading" with "Car turn by Script Editors heading // 5". Rotating the script causes the car to move in the same direction.
Figure 2 - Metaprogramming for children: steering the car by rotating the program.
This is a simple step, yet in "enterprise class" professional programming languages like C, C#, Delphi and Java, this is unthinkable. Children, not having the context held by professional programmers working in established, commercial environments, wont appreciate why this should be difficult. This simple demonstration also shows how children can discover complex ideas by making things. Most professional programmers dont understand metaprogramming, yet it the basic idea can be discovered by playing with e-toys in Squeak.
In short, Squeak is a very powerful multimedia authoring and programming environment with an interesting history.
Figure 3: Editing some code and browsing the web. Im represented in the world by the avatar that looks like Alice in Wonderland. Ive put the mouse down on the board to move the "SystemBrowser: TeaProcessTest" window, and you can see this in the mirror looking at the black trail leading from my avatar to a point on the board.
The croquet team made these assumptions:
Figure 3 is a screenshot of someone reading the web and editing some Croquet code inside a Croquet environment. Users are shown in Croquet by three-dimensional avatars. Each Croquet session consists of a TeaParty in which many different users can interact at once. A TeaParty is a little like a game running on a Quake or Unreal Tournament server, because users can see each other and interact with objects is the same virtual environment. Perhaps the key difference is that Croquet is not a toy. The board, floating in mid-air on the right is in fact, a Squeak project, which contains a code editor called a browser, and the standard Squeak Smalltalk web browser called scamper. Should you wish, you could read your e-mail in these windows.
The classic Smalltalk-80 SystemBrowser in the window on the board shows some code that is running live in the system. Actually its some unit test that exercises code which synchronizes different TeaParty sessions. Editing this code in the bottom half of the green window and saving it would instantaneously apply that change to the Croquet environment. Many users could be in this TeaParty at once, so anyone in this TeaParty positioned to see the board, could see those edits and help by joining the programming session. Selections made on the board with the mouse are visible to other users as arrows streching from the avatar to the item being manipulated. In Figure 3, you can see Alice, my avatar reflected in a mirror. Shes selected the SystemBrowser for me, because Im moving the browser upwards. In the mirror, you can see a black arrow reaching from Alice to the SystemBrowser. Other participants will see the arrow, and will see the browser move on the board, in near real-time.
Most people collaborate using programs like Microsoft Windows terminal server that reproduces system-level drawing instructions so that a common screen can be shared. AT&Ts VNC program works in a similar way by sending changed bitmaps across the network. Note that Figure 3 shows the world as seen by Alice. Its unlikely that the Hare in the foreground of Figure 3 will be able to see the source code on that board at all from its viewpoint. Conventional programs like Terminal Server and VNC look like neat, system-level hacks that expose one graphical user interface view to another user across the network. Croquet presents a proper, user-based viewpoint model that stretches down into the core of the software.
Multiplayer 3D games normally use a server to synchronize the state of the virtual world. That means that all participants will be messaging a single server somewhere on the network. Network traffic will tend to gather around this server and cause congestion. This congestion ultimately limits the number of users able to share a single game.
Croquet by contrast uses peer-to-peer object replication. The state of the virtual world is computed by each client, rather than at a single, congested point on the network. If a client machine is too slow computing the next state of the world, that machine is ejected from the TeaParty. Synchronization is achieved using a new system called TeaTime. This system defines a shared, global notion of time, so that each participant observes the same state of the world. Browsing around in the source code reveals that shared objects are actually waiting for TeaTime to do their synchronization! In "Alice in Wonderland", it is always tea time!
To overcome network latency, shared objects participate in versioning, and can record a history of messages sent from an object at a particular time, so that multiple, different strategies can be used by objects depending on their application. Perhaps this synchronization framework is responsible for the noticeable echo that can be heard when you turn on the audio conferencing.
The story so far should inspire every technologist to ask the question - "Is there a much better way of doing this that I havent considered?" Children dont have our mental baggage, so perhaps we should let them help us innovate more often.
Some of the code in Squeak dates back to Xerox Parc in the seventies. Learning Squeak is interesting but it can also be quite frustrating. The literature is peppered with historical references and strange terms, for example: "click the red mouse button". Its quite curious that fragments of this old culture have survived this long. The only place youre likely to see an Alto workstation, complete with red, yellow and blue mouse buttons, is in a museum!
Really exciting open-source opportunities
In the late seventies, Apple Computer paid Xerox a substantial amount to get a glimpse of their research. One third of this work, the graphical user interface, inspired the personal computer revolution the other two thirds were networking and object-oriented technology. Today, the direct descendant of this work opens up a new direction in software system design and is being presented to the world, free of charge, with tutorials and documentation as an open source project http://www.opencroquet.org . Whereas many open source projects seek to recreate better versions of existing software, Croquet and Squeak present the opportunity to help invent the future.
Most open source work is done in C or C++, often using tools developed decades ago. Its too difficult for most people to download the source and build an open source project and those that could do it often dont feel they have the time or patience to do it. In the Squeak environment, there is no build process, and no long waits for recompilation, nor do you have difficulty jumping into a running system to find out what is happening. Programming happens at a much higher level of abstraction in Squeak Smalltalk. Due to difficulties with C and C++ most people see open source programming as a badge of hacker machismo. Old Smalltalkers, and the new breed of Squeakers can be forgiven for asking, "Why do you people keep torturing yourselves when theres a better way?"
Squeak is available from http://www.squeak.org
Interesting projects for parents, teachers and children of all ages using Squeak can be found at http://www.squeakland.org
ViewPoints Research Institute can be found at http://www.viewpointsresearch.org
Dan Ingalls, Ted Kaehler, John Maloney, Scott Wallace, and Alan Kay. The Story of Squeak, A Practical Smalltalk Written in Itself. In Proceedings of the 1997 ACM SIGPLAN Conference on Object-Oriented Programming Systems, Languages and Applications OOPSLA 97, pages 318--326, October 1997