This research framework provides a multithreaded vm for a secure, distributed object implementation. Messaging is asynchronous with eventual sending and an eventual message send will return a "promise", which will resolve itself into the result once it is computed. Messages to objects in other threads, called Vats, will be eventual, preventing deadlock.
Here is the Chat Client release. You can see in the plan what has been done (or skipped). This zip contains the sources, the image/changes and a Windows VM (other platforms will have to build their own. If you do, send it to me and I'll post it.). It is ready to be dropped into a directory of your choosing, unzipped and run.
Installation
After unzipping the zip file, run the image with the supplied VM.
Configure
The tricky part is setting up the networking code so that others can connect to you. Every image is a server, in this peer to peer system. If your machine is behind a router, then you will need to specify the external ip address to your router, and make your machine the DMZ. I don't currently support host names, but that is next on the list.
To configure your network settings, there is a #squeakelib page in the Preferences Browser. Go there and there are three settings.
Automatically update your ip address. This is useful if you are directly connected to the internet and use DHCP. Everytime the image starts up, it will recalibrate to the current ip address. Don't use this if you are manually setting your ip address, below.
Manually set your ip address. If you are behind a router, find out it's external ip address and enter it here. This way, references to objects that you send out will be resolved to the router. Also make your router pass through to your machine as the DMZ.
Manually set your port. This will override the default, which is 11061.
Running EChat
At the top of the window, there is a button which says: 'SqueakElib Chat Launcher'. Click this button. It will prompt you for a nickname. Then the launcher window will open. There are two List panes. The top one is for other users. The bottom pane is for multiway chats. In the top pane you will see a list of the other users signed on. You can right click and select 'open chat' to start chatting with the other user. In the bottom pane, you can create a multiway chat and start chatting. Or you can select an existing multiway chat and join it and start chatting.
The Plan
Phase 1, Done Get all msg sends to be interceptable by the SqueakElib promise framework. This includes things that have been macro transformed by the Compiler, like #ifTrue:, #ifNil:, #whileTrue:, and so on.
1.1 (done) Revive old SqueakElib code
1.2 (done) Split SqueakElib-Base and SqueakElib-CapTP
1.3 (done) Change Compiler to emit Macros that will be inline for the correct classes of objects, or a real msg send for other classes, so we can intercept those msg sends.
1.4 (done) Implement new bytecodes (IsIntegerTest, IsBooleanTest, IsBlockTest, NotEventualTest) and new extraLongJump bytecodes
1.5 (done) Implement larger Contexts
1.6 (done) Fix InterpreterSimulator for Squeak 3.10
1.7 (done) Resolve VM crashing (due to new extraLongJump bytecodes?)
Phase 2Done Reintegrate CapTP
2.1 (done) Load code
2.2 (done) Migrate to use new ERefs, Resolvers and Handlers
3.3 Propogate partition to switching ProxyRefs to DisconnectedRefs
3.4 Support persistent Vats: Read/Write VatIdentity, Encrypted VatUser, Persist Introducer and SwissTable.
3.5 Clean out the swissTable and ensure we keep persistentObjects registered with the correct swissNumber
3.6 Figure out a solution to using promises as keys in a Dictionary or any other situation where the hash of the promise changes to the forwarded hash of the near ref. Can we rehash the Dictionary?
3.7 Figure out identities by swissNumbers/swissHash/swissBase
3.8 Source Code highlighting of combined Macro code
3.9 ETrader
Phase 4 Integrate with Exupery.
Phase 5 is to allow all primitives and bytecode methods to have a promise as an argument. The plan is to stop short the primitive call and send the excapsulated primitive call to the promise(s) as part of a whenMoreResolved call. When the promise resolves, the primitive call will be made. QoS can be satisfied by joining the promise with a timer, such that if the promise does not resolve in xxx milliseconds, it will become broken and the primitive call will "fail".
5.1 (skip) Implement the capability to call a primitive with a NearRef - detect a NearRef arg and replace it with the NearRef's target.
5.2 (skip) Protect primitives from having an eventual ref as an argument. If an eventual ref (Promise, FarRef) is found, schedule a timed promise to call the primitive if the eventual ref resolves to a NearRef. Return the Promise as the result of the initial Primitive call.
Phase 6 Integrate SqueakElib with the Multi-threaded VM. In this model, references to objects in other Vats will be VatRefs (a form of a FarRef) and msgs will be serialized to the other Vat (reassigned the VatID in the same shared ObjectMemory, or copied to a different but co-located ObjectMemory).
6.1 Implement VatRefs and their management: allocate in a Vat, relocate from one Vat to another Vat. GC implications for VatRefs (RememberedSet?)
6.2 Reimplement Vat as a ProcessScheduler. Figure out what to do with classical Processes and Semaphores in the image. Do we really want pre-emptive Processes? How do we deal with infinite looping? I/O Events?