What do you think about processing for C/C++?

I am seriously considering working on a version of Processing for C/C++ using openGL for visuals and using the common Processing syntax. I think the obvious benefits would include: Greater speed, the abilities of a lower level language, and efficiency of programs etc... given this is a big challenge since C/C++ isn't as cross platform compatible as Java.

Comments

  • I think the obvious benefits would include: Greater speed

    Citation needed. How much faster would it be, exactly? Can you give us specific benchmarks?

    Keep in mind that Processing (Java/desktop Processing anyway) uses JOGL, which is just a wrapper of regular native OpenGL, so we're already using native code.

    the abilities of a lower level language

    What specific abilities are you talking about?

    and efficiency of programs etc

    Again, citation needed. What exactly do you mean by efficiency? Can you give us any benchmarks or real-life comparisons between Processing code and C++ code? How specifically would you utilize those differences?

    given this is a big challenge since C/C++ isn't as cross platform compatible as Java.

    Processing already requires native code, it's just hiding that from you.

    If this sounds like a fun hobby project to you, then by all means go for it, but I'm not sure what benefits it's going to give the typical Processing user.

  • isn't http://www.openframeworks.cc OF just this in a way...

    I have to agree with @digitalblueeye though that processing often is dissapointing when it comes to speed in a 3D realm.....

  • I have to agree with @digitalblueeye though that processing often is dissapointing when it comes to speed in a 3D realm.....

    But how would switching to C or C++ help that, specifically?

    Processing is already using JOGL, which is just a thin wrapper of native C code. What difference in performance are you expecting by eliminating JOGL?

    There won't be a noticeable performance difference, thanks to how thin JOGL is, but you're vastly complicating every single step of the process. You're going to write a Processing -> C transpiler? You're going to rewrite all the gui/display code in C?

    If it sounds fun, then go for it. But it's a much larger job than you're anticipating and has few if any benefits other than being fun.

  • +1 for OF.

    I wait for jai, once that is out I want to work on my own framework. Inspired by the things I like and dislike about processing and other programs.

    If you wan't to make processing for a faster language, it might be worth to check out fabric engine. They use a language ks http://fabricengine.com/

    KL is a simple but very powerful and highly optimized language that acts as the main interface to the Fabric Core. Anyone familiar with dynamic languages like JavaScript or Python will be comfortable with KL. It’s dynamically and JIT compiled, accessible and delivers performance comparable to C++.

    Fabricengine is worth checking anyway. It's really cool and has some things I wanted for years.

  • thanks mate!

  • Java also delivers performance comparable to C++, and the JOGL wrapper in particular will be pretty much indistinguishable from pure C++ code.

    The quality of your code is going to have a much higher impact on your performance than the language you choose. If there are particular things (drawing a polygon, for example) that seem slow in Processing, I doubt simply switching to C++ is going to make those exact same things faster. Instead, you have to look at the underlying code: maybe there's an optimization that could be done in the Processing code that would speed it up?

  • I strongly disagree that java delivers performance comparable to C++. However, I strongly agree with your note on quality.

  • edited September 2015

    yeah quality.....

    I mean compare a ibm 1970 mainframe with a iPhone 6

    I mean why hasn't software compilers made such a progress?!

    I'd expect a compiler to make slim code how matter what you throw at it

    Or it teaches you how to make it better

    Like Siri for programmers

    ;-)

  • I strongly disagree that java delivers performance comparable to C++

    Skipping over the holy war, and keeping it specific to Processing: Processing is, in terms of graphics, a thin wrapper of OpenGL. Most of your sketch's time will be spent in OpenGL, not in your Processing code.

    Whether that Processing code boils down to C code or Java code doesn't really change how much time you'll spend inside the OpenGL code.

    That's not to say there aren't any improvements to be made. But any improvements that you can make with a C wrapper, you can make to the Java wrapper as well.

    You don't automatically get improved performance by switching to C. You do get a codebase that's much harder to maintain, many more ways to shoot yourself in the foot, and much more work put on the programmer. That seems contrary to Processing's goals.

    It would make a fine personal project, but I wouldn't expect it to be the next Processing.js.

  • @KevinWorkman, you may be right about the speed differences. I think a nice benefit of c++ is not having to work about using the JRE or JDK. Also, using a C wrapper would mean more generalized code which is less efficient.

    There are the possiblities of using a C processing platform with: Unity (C++ based), Blender? The Raspberry Pi, Arm devices (Processing doesn't run well on the raspberry pi or other similar devices due to needing a good jre), Consoles? OS Creation?

    Now, Im not saying this would be strictly for visual things, I actually dislike that you can't run programs in the background and are forced to create only visual programs. I would add way to turn openGL on or off. Rather than this being a version of C++ processing, it would be a more like a Arduino/Processing Hybrid.

    I am by no means an expert, I'm just using the knowledge I have and just putting my ideas out there to see if there would be interest in such a (community based) project.

  • I would add in support for Arduino as well as a lot of MCU bootloaders and compatibility for many different Microchip and Atmel MCUs. Also, as far as I know, newer Android SDKs Support C++, So It would have the possibility of use for app development for both Android and iOS. All these options making for a very versatile and powerful IDE and platform

  • That's all well and good, but it's not a small job. If it sounds fun to you, go for it! But it's not a small undertaking, and I'm not sure how much of an audience you're going to find for it. If that doesn't deter you, then have at it!

  • @Chrisir I like that idea...

  • maybe not, But it would make a nice platform.

Sign In or Register to comment.