Distributed(ish) Smalltalk The code which is presented here is the result of a small experi- ment performed as part of my Phd development work. It builds on the sockets demo code which is packaged with Parc- Place Smalltalk VI2.2 VM1.1 [/usr/smalltalk/sockets] to provide a (not very robust) way of sending messages between two Smalltalk images which share a common 'C' server. The simple message passing supported is then packaged up in an easy to use way. The most interesting result of this is the abil- ity to created running (View and Controller) Tools on one machine which manipulate (Models) Objects on another. I can not stress enough that this is only a spin off experiment, but it is interesting to see the loss of speed which results from even this rather fragile implementation. I have never seen a real Distributed Smalltalk system, although I would be very interested to see one, not withstanding I would conclude from this experiment that any robust Distributed System built ontop of an existing Smalltalk implementation might be very slow ? The Code is in two Parts: The 'C' server and the Smalltalk Source. I do assume that you have access to the existing server code packaged with ParcPlace Smalltalk VI2.2 VM1.1 as I don't want to upset ParcPlace by sending a copy of their code out here. As it is server.c bears a remarkable similarity to myecho.c, and the counter example is adapted and given here. To create - compile 'C' code using makefile. open new image (st80). load in /usr/smalltalk/sockets/Socket.st and extra '.st' files using contents of 'loading' Then save resulting smalltalk image twice (Dist1.im and Dist2.im etc say). To run - start the server on a suitable machine. 'snap' each of the images on separate machines. Create the interface object. "InterfaceObject createSystemInterfaceObject". [during which the server address must be entered]. Create a 'real object' - perferably from a class which inherits from DistributableObject. Then either: Place as an entry in 'Smalltalk' (ie Smalltalk at: #name put: Object) in which case messages are sent in the form: InterfaceObject perform: message nonLocalId: #name. Or: Register object as distribted using: InterfaceObject distribute: Object as: #name. After which SystemInterfaceObject at: #name will return either a real object, or a surrogate object which will relay all messages to the other image. Finally two simple example tools are given. These are the Counter example (credit to ParcPlace) and the Dice example (credit to Manchester Uni). First create the interface object on each machine: InterfaceObject createSystemInterfaceObject. Then, On one machine enter: | temp | temp _ Dice new. SystemInterfaceObject distribute: temp as: #MyDice. DiceView openOn: (SystemInterfaceObject at: #MyDice) or | temp | temp _ CountHolder new: 0. SystemInterfaceObject distribute: temp as: #MyCounter. CounterView openOn: (SystemInterfaceObject at: #MyCounter) And then on the other enter: DiceView openOn: (SystemInterfaceObject at: #MyDice) or CounterView openOn: (SystemInterfaceObject at: #MyCounter) Alternative Examples: SystemInterfaceObject perform: (Message selector: #cursorPoint) nonLocalId: #Sensor (SystemInterfaceObject perform: (Message selector: #new) nonLocalId: #Dice) inspect As one last point my apologies to everyone who sent messages asking for detail of the Designer's Notepad, part of which was put on the net almost a year ago. The first papers describing the results of this work are only just starting to be published now. Neil Haddley I have made a couple of corrections to get things to work. One to this file - it is InterfaceObject createSystemInterfaceObject not SystemInterfaceObject createSystemInterfaceObject as Neil had posted. I have also corrected the C source for the server so that it will work. The posted version passed variables into the accept function, when what it needs is the pointers to the variables. Rhod