Phos: Drag and Drop Method Calls
So I did a small demo video of some of the new features in Phos that demonstrate some good old ideas from Randy Smith's work from around 1986. David Ungar gave a talk at Stanford where is explained a number of the concepts in Randy's Alternate Reality Kit. Anyways see what you can catch here:
- Load a remote object from the server using the Inventory
- Run that object's display() method
- Inspect the object by right click
- Modify the object by dropping a Block onto the message property
- Create new circle object
- Invoke the color(0,255,0) method of the Circle
- Invoke the radius(50) method of the Circle
- Add a down method by dropping the block onto the Circle's mirror object
- Drop a function that when we press a mouse button down on the circle it displays an Alert
- Change the method by dropping a new Block function that uses the Circle's message property
- Drop a message Block onto the Circle's mirror to add a message property
- Dropped a 'You Clicked a Circle!' Block onto the message property to set its value
- Added a up method that changed the circle's color to red when the mouse button raised over the Circle
- Invoked the radius message using the target's own radius that.rad + 10 to increment by 10
- Notice how the mirror's property values change as the Circle grows
- Since the Block get stuck over the circle, we send it an at(300,300) message to set its location
- We then shrink it using radius(that.rad - 20)
- To demonstrate how one can do animations, we repeatedly send the to(30,30) to move it 30 right, 30 down
- Notice how the x and y properties increment as we send messages!
What you get for 1kloc
The Next Generation Backend
The current backend server is a 40 line Plack server app that I run on Starman. The backend is going to get some love and have a few nice features:
- Remote Object Proxies - Load and invoke objects stored on other servers!
- Object Discovery Service - Think a distributed CPAN where everyone shares
- Auto Repository - Git integrated directly into the Inventory, with all versions of any object available any time!
- Web Socket Gateway - tunnel communications from in-browser objects to objects in another browser!
- V8 Engine - Integrating Google's V8 engine directly into the backend for live server side objects