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.
IndexSuggestions & BugsSoftware,  Documentation,  Website Suggestions › Is processing really a language
Page Index Toggle Pages: 1
Is processing really a language? (Read 2884 times)
Is processing really a language?
Jun 13th, 2008, 5:06am
 

If processing is a language I would expect to find a grammar
and a semantic description of the language components. But
all I can find in processing ( and wiring and arduino ) is set
of libraries or class files and headers for an existing language
( java or c ). Am I missing something?  Is it really a unique
language? Or just some IDE / libraries for existing compilers?

thanks.
Re: Is processing really a language?
Reply #1 - Jun 13th, 2008, 8:42am
 
Well, having a commonly accepted description is not a requirement for it to be a language. And IMHO, it is correct to call Processing a language.

I think Ben Fry described Processing as a "dialect of Java."  The grammar and semantic description of the language components can definitely be written, but probably not necessary because the language is based on Java, and thats one language that's been described to death (and you can write in Java as well and it will run as a Processing code).  

In faq (http://processing.org/faq.html), PDE is described as a preprocessor which converts it to Java code.  Yes, it is a language on its own, but is translated to Java. Also, you can't run Processing code without the translation.

Also, you can run alternate compilers for the same language, and Processing is not an exception.  PDE is an implementation of how Processing can be run, and it does use the commonly used Java compiler, but in theory you CAN write a Processing compiler if you want to.


I suppose the problem might be a bit more subtle:  What if you change the language rule a bit, e.g. Python's print statement is changed to "prn."  You can write a translator for it and make it run in Python interpreter, but did you really write another language?  Technically, I think so, but this brings up another question: how many people will actually use this language? So, I think the dialect is a very apt term for Processing because it is so similar to Java, but enough people uses it to justify it as a legitimate language. (You also don't have to destroy all similarities with another language to be a separate language.  Again, just because print "hi" will run in both BASIC and Python doesn't make them a same language.)

A language is a language and not its implementation, kind of like an English speaker is not English language itself.

I'm sure I could've just looked up my old programming language textbook and come up with a more succinct summary, but it's late and I don't have it with me. Smiley
Re: Is processing really a language?
Reply #2 - Jun 13th, 2008, 10:13am
 
I would say that Processing is a kind of Java slang :-p
Re: Is processing really a language?
Reply #3 - Jun 13th, 2008, 10:39am
 
I can be wrong, but Processing is essentially Java code wrapped up to hide some complexities of this language: the pre-processor adds common imports, creates a class around the code, adds the main() method.
Now, there is some little syntactic improvements, like the pseudo-type color (actually an int) and the Web syntax for colors (#rrggbb), and perhaps some auto-casts, although I am not too sure here.
So technically, it is less a new language than a good wrapper around an existing language, allowing an easier use, adding lot of useful functions, transforming an OO language to a procedural one while keeping door open for OO.
If you want to have a grammar for this "language", look at the .g files (grammar for Antlr) in the source: there is standard Java grammar and pde.g with overrides of the later.
Re: Is processing really a language?
Reply #4 - Jun 13th, 2008, 5:19pm
 
I still think dialect is about right (maybe slang works too), though I think it's hilarious that if we haven't documented it properly (or you haven't bothered looking through the source for the grammar) that you don't feel it's a language. It's a bit like saying a spoken language doesn't exist unless there's a dictionary that you're able to purchase.

Since this comes up every few months (in spite of it being in the FAQ), I'll add a bit more:

In Processing, we're talking about a dialect that we've added on top of Java to make things a little easier for a particular work domain (roughly, making visual things). There's also a programming environment that supports doing this kind of work by simplifying significantly from traditional IDEs. There's also a core API set (and a handful of core libraries) that we've built to support this type of work. If we did these in isolation, it's not that useful:

- The language changes are pretty minimal. The big difference is probably how they integrate with the IDE that's built around the idea of quickly sitting down and writing code (what we call sketching).

- The API set is a Java API. It can be used with traditional Java IDEs (Eclipse, Netbeans, whatever) and a Processing component can be embedded into other applications. But without the rest of it (the syntax and IDE), Processing (API or otherwise) would not be as widely used as it is today.

- The IDE is designed to make Java-style programming less wretched. check out the Integration board to see just how un-fun it is to figure out how classpaths, library paths, and embedding with AWT.

If pressed, perhaps the language itself is probably the easiest to let go of--witness the Python, Ruby and now JavaScript versions of the API, or the C++ version that I use for personal work (when doing increasingly rare C++ projects). And lots of people build Processing projects without the preprocessor and PDE.

But for as much trouble as the preprocessor and language component of Processing is (or as irrelevant it might seem to programmers who already code in Java), we're still not willing to give that up--damned if we're gonna make students learn about how to write a method declaration and  "public class Blah extends PApplet" before they can get something to show up on the screen.

I think the question is a bit like the general obsession of people trying to define Apple as a hardware or software company. They don't do either--they do both. They're one of the few to figure out that the distinction actually gets in the way of delivering good products.

Now, whether we're delivering a good product is certainly questionable--the analogy with Apple may end there. Wink
Re: Is processing really a language?
Reply #5 - Jun 14th, 2008, 12:21am
 
Just a little something to add to the above comments... above all I think what defines it for me.... is the environment....

I think the 'sketch' analogy is a brilliant one. The ability to just fire up the app, jot down some minimal code in a text editor to do what you want to do (no extending classes, registering event handlers etc.) and press run - without creating a folder, a project file, setting up includes, libraries - you don't even need to save the file. Just type in your code and run - just like the old days of ROM basic / assembly. Brilliant if you have an idea you want to try out and want to see results straightaway. Not that it actually takes a lot of time to save a project, create a folder, register your event handlers, set up variables to save the previous frames mouse position etc... but it does distract from the creative process - the same way you would do a quick sketches with a pencil on a napkin if need be, instead of getting out a laptop, booting up and doing it in photoshop. But at the end of the day, it has Java at the core, so you don't need to use it just for your preliminary sketch, but carry on developing as a fully fledged Java app.
Re: Is processing really a language?
Reply #6 - Jun 14th, 2008, 9:10am
 
I fully agree with memo.
That's why I, and otherwise good Java programmers, like Processing, beyond the facility to bundle useful libraries: it gives to Java the feeling to have an interpreted language, with the fast development/test cycle that lets the creative juice to flow.
Less plumbing, more fun...
Page Index Toggle Pages: 1