John Resig - Processing.js

2008/05/10/0401 by farkinga

RTFA: http://dev.jquery.com/~john/processing.js/

I’ve ported the Processing visualization language to JavaScript, using the Canvas element.

I’ve been working on this project, off-and-on now, for the past 7 months - it’s been a fun, and quite rewarding, challenge. The full scope of the project can be broken down into two portions:

The Processing Language

The first portion of the project was writing a parser to dynamically convert code written in the Processing language, to JavaScript. This involves a lot of gnarly regular expressions chewing up the code, spitting it out in a format that the browser understands.

It works “fairly well” (in that it’s able to handle anything that the processing.org web site throws at it) but I’m sure its total scope is limited (until a proper parser is involved). I felt bad about tackling this using regular expressions until I found out that the original Processing code base did it in the same manner (they now use a real parser, naturally).

This is a neat language I’ve watched for several years. This javascript implementation runs slow as hell in Firefox 2, but whatever - it’s still in development. The important thing here is that it works in javascript, whereas it previously required a browser plugin to play. This is definitely a cool step.

processing javascript

…in this image, you see a demonstration of the “classic” Substrate visualization.

 

Trackbacks

(Trackback URL)

close Reblog this comment
blog comments powered by Disqus