3 ms·
I still find Objective-C++ useful for writing MacOS apps that make heavy use of C++ libraries (e.g.; Eigen, OpenCV). The caveat is I have done a lot of Objectiv
by waynecochran 7mo ago
I still find Objective-C++ useful for writing MacOS apps that make heavy use of C++ libraries (e.g.; Eigen, OpenCV). The caveat is I have done a lot of Objective-C programming and Swift is still not as seamless as I would like bridging with modern C++ and the the STL.
- iainmerrick 7mo agoYeah, Objective-C++ is surprisingly great. It sounds like a terrible idea, but the bridging works pretty much seamlessly, and Obj-C and C++ don't actually overlap all that much so they don't step on each other's toes. Each language has strengths that shore up the weak spots in the other.
- delta_p_delta_x 7mo ago+1 to Objective-C++. It makes for some surprisingly clean, compact code, best of both worlds, really. And the bridging between ARC and CF types is really quite magical, more languages should have that ability to be expressed in an older language without stripping everything out. I just wish there were Objective-C bindings for more CF classes without having to mess with C.
- billti 7mo agoI've been playing around with low-level Metal a bunch lately, any many of their docs and samples seem still be mostly in Objective-C/C++ and not Swift, so have been forcing myself to get into it. At first I had the usual revulsion to the syntax, but after a few days getting used to it, I actually don't mind it at all now. (I still wouldn't say it's "elegant", but I can live with it). Being Metal shader code is basically C++ anyway, and C++ is a language I'm familiar with, having a couple of .mm files to hold the Objective-C++ for API bridging and working in regular .cpp (and .h) files for the rest is pretty straight forward compared to having to learn Swift. (Especially with all the complaints I've heard about its complexity, including from Chris Lattner himself lately, which aligns with some of the other comments here). Though to be fair, "Swift seems overly complex so use C++ instead" seems like a tough argument to make with a straight face ;-p
- pjmlp 7mo agoMetal is the last Mac OS framework that was fully done in Objective-C, however contrary to Microsoft, at least Apple does provide first class bindings to Swift. To this day, .NET is not welcomed on the Windows division, and they rather go out of their way producing stuff like WinRT/UWP with the outcome we all know.
- frou_dh 7mo agoObj-C++ was used for some hall-of-fame OS X apps, e.g. TextMate
- waynecochran 7mo agoI have my suspicion that it is still used heavily inside Apple. It especially caters to programmers that are control freaks like me -- you are a little closer to the metal (pun intended).
- favorited 7mo agoIt's not difficult to determine where different languages are used – you can run `symbols -noDemangling BINARY | grep _Z`, where BINARY is a path to any binary, and see how many symbols use Itanium C++ name mangling. You'll see it sprinkled in enough places to get an idea of which parts of the system use it more than others. Of course, parts of the Objective-C runtime are written in Objective-C++, so someone more pedantic than I might claim that fact alone counts as it being "used heavily."
- kridsdale3 7mo agoI made some camera and GPU-heavy features in the Facebook and Instagram app in ObjC++, and yes, it was nice to have that impedance match. I don't work there anymore, I wonder if they're using the C++ - Swift interop that now exists.