
Processing 2.0 will "compile" to JavaScript - jamesbritt
http://wiki.processing.org/w/Changes
======
jamesbritt
Some additional info to reduce some apparent confusion.

I learned about Processing 2.0 from here:

[http://www.creativeapplications.net/processing/generative-
ar...](http://www.creativeapplications.net/processing/generative-art-in-
html5-processing-javascript-tutorial/)

I already knew about the IDE modes; being able to generate an Android app
straight from Processing code is pretty slick (especially as you mix in stuff
like Pure Data) though it has some limitations.

The above link adds, "Processing 2.0 adds a third option, 'JavaScript', which
allows you to publish direct to HTML5 Canvas (using the now in-built
Processing.js). And it works. It just works."

The best Processing page I could find that included this was the changes page,
which also nicely lists other new features.

I picked the word "compile", in quotes, because while see as in fact
compiling, I also tend to think of compiling as taking a high level level and
outputting something lower-level. Though that's not a necessary condition, I
had a feeling that if I left off the quotes there'd be complaints about how
this wasn't _really_ compiling, title is misleading, etc.. But there you go.

edit: also, video: <http://vimeo.com/28117873>

------
wasabistudio
This could be useful. However, if this is done by using Processing.js, then
there are some gaps that need to be addressed. Last time I checked, the
JavaScript version does not support vlw fonts and loads fonts differently.
There is also the file IO that is not supported in PJS.

------
wccrawford
I can find nothing on that page that says it will compile to JS. I see a
sister project that appears to interpret Processing code in a browser, but
nothing about compiling to it.

~~~
Impossible
If you look at the modes section on the change list they mention that
processing.js will be a mode in the standard Processing IDE along with
standard and android. Up until now Processing.js has always been separate from
the official Processing release.

~~~
sylvinus
So there will be an "official" JS VM but there will be no actual compilation.
Title should be updated IMHO.

~~~
extension
My understanding is that Processing always "compiles" (or more accurately,
transliterates) to some other language -- originally Java and now JavaScript
as well.

~~~
scott_s
A source-to-source compiler is still a compiler, and it still _compiles_.
Transliteration implies that there is a one-to-one mapping between concepts in
the source language and the target language, which is rarely the case. (If so,
why bother with another language? Some of the languages which are a more
readable CSS may come close, but my understanding is that they still have a
few abstractions that don't exist in CSS.)

~~~
william42
The main case of transliteration I can think about is assembly language.

~~~
scott_s
Yes, good call, there is a one-to-one mapping between assembly language and
machine code.

------
daviddaviddavid
Lame title.

Saying that it will compile to JavaScript implies (or at least suggests) that
it will no longer compile to Java.

The page clearly says that JavaScript will be one of several "modes". C'mon.

