So much for me thinking I've had a novel idea -- I've been working on this project for a few days, and lo and behold it seems like at least 3 others have accomplished similar things already!
Anyhow, I thought I'd (a) make this post to show the result of my efforts and (b) see if we can't start a discussion that may ultimately lead towards a well-supported, full-featured "live" processing applet.
Here's my stab at the problem:
http://www.andrewberman.org/projects/sketchpad/
(you will likely need to accept the signed security certificate. I don't intend to do nasty things to your computer, I promise!)
SketchPad can run the majority of PDE's bread-and-butter examples with little modification (mostly just adding in those little float "f"s that PDE lets you ignore). If I don't say so myself, I find it rather convincing.
The nitty-gritty behind the applet:
- Uses the Janino library for real-time class compiling, which means that once the new sketch is up and running there should be no slowdown versus a standard Processing applet (I think)
- It uses the BeanShell scripting system as a console interface, which lets you call methods or set variables at will (for example, you can setup() again whenever you'd like).
- Employs some Reflection tricks in an attempt to maintain "state" between updates of the sketches. There are some complicated rules behind this process, so I can't say it will always work, but it's a start.
The bottom line is this: I would love to see a stable, well-supported "Live Processing" applet become available, either through the efforts of the Processing community or as a part of the core development. Either way, I think that the even lower barrier to access can only be a good thing.
Any thoughts?