Re:I loved C. But it always fell short for me. Objective-C f...
by atnan on Monday November 07, 2011 @06:40AM
(#3205859)
This is why the graphics APIs are C.
Also, if you're calling an Objective-C method and dynamic dispatch is causing measurable performance issues, you can cache a pointer to the C function that backs the method (called the IMP) via the class_getMethodImplementation() runtime API.
Re:I loved C. But it always fell short for me. Objective-C f...
by tilltheis on Monday November 07, 2011 @07:36AM
(#3206014)
I tried MacRuby once a few months ago (https://github.com/tilltheis/fullscreenclock) and I have to tell you the Cocoa parts lacked some essential features (like correct syncing of Ruby and Cocoa setters).
But the nice thing about it is that you can intermix Obj-C and Ruby code freely to write the low level parts of your app in C/Obj-C if you want to. There is even a bridge between C/Obj-C and Ruby which enables you to call native functions from your Ruby code.
Re:I loved C. But it always fell short for me. Objective-C f...
by davedx on Monday November 07, 2011 @04:47AM
(#3205644)
I think the nature of OpenGL's API (internal state, very simple C-style functions - contrast with DX) means it is very portable. Java also interacts nicely with it, as does C++, and I've not worked with WebGL but the very fact it exists says something about it.
OpenGL is great. Really well designed :)
Re:I loved C. But it always fell short for me. Objective-C f...
by angersock on Monday November 07, 2011 @11:26AM
(#3206867)
OpenGL is a good API, but it's design is fairly terrible, and its implementations range from quirky to terrible (cosnider Intel's support for anything above 1.4).
The notion of internal state is fine and well for only the most trivial of programs--once you start doing something requiring multithreading nothing but sadness awaits.
So, there you go: Write your algorithms in C, write your program logic in Objective C. Oh, and I love how the OpenGL C API interacts so nicely with Objective C and Cocoa!
That said, I have a fair bit of experience with PyQt. I would ditch Objective C for something like MacRuby any day, but then I would (sorta) lose the ability to drop down to C if need be. (Still, does anyone have any solid experience in MacRuby? I would love to hear some!)