Friday, November 16, 2007

Processing, a language for visual output

It would seem that the computer science world is, in general, populated by firm believers in the idea that you can never have too many programming languages. I’ve covered all sorts of languages over the centuries I’ve been writing Gearhead and today I want to discuss a really cool language called Processing.

First I must comment that the only name that would have been worse for the language might have been “Language” or maybe “Program.” The authors sort of acknowledge this in the FAQ.


New! Watch this Network World Webcast - New Webcast: Policy Driven Personality Migration for the Enterprise

Anyway, to understand Processing you need to understand its predecessor, Design By Numbers (DBN). DBN was created by Professor John Maeda for a specific user community: Visual designers and artists. Maeda notes that “DBN is not a general purpose programming language like C or Java, but was designed to familiarize people with the basic concepts of computational media. Studying DBN is a first step to take – not a final step.”

Maeda cited the advantages of DBN as being free to use and multiplatform, easy to understand with a syntax that is designed for beginners, and immediately accessible on the Web.

As far as I can determine, with the release of Processing, the planned 2003 release of DBN Version 4 was abandoned and development stopped.

So, what is Processing? It is “an open source programming language and environment for people who want to program images, animation, and interactions … created to teach fundamentals of computer programming within a visual context and to serve as a software sketchbook and professional production tool.”

Processing runs on Windows, Mac OS X and Linux, and there are also projects to create a mobile version of the language as well as hardware developments that run close derivatives of the Processing language. The really cool hardware is based on an open source platform called Arduino that has a huge following and scores of subprojects. You can build your own Arduino boards or buy ready-to-run boards from a number of U.S. suppliers.

Underlying the Processing system is Java, so a prerequisite to running the integrated development environment (IDE) is ensuring Java is installed. On OS X Java is installed by default, but the Windows version of Processing includes versions both with and without a Java installer, depending on your circumstances.
Like DBN, Processing was designed primarily for the development of visual output. It consists of an IDE called the Sketchbook (also called the Processing Development Environment, or PDE), in which coding is done. You can enter code under multiple tabs to improve legibility, but there are complexities to this scheme that programmers need to be aware of. When the code is run the Display Window opens, showing the results.

A really great feature of Processing is its support for both 2D and 3D graphics and multiple rendering engines, which include Java2D (the default 2D engine), P2D and P3D (custom graphics engines for 2D and 3D rendering, respectively), and OpenGL (the best choice for 3D performance if you have a video card that supports OpenGL).

The beauty of Processing is that coding is simple and debugging pretty easy. There are libraries for sound functions, video capture and movie creation, serial port input/output, OpenGL functions, DXF and PDF file handling, XML functions and, yes, network services.

Finally, you can export Processing programs as Java applications, which makes Java development much easier. There are a lot of opportunities to use a language like Processing in the IT environment. Let me know what you think of it.


courtesy @networkworld.com

No comments: