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.
IndexDiscussionGeneral Discussion,  Status › New to Processing
Page Index Toggle Pages: 1
New to Processing (Read 1198 times)
New to Processing
Jul 8th, 2009, 10:51pm
 
Hi,

Can you please help me understand what is Processing?
Is it a Java library for graphics and animation? If yes, can I just download a jar?
Or
is it another language which runs on top of JVM (like Groovy on JVM)? If yes, why there are platform dependent downloads in Processing website?

Re: New to Processing
Reply #1 - Jul 9th, 2009, 3:25am
 
Yes.
Yes.
No.
Not really.
Because...

Now to be more verbose...  Cool
Basically, Processing can be seen as a Java library: some people just write Processing programs in Eclipse and are happy this way.
But Processing is a bit more than that: it offers a PDE, a kind of simplified IDE, that compile sketches (Processing programs) and run them, and offers some extra tools like generating bitmap fonts (.vlw files) and exporting a sketch to a .jar or a .exe (or .app perhaps, and similar depending on platform).
The latter (export capability) is probably one of the reason why there is a download per platform. And perhaps some other dependent code: in libraries\serial\library, I see a rxtxSerial.dll (but also a librxtxSerial.so, strangely, and lib\export has a skeleton.app which probably targets MacOS. So separation of system-specific binaries doesn't seem applied strictly...).

So, to answer the third question, you cannot "just download a jar" but you can download the full distribution and pick from there only the jars you need (core.jar at least, some libraries, etc.).

It is not "another language which runs on top of JVM", it is almost pure Java...
The devil is in the details. "Almost" means the sketches' source is pre-processed (parsed and slightly modified), to make a full .java file from the .pde files (adding a class <sketch name> extends PApplet around the code, a main() method, managing imports, adding F (float modifier) after all literal numbers with decimal points, changing 'color' keyword to 'int', and some other changes that aim to simplify writing sketches: after all, you can try a couple of lines in the PDE and run it without even saving them! Behind the scene, the PDE saves the file, process it, compile it and run it while capturing the outputs.
Not a real new language (like Groovy, Scala, Clojure, Fan, JRuby or JPython would be) but something slightly different from Java.

I hope I clarified some concepts (and that I didn't make mistakes...).
Re: New to Processing
Reply #2 - Jul 10th, 2009, 9:36am
 
Thank you very much for your detailed response.

Can you please help me with 2 more questions
1. Can I see/save the java file generated by PDE from my sketch file
2. Does PDE generated thread code from sketch? For example, does it generated 1 thread for painting, 1 thread for capturing user events?
Re: New to Processing
Reply #3 - Jul 10th, 2009, 11:45am
 
1. Yes.
2. It uses a thread to load the images in an asynchronous way, and has an animation thread.

About 1.: I find the processed source in
C:\Documents and Settings\PhiLho\Local Settings\Temp\build7500135345598307293.tmp
where PhiLho is my Windows user name and buildxxxxxx.tmp vary each time.
Location will vary with your system, but should be in your temp dir.
Page Index Toggle Pages: 1