David Reed gave a keynote at OOPSLA about Croquet and TeaTime. Croquet is a re-imagining of Alan Kayâ€™s seminal Dynabook vision, a vision which has influenced many aspects of modern computers and software. The Dynabook was a personal computing tool, while Croquet is envisioned to be a collaborative environment on the scale of the Web. I would call it â€œThe World Wide Dynabookâ€. I applaud the grandness of the vision: reinventing how we interact with the internet, all the way from the end-user interface down to the network protocols and the programming language. I found the hints about their underlying architecture to be tantalizing, but unfortunately I got little more than hints, even after reading their publications. I will review what I have learnt so far.
At the top level, Croquet is a 3-D collaborative virtual world distributed on the same scale as the internet. You can walk around, and see other people walking around, and interact in various ways. Portals let you warp between spaces, and interface to conventional 2D UIâ€™s as well as the existing Web.
Croquet is a mix of old and new ideas. Some of the old ideas are:
- 3-D Cyberspace. William Gibson popularized this in fiction over 20 years ago, but it hasnâ€™t come to pass. The reason, I think, is that Cyberspace just isnâ€™t Euclidean. Abstract concepts and information donâ€™t often map well into a flat multi-dimensional space. If you look at the actual data structures we use, or the code itself, the topology is highly non-Euclidean. Apart from Physics simulations and games, I donâ€™t see how 3-D adds much more than eye candy.
- A homogeneous language environment with run-time binding and dynamic typing leads to easier creation and adaptation of software. This is a defining belief among some groups, but I am not sure it is a universal truth. I think it has proven true within small communities of highly-experienced programmers, as in the â€œgolden ageâ€ of Smalltalk and Lisp. But it has failed to scale up to large communities of casual users. Being able to unplug anything and plug in something else is only useful if you understand the wiring, which in practice becomes infernally complicated and terribly fragile. Croquet essentially wants to scale a Smalltalk VM up to the size of the entire Web. I believe we do not yet understand how to sufficiently modularize software to make this practical. Croquet offers no breakthrough techniques of software composition: Squeak is merely warmed-over Smalltalk. Croquet seems predicated on the quaint belief that Smalltalk solved the problem 25 years ago, and the rest of the world just hasnâ€™t realized it yet.
One thing I like about Croquet is the idea that, to borrow a phrase, â€œthe network is the languageâ€. The Web can be better built as a single giant distributed VM for a language that is smart about distributed processing and security. Others have also proposed this, but Croquet is taking a very comprehensive approach. I am most interested in TeaTime, which is their model of distributed state and computation. It is currently a layer on top of Squeak, but Alan Kay is rumored to be working on a new language based on its semantics.
TeaTime radically unifies data and computation by reducing state to the history of communication. Objects interact solely be sending messages to each other. Objects do not have internal state. Instead, they record the history of all messages they have received. State is an illusion derived from the history of message receipts. Messages sends are a determinstic function of the history of received messages. This is an elegant purification of the original model of Object-Oriented programming, reducing it to the sequenced exchange of messages.
Distributed computation works by bending time. Groups of objects share local virtual clocks that timestamp their messages. A form of distributed deadline scheduling is used to sort out the messages into a globally serialized computation that does not violate causality or consistency. A 2-phase commit algorithm is used to limit how far out of step things can get, triggering rollbacks and retries as needed. The details of exactly how this works have not yet been published, and appear to still be under development. David Reedâ€™s speech was frustratingly vague and abstract. I am a little worried by the invocation of 2-phase commit, which is often ascribed powers it does not in fact have â€“ but that is another post.
I find TeaTime fascinating because it is a mirror image of my own ideas. Instead of reducing state to behavior, I am reducing behavior to state. The heart of Subtext is a model of structural variation, wherein action is replaced by versioning of states. Both approaches work by stepping outside of time and bending it to task. I am currently extending my initial model of simple branching time to allow merging, which I hope will support full-fledged concurrency and distribution. It will be interesting to see whether the result turns out to be a systematic dual of TeaTime.
Croquet and TeaTime are worth watching.