We closed this forum 18 June 2010. It has served us well since 2005 as the ALPHA forum did before it from 2002 to 2005. New discussions are ongoing at the new URL http://forum.processing.org. You'll need to sign up and get a new user account. We're sorry about that inconvenience, but we think it's better in the long run. The content on this forum will remain online.
IndexProgramming Questions & HelpIntegration › SketchPad: Yet Another Live Coding Applet
Page Index Toggle Pages: 1
SketchPad: Yet Another Live Coding Applet (Read 1505 times)
SketchPad: Yet Another Live Coding Applet
Aug 20th, 2007, 10:10am
 
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. Tongue

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?
Re: SketchPad: Yet Another Live Coding Applet
Reply #1 - Aug 20th, 2007, 10:33am
 
sounds nice. using janino i assume that it's java 1.5+ only? ... cause i get unsupported class version errors running 1.4.2.

F
Re: SketchPad: Yet Another Live Coding Applet
Reply #2 - Aug 20th, 2007, 12:14pm
 
Thanks for the catch -- for some reason, I can't set Java to run its Applets in 1.4.2 on my computer, so I always forget about this issue.

I fixed a few things and (briefly) verified it to be working on 1.4.2 now.
Re: SketchPad: Yet Another Live Coding Applet
Reply #3 - Aug 20th, 2007, 12:42pm
 
Very cool! I had no idea anyone else was working on this stuff, I just grabbed processing this weekend, and attempted my scripting project.

So I agree that there is definitely a need to support some type of "live coding" in processing. As a start obviously it should support the standard processing language syntax etc.

I think also there might be an interest in supporting other languages to write processing in (Haskell, Python, Ruby, Perl, Scheme, Lisp, etc...), and with JDK 6's support for scripting languages that would be very simple.

So perhaps as a first step towards that, we could look at what it would take to adapt the processing language to support the JSR 223 service provider script engine interface.

Script-engine project (supports tons of languages):
https://scripting.dev.java.net/

JSR 223:
http://jcp.org/en/jsr/detail?id=223
Re: SketchPad: Yet Another Live Coding Applet
Reply #4 - Aug 20th, 2007, 12:59pm
 
very nice! it's working on os-x 1.4.2.

F
Page Index Toggle Pages: 1