Processing (programming language)
Encyclopedia
Processing is an open source
Open-source software
Open-source software is computer software that is available in source code form: the source code and certain other rights normally reserved for copyright holders are provided under a software license that permits users to study, change, improve and at times also to distribute the software.Open...

 programming language
Programming language
A programming language is an artificial language designed to communicate instructions to a machine, particularly a computer. Programming languages can be used to create programs that control the behavior of a machine and/or to express algorithms precisely....

 and integrated development environment
Integrated development environment
An integrated development environment is a software application that provides comprehensive facilities to computer programmers for software development...

 (IDE) built for the electronic arts and visual design communities with the purpose of teaching the basics of computer programming
Computer programming
Computer programming is the process of designing, writing, testing, debugging, and maintaining the source code of computer programs. This source code is written in one or more programming languages. The purpose of programming is to create a program that performs specific operations or exhibits a...

 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
Benjamin Fry
Benjamin Fry is an American expert in data visualization, principal of Fathom, a design and software consultancy in Boston, MA, a co-creator of Processing, an open source programming language and integrated development environment built for the electronic arts and visual design communities with...

, both formerly of the Aesthetics and Computation Group at the MIT Media Lab
MIT Media Lab
The MIT Media Lab is a laboratory of MIT School of Architecture and Planning. Devoted to research projects at the convergence of design, multimedia and technology, the Media Lab has been widely popularized since the 1990s by business and technology publications such as Wired and Red Herring for a...

. 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
Java (programming language)
Java is a programming language originally developed by James Gosling at Sun Microsystems and released in 1995 as a core component of Sun Microsystems' Java platform. The language derives much of its syntax from C and C++ but has a simpler object model and fewer low-level facilities...

, but uses a simplified syntax and graphics programming model.

Features

Processing includes a "sketchbook", a minimal alternative to an integrated development environment
Integrated development environment
An integrated development environment is a software application that provides comprehensive facilities to computer programmers for software development...

 (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
Hello world program
A "Hello world" program is a computer program that outputs "Hello world" on a display device. Because it is typically one of the simplest programs possible in most programming languages, it is by tradition often used to illustrate to beginners the most basic syntax of a programming language, or to...

 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
United States presidential election, 2008
The United States presidential election of 2008 was the 56th quadrennial presidential election. It was held on November 4, 2008. Democrat Barack Obama, then the junior United States Senator from Illinois, defeated Republican John McCain, the senior U.S. Senator from Arizona. Obama received 365...

. Blue denotes states won by Barack Obama
Barack Obama
Barack Hussein Obama II is the 44th and current President of the United States. He is the first African American to hold the office. Obama previously served as a United States Senator from Illinois, from January 2005 until he resigned following his victory in the 2008 presidential election.Born in...

, and red denotes those won by John McCain
John McCain
John Sidney McCain III is the senior United States Senator from Arizona. He was the Republican nominee for president in the 2008 United States election....

. (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);
}
}

Design By Numbers

Processing was based on the original work done on Design By Numbers
Design by Numbers (programming language)
-Related Items:* Processing* Smile software...

 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
Wiring (development platform)
Wiring is an open source electronics prototyping platform composed of a programming language, an integrated development environment , single-board microcontroller documentation thoughtfully created with designers and artists in mind and a community where experts, intermediate and beginners from...

, which uses the Processing IDE together with a simplified version of the C++ programming language as a way to teach artists how to program microcontroller
Microcontroller
A microcontroller is a small computer on a single integrated circuit containing a processor core, memory, and programmable input/output peripherals. Program memory in the form of NOR flash or OTP ROM is also often included on chip, as well as a typically small amount of RAM...

s. There are now two separate hardware projects, Wiring and Arduino
Arduino
Arduino is an open-source single-board microcontroller, descendant of the open-source Wiring platform, designed to make the process of using electronics in multidisciplinary projects more accessible. The hardware consists of a simple open hardware design for the Arduino board with an Atmel AVR...

, using the Wiring environment and language.
Fritzing
Fritzing
Fritzing is an open source software initiative to support designers and artists ready to move from physical prototyping to actual product. It was developed at the University of Applied Sciences of Potsdam.- Goals :...

 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

In 2008, John Resig
John Resig
John Resig is an application developer at Khan Academy. He was a JavaScript tool developer for the Mozilla Corporation. He is also the creator and lead developer of the jQuery JavaScript library. This library's goal is to simplify the process of writing cross-browser JavaScript code...

 ported Processing to JavaScript
JavaScript
JavaScript is a prototype-based scripting language that is dynamic, weakly typed and has first-class functions. It is a multi-paradigm language, supporting object-oriented, imperative, and functional programming styles....

 using the Canvas element
Canvas (HTML element)
The canvas element is part of HTML5 and allows for dynamic, scriptable rendering of 2D shapes and bitmap images. It is a low level, procedural model that updates a bitmap and does not have a built-in scene graph.- History :...

 for rendering, 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
Seneca College
Seneca College of Applied Arts and Technology is a Canadian public college in the greater Toronto area. Seneca College is currently Canada's largest college with approximately 108,000 students.-History:...

 have taken over the project.

iProcessing

iProcessing was built to help people develop native iPhone
IPhone
The iPhone is a line of Internet and multimedia-enabled smartphones marketed by Apple Inc. The first iPhone was unveiled by Steve Jobs, then CEO of Apple, on January 9, 2007, and released on June 29, 2007...

 applications using the Processing language. It is an integration of the Processing.js
Processing.js
Processing.js is a JavaScript port of Processing, a programming language designed to write visualizations, images, and interactive content. It allows web browsers to display animations, visual applications, games and other graphical rich content without the need for a Java applet or Flash...

 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
Functional programming
In computer science, functional programming is a programming paradigm that treats computation as the evaluation of mathematical functions and avoids state and mutable data. It emphasizes the application of functions, in contrast to the imperative programming style, which emphasizes changes in state...

.

Processing in Clojure

clj-processing is a wrapper for Processing in the Clojure
Clojure
Clojure |closure]]") is a recent dialect of the Lisp programming language created by Rich Hickey. It is a general-purpose language supporting interactive development that encourages a functional programming style, and simplifies multithreaded programming....

 language, a Lisp that runs on the Java platform.

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.

Awards

In 2005 Reas and Fry won the prestigious Golden Nica award from Ars Electronica
Ars Electronica
Ars Electronica is an organization based in Linz, Austria, founded in 1979 around a festival for art, technology and society that was part of the International Bruckner Festival. Herbert W. Franke is one of its founders. It became its own festival and a yearly event in 1986. Its director until 1995...

 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
Integrated development environment
An integrated development environment is a software application that provides comprehensive facilities to computer programmers for software development...

 is licensed under the GNU General Public License
GNU General Public License
The GNU General Public License is the most widely used free software license, originally written by Richard Stallman for the GNU Project....

.

Processing's 'core' libraries, the code included in exported applications and applets, is licensed under the GNU Lesser General Public License
GNU Lesser General Public License
The GNU Lesser General Public License or LGPL is a free software license published by the Free Software Foundation . It was designed as a compromise between the strong-copyleft GNU General Public License or GPL and permissive licenses such as the BSD licenses and the MIT 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".

External links

The source of this article is wikipedia, the free encyclopedia.  The text of this article is licensed under the GFDL.
 
x
OK