Running Processing with JavaScript

By • May 9th, 2008 • Category: Other news

Amazing: Processing, but running in JavaScript. John Resig has built a parser that works just like Processing, but instead of creating and compiling Java code, it creates JavaScript code that uses the Canvas feature of modern browsers to render the graphics. It actually creates a new HTML script type – application/processing – that is handled by the included parser. It’d be even possible to create an entirely online Processing IDE, making online testing pretty easy with zero applications needed (other than the browser).

Update: And because it’s so easy, people have actually ported the Processing IDE itself. There’s a XUL version of the IDE (to run it on Mozilla-based browsers, such as Firefox), and there’s a nifty editor here that’s more web-friendly (although the text editing itself is acting like crazy on my Firefox 3 Beta 5, so be warned).

Both those links come from this page, which has some interesting discussion about the topic. Although I somewhat disagrees with the author’s vision on Flash – I don’t think it’s a “market niche” that a canvas-drawing framework will replace; this to me is as incorrect as the comparison people usually draw between SVG and Flash – I do agree that there’s some hidden value indeed in running (most of) Processing within JavaScript. Let’s see what other nice things come out of it now.

Additionally, based on my script tests, Canvas drawing performance on Processing for JavaScript seems to be on par with actual Processing for Java performance, at least in regards to some repetitive 2d shape drawing. I can’t wait to see what happens when Tamarin is actually used in the next version of Firefox and ends up making it even faster.

Comments are closed.