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 › Porting Processing to C++
Page Index Toggle Pages: 1
Porting Processing to C++? (Read 1770 times)
Porting Processing to C++?
Feb 9th, 2006, 12:40am
 
I've been playing around with c++ on and off for the past year or so, but after i found processing i havn't really looked at it.. mostly because processing is a new idea, and i love joining in on new (good) ideas ..

I started playing with c++ again this week, and suddenly i thought; "wouldn't it be possible to make a processing-ish language for c++?", and yes.. of course it would.. alot of work, but it could work..
Is there anybody who would be willing to give this a shot?
I'm more than willing to put in a lot of hours on this, but i still would need all the help i could get.


sincerely

seltar
Re: Porting Processing to C++?
Reply #1 - Feb 9th, 2006, 6:06am
 
It'd be a major waste of time, in my opinion.

You're not going to get much in the way of speed benefits.  You're better off going with the OpenGL engine than with c++, it'll give you a much higher speed gain.

Sure, it's possible, but there really aren't much in the way of advantages in this day and age.
Re: Porting Processing to C++?
Reply #2 - Feb 9th, 2006, 8:27am
 
The reason i want to do this is so people that have learned processing also have a more powerful (but still simplistic) language to deal with, that works sortof the same way.

And the advantages i can see are (real) win32 applications, which gives you alot to work with.

-seltar
Re: Porting Processing to C++?
Reply #3 - Feb 9th, 2006, 11:35am
 
You can make it easy to port your Processing sketches to C++ by mirroring the Processing API using OpenGL and glut, for example.  I did something along those lines for Processing ALPHA and converted quite a few sketches using only a few find and replace rules.  The code is old and tired though, and it would probably be easier to start from scratch.

Don't underestimate the things that Processing/Java makes easy - in C++ you'll need a separate library for loading images, generating sound, doing threads, networking, loading from a webserver, etc. etc.

If you want to move over for graphics performance reasons, you'll probably have more luck translating what you've learned from Processing and using OpenGL directly - there are lots of existing tutorials and sample code, and if you're hitting the boundaries of Processing then maybe it's time to make the jump.

However, I'd be more interested in seeing a move to higher level languages (e.g. Python, Ruby) that the other way around...
Re: Porting Processing to C++?
Reply #4 - Feb 9th, 2006, 4:14pm
 
seltar,
It's good to be ambitious? Although I have to agree with others' comments thus far. Besides, there is still so much to be done with Processing–all that ambition would probably be of some assistance to Ben and Casey Wink

That being said, I understand the need to explore a vision. Are you familiar with panda3D? I've been team teaching a course this semester on video game programming using panda.

Panda was built with C++ and has a python scripting front-end that purports to simplify the game development process. It was built by teams of developers at Disney and now Carnegie Mellon (not a bad talent pool.) The panda library is massive and (very) poorly documented, which I think is largly due to the insane amount of work required to pull this off. Anyway, it's probably worth a look, as it does present one vision of a simplified graphics framework for c++. if you're not familiar with it. There's also an active board, with current developers–who might have some interesting suggestions. http://www.panda3d.org/forum/index.php

I suspect when ben and casey first conceived of developing processing, we all could have come up with many good reasons for them not to go for it (remember applets died a long time ago.) So don't let us deter you!
ira
Re: Porting Processing to C++?
Reply #5 - Feb 9th, 2006, 5:59pm
 
i think zach lieberman is doing something in that way. If i'm not mistaken, his project Ink and C++ for dinner is a processing-ish approach to C++. I don't think he is porting the language but the concept of an artists-students' friendly syntax...

Unfortunately I'm not able to find any reference online, but i've seen zach arround here some times so maybe he could explain it better.
Re: Porting Processing to C++?
Reply #6 - Feb 9th, 2006, 8:53pm
 
Thanks for all the answers!
irag:
I actually downloaded panda yesterday, so I'm installing it as I type, and I'm giving it a go Smiley

I'm actually a game-developer student, so this is perfect for me. I did one year in denmark, but i didn't feel that I learned anything, so I changed to a school back in norway, which is even worse.. at least this year, since it's collective for all the classes, but next year the game-developing will start up again Smiley

and back to the processing-porting stuff:
i've mirrored some functions, just for the ease, and i guess i'll expand it as i need it.. Smiley

but thanks again for the answers.. put things into perspective Smiley

-seltar
Re: Porting Processing to C++?
Reply #7 - Feb 10th, 2006, 8:23am
 
Heh... seems like many of us are moving on to C++ lately...

I myself have been (re)learning C++ and learning openGL. When I first started, I immediately wrote a library that mirros the Processing API which I am already very comfortable with.

So far I have a custom lib that acts as a bridge between Processing and C++ in terms of usability and code writing (much like TomC's I bet!). It does things like setup(), draw(), mousePressed() and has other very processing-like features. The point is not meant to be a full processing port, but a learning tool for myself to slide easily into C++.

It's just a pet project of mine. Gave it a fancy schmancy name: Chimera, from which it is an animal composed of many other animal parts... :]

Maybe when it grows more useful I'll share it. Right now it is in its infancy.

So to answer your question, yes it's possible and rather easy. The biggest hurdle is understanding C++ classes, pointers, garbage collection, and openGL's way of initializing windows, function pointers, etc.

Once that is out of the way, you can start writing function wrappers (or even #defines) to mock-up a processing-like API.
Re: Porting Processing to C++?
Reply #8 - Feb 10th, 2006, 4:44pm
 
I think the natural flow of things would be learning Java more seriously, understanding what the Processing API does and generally practicing good programming. Then, when you got a steady grip on Java and software design in general, you can move on to C++. I know alot of people start learning C++ just because it's supposed to be THE language or something, while really, it hurts their understanding of how a good program should be designed, because they get so bogged down in C++ quirks.
Page Index Toggle Pages: 1