- Processing (programming language)
-
Processing Paradigm(s) object-oriented Appeared in 2001 Stable release 1.5.1 (May 15, 2011 )Typing discipline strong Influenced by Design By Numbers, Java, OpenGL, PostScript, C OS Cross-platform License GPL, LGPL Usual filename extensions .pde Website www.processing.org Processing is an open source programming language and integrated development environment (IDE) built for the electronic arts and visual design communities with the purpose of teaching the basics of computer programming in a visual context, and to serve as the foundation for electronic sketchbooks. The project was initiated in 2001 by Casey Reas and Benjamin Fry, both formerly of the Aesthetics and Computation Group at the MIT Media Lab. One of the stated aims of Processing is to act as a tool to get non-programmers started with programming, through the instant gratification of visual feedback. The language builds on the Java programming language, but uses a simplified syntax and graphics programming model.
Contents
Features
Processing includes a "sketchbook", a minimal alternative to an integrated development environment (IDE) for organizing projects.
Every Processing sketch is actually a subclass of the
PApplet
Java-class which implements most of the Processing language's features.When programming in Processing, all additional classes defined will be treated as inner classes when the code is translated into pure Java before compiling. This means that the use of static variables and methods in classes is prohibited unless you explicitly tell Processing that you want to code in pure Java mode.
Hello World
While the Java-like command
println("Hello World!");
is a valid Hello World program in Processing, the following code is a better example of the look and feel of the language.
void setup() { // define the window size & enable anti-aliasing size(200, 200); smooth(); // Set "ink" color, font, and alignment for rendering text. fill(0); // Black // setup the font (system default sans serif) textFont(createFont("SansSerif",18)); textAlign(CENTER); noLoop(); // draw() executes only once } void draw() { // Draw text to screen using the previously set font. text("Hello World!", width/2, height/2); }
United States presidential election map
The next example shows a map of the results of the 2008 USA presidential election. Blue denotes states won by Barack Obama, and red denotes those won by John McCain. (Note: this map does not show the Nebraska district in which Obama won an elector.)
PShape usa; PShape state; String [] Obama = { "HI", "RI", "CT", "MA", "ME", "NH", "VT", "NY", "NJ", "FL", "NC", "OH", "IN", "IA", "CO", "NV", "PA", "DE", "MD", "MI", "WA", "CA", "OR", "IL", "MN", "WI", "DC", "NM", "VA" }; String [] McCain = { "AK", "GA", "AL", "TN", "WV", "KY", "SC", "WY", "MT", "ID", "TX", "AZ", "UT", "ND", "SD", "NE", "MS", "MO", "AR", "OK", "KS", "LA" }; void setup() { size(950, 600); // The file Blank_US_Map.svg can be found at Wikimedia Commons usa = loadShape("http://upload.wikimedia.org/wikipedia/commons/3/32/Blank_US_Map.svg"); smooth(); // Improves the drawing quality of the SVG noLoop(); } void draw() { background(255); // Draw the full map shape(usa, 0, 0); // Blue denotes states won by Obama statesColoring(Obama , color(0, 0, 255)); // Red denotes states won by McCain statesColoring(McCain, color(255, 0, 0)); // Save the map as image saveFrame("map output.png"); } void statesColoring(String[] states, int c){ for (int i = 0; i < states.length; ++i) { PShape state = usa.getChild(states[i]); // Disable the colors found in the SVG file state.disableStyle(); // Set our own coloring fill(c); noStroke(); // Draw a single state shape(state, 0, 0); } }
Related projects
Design By Numbers
Processing was based on the original work done on Design By Numbers project in MIT. It shares many of the same ideas and is a direct child of that experiment.
Wiring, Arduino, and Fritzing
Processing has spawned another project, Wiring, which uses the Processing IDE together with a simplified version of the C++ programming language as a way to teach artists how to program microcontrollers. There are now two separate hardware projects, Wiring and Arduino, using the Wiring environment and language. Fritzing is another software environment of the same sort, which helps designers and artists to document their interactive prototypes and to take the step from physical prototyping to actual product.
Mobile Processing
Another spin-off project, Mobile Processing by Francis Li, allows software written using the Processing language and environment to run on Java powered mobile devices.
Processing.js
Main article: Processing.jsIn 2008, John Resig ported Processing to JavaScript using the Canvas element for rendering,[1] allowing Processing to be used in modern web browsers without the need for a Java plugin. Since then, the open source community including students at Seneca College have taken over the project.
iProcessing
iProcessing was built to help people develop native iPhone applications using the Processing language. It is an integration of the Processing.js library and a Javascript application framework for iPhone.
Spde
Spde (standing for Scala Processing Development Environment) replaces Processing's reduced Java syntax and custom preprocessor with the off-the-shelf Scala language which also runs on the Java platform and enforces some of the same restrictions such as disallowing statics, while also allowing more concise code, and supporting functional programming.[2][3][4][5]
Processing in Clojure
clj-processing is a wrapper for Processing in the Clojure language, a Lisp that runs on the Java platform.[6][7]
Processing Monsters
Processing Monsters is a project by Lukas Vojir intended to help people learn the language in an entertaining fashion. The "monsters" are simple graphical programs that are only black and white and are mouse reactive. As of May 3, 2010, there are 70 monsters featured on Vojir's site.[8]
Awards
In 2005 Reas and Fry won the prestigious Golden Nica award from Ars Electronica in its Net Vision category for their work on Processing.
Ben Fry won the 2011 National Design Award given by the Smithsonian Cooper-Hewitt National Design Museum on the category og Interaction Design. The award statement says:
"Drawing on a background in graphic design and computer science, Ben Fry pursues a long-held fascination with visualizing data. As Principal of Fathom Information Design in Boston, Fry develops software, printed works, installations, and books that depict and explain topics from the human genome to baseball salaries to the evolution of text documents. With Casey Reas, he founded the Processing Project, an open-source programming environment for teaching computational design and sketching interactive-media software. It provides artists and designers with accessible means of working with code while encouraging engineers and computer scientists to think about design concepts."
License
The IDE is licensed under the GNU General Public License.
Processing's 'core' libraries, the code included in exported applications and applets, is licensed under the GNU Lesser General Public License, allowing the programmer to release their original code with their license of choice.
Name
Originally, Processing had the URL at proce55ing.org, because the "processing" domain was taken. Eventually, however, Reas and Fry acquired the domain. Although the name had a combination of letters and numbers, it was still pronounced "processing". They do not prefer the environment being referred to as "Proce55ing." But, despite the name change, Processing still uses the term "p5" sometimes as a shortened name. However, they specifically use "p5" and not "p55".
See also
- NodeBox
- OpenFrameworks
- JavaFX
Footnotes
- ^ John Resig - Processing.js
- ^ http://technically.us/spde/About
- ^ http://technically.us/code/x/runaway-processing/
- ^ http://technically.us/code/x/flocking-with-spde/
- ^ http://processing.org/discourse/yabb2/YaBB.pl?num=1219975973
- ^ http://github.com/rosado/clj-processing
- ^ http://processing.org/
- ^ Processing Monsters, by Lukas Vojir
References
- Glassner, Andrew (August 9, 2010), Processing for Visual Artists: How to Create Expressive Images and Interactive Art (1st ed.), A K Peters/CRC Press, pp. 955, ISBN 1568817169, http://www.crcpress.com/ecommerce_product/product_detail.jsf?isbn=9781568817163
- Reas, Casey; Fry, Ben (June 17, 2010), Getting Started with Processing (1st ed.), Make, pp. 208, ISBN 144937980X
- Noble, Joshua (July 21, 2009), Programming Interactivity: A Designer's Guide to Processing, Arduino, and Openframeworks (1st ed.), O'Reilly Media, pp. 736, ISBN 0596154143, http://oreilly.com/catalog/9780596154141/
- Terzidis, Kostas (May 11, 2009), Algorithms for Visual Design Using the Processing Language (1st ed.), Wiley, pp. 384, ISBN 0470375485, http://www.wiley.com/WileyCDA/WileyTitle/productCd-0470375485.html
- Reas, Casey; Fry, Ben; Maeda, John (September 30, 2007), Processing: A Programming Handbook for Visual Designers and Artists (1st ed.), The MIT Press, pp. 736, ISBN 0262182629, http://mitpress.mit.edu/catalog/item/default.asp?ttype=2&tid=11251
- Fry, Ben (January 11, 2008), Visualizing Data (1st ed.), O'Reilly Media, pp. 382, ISBN 0596514557, http://oreilly.com/catalog/9780596514556/
- Greenberg, Ira (May 28, 2007), Processing: Creative Coding and Computational Art (Foundation) (1st ed.), friends of ED, pp. 840, ISBN 159059617X, http://friendsofed.com/book.html?isbn=159059617X
- Shiffman, Daniel (August 19, 2008), Learning Processing: A Beginner's Guide to Programming Images, Animation, and Interaction (1st ed.), Morgan Kaufmann, pp. 450, ISBN 0123736021, http://www.learningprocessing.com/
- Faludi, Robert (January 4, 2011), Building Wireless Sensor Networks: with ZigBee, XBee, Arduino, and Processing (1st ed.), O'Reilly Media, pp. 320, ISBN 978-0-596-80774-0, http://faludi.com/bwsn
External links
- Official website
- http://www.processingjs.org/
- http://www.processinghacks.com/
- http://www.openprocessing.org/
- http://www.processingblogs.org/[dead link]
- http://ejohn.org/blog/processingjs/
- http://groups.google.com/group/processingjs
- http://hyper-metrix.com/processing/docs
- Working with Processing and Arduino
- Website (german) to the book (soon in english) with nice source-codes and examples
Categories:- Animation software
- Computer graphics
- Java programming language family
- Object-oriented programming languages
- Cross-platform software
- Educational programming languages
- Free development toolkits and libraries
- Java platform
Wikimedia Foundation. 2010.