Open main menu

CDOT Wiki β

Changes

Processingjs paper

153 bytes added, 11:30, 6 January 2011
DOM Integration?? (need a better header)
Processing.js is more than just a Processing parser written in JavaScript. It is designed in a way that connects the processing language with web technologies such as JavaScript, the HTML5 canvas element, JQuery, and various web services such as the flickr api. Furthermore, Processing.js is built in such a way as to allow easy integration of new technologies as they emerge.
Processing is Java based, and in order to make it work in the web, it has to be completely converted into JavaScript. Syntactically JavaScript and Java are actually quite fairly similar. However, and people have done in order to make Processing work like this before (googlein JavaScript however, java nes emulator to js nes emulator). Our unique we were faced with several challenges that were that we We had to do this dynamically, parse the processing sketch. The code had to be fully object oriented, . We had to provide support all native Java functions that are supported by Processing, and consider all . We had to take into account the differences between working with web like differencesresources vs local resources. Furthermore, like images having we also had to be pre loaded before consider how we can start processing would handle some of the code, casting fundamental differences between Java and JavaScript such as typed vs typeless variables, function overloading, and variable name overloading.
We could of done a straight up JavaScript port of the Processing language, but that would mean all Processing sketches written in Processing, would need to be rewritten in JavaScript. This way, all previous Processing sketches can simply be dropped into the web, and they will work. We took this one step further, allowing both languages to mingle as one. When we parse the Java into JavaScript, we don't break previously existing JavaScript, this means you can add JavaScript right into the Java, without having to declare that you are doing so. We simply ignore the JavaScript we encounter while parsing the Java, leaving it in tact. Not only do we allow mingling of the two languages, which is unique and powerful in itself, but also allows for sketches to be written in pure JavaScript. The advantages of this is we had a huge library of work to test and draw from right from the beginning.