7 ms·
I love how Apple has somewhat come full circle on C++. There was a time they somewhat shunned the language publicly and highly discouraged anyone from using it
by jb1991 3y ago
I love how Apple has somewhat come full circle on C++. There was a time they somewhat shunned the language publicly and highly discouraged anyone from using it in apps. A lot changed a few years ago when they started dedicating WWDC sessions to new C++ language features. Really triggered my geek zone. That they are working hard to bridge these two languages is really good news and benefits everyone.
- pjmlp 3y agoThis is to ease migration from C++ projects into Swift. From Apple's point of view C++17 is good enough for their purposes. Metal uses a C++14 dialect, and LLVM requires C++17 currently.
- stephen_g 3y agoThey definitely have opened some things up, like a full C++ interface to Metal. I think the idea with this current effort is kind of the opposite though - not to encourage more use of C++, but to start writing new features of C++ projects in Swift (the presenter at the C++ Now 2023 talk [1] goes into this). I expect WebKit is a big target for them, I think they eventually want to replace all their C++ with Swift gradually (instead of trying to do ground-up rewrites, where you dedicate a team to doing that for years and you have a replacement at the end with fewer features than the old project). 1. https://www.youtube.com/watch?v=lgivCGdmFrw https://www.youtube.com/watch?v=lgivCGdmFrw
- pjmlp 3y agoDue to game industry pressure, although the Metal C++ bindings are a subset of Objective-C implementation. If you're want to have access to everything, Objective-C++ is easier. Where C++ reigns in Metal is being the shading language.
- londons_explore 3y agoI'm surprised they don't try to just push Metal/objective-c/Swift and other Apple tech onto windows and linux and make them the new de facto standard.
- astrange 3y agoSwift does run on other platforms. Though I don't know how it does on Windows. Metal on Windows would not help much because the GPU hardware is what's different.
- londons_explore 3y ago> Metal on Windows would not help much because the GPU hardware is what's different. A metal compatibility layer would encourage developers to start using it for games etc. Doesn't really matter if it performs a little worse - it just has to work.
- pjmlp 3y agoThey already use it, most middleware engines have Metal support.
- curling_grad 3y ago> Metal on Windows would not help much because the GPU hardware is what's different. Apple shipped Intel Macs with Intel/AMD GPUs until quite recently, so hardware might not matter significantly.
- FpUser 3y agoSure. And the rest of software developer's world is waiting in trepidation for Apple to tell them how to do things.
- pjmlp 3y agoWhy should they bother? Even Microsoft efforts with .NET are half hearted, with the goal to sell Azure, Windows and Visual Studio licences. Using .NET outside Windows means leaving behind several frameworks that will never be ported, a VSCode subpar experience vs VS (unless you buy Rider instead), relying on the community for GUI frameworks,...
- jayd16 3y ago
- nxobject 3y agoAs an aside, I do find it funny to think about presenting “successor languages” in a con that’s meant to showcase the vitality of the current languages. Call it CppNotForever, maybe.
- tialaramex 3y agoUltimately all of these conferences are for people. Languages don't attend conferences. If the audience at Goose Con thinks your talk about Hedgehogs is great, that's not the wrong talk for Goose Con. Maybe it means "Wildlife Con" is a better name, but, maybe that talk, on that subject, at that time, was perfect and there's no wider lesson.
- bluetomcat 3y agoSince switching to Clang more than 10 years ago, Objective-C, C++ and Swift are first-class citizens in the Apple development environment. You can mix Objective-C and C++ in mm files and it's a smooth experience in general. The actual language becomes less relevant when you have the same backend.
- szundi 3y agoInteresting how they started to do the same as Microsoft did back then - use the API from every language that matters and what Microsoft wanted to matter more.
- pjmlp 3y agoUnfortunately it didn't work that well on Microsoft side, due to the politics between DevDiv (.NET, VS, Azure) and WinDev (C++, Windows, XBox). That is how you end with COM stuff, C++ only SDKs, and .NET dev community having to implementing bindings ourselves.
- valty 3y agoThe Windows development ecosystem is such a mess. It's amazing how Apple never toyed with any managed runtimes this whole time.
- pjmlp 3y agoObjective-C and Swift are managed languages, hence their language runtimes. Being ahead of time compiled doesn't mean a language isn't managed. Rather automatic resources management, reflection, infrastructure for dynamic loading of plugins,...
- valty 3y agoWe're just arguing about the word "managed" now. ChatGPT says: Is objective-c a managed language?...Objective-C is not typically considered a "managed language" in the sense that languages like Java or C# are."
- coliveira 3y agoC++ was supported by Apple even before Swift. Objective-C had full access to C++ via a objective-C++ compiler mode.
- pjmlp 3y agoAnd by NeXT, which created it originally.
- meindnoch 3y agoStack traces indicate that a substantial portion of macOS libs are written in C++, e.g. CoreAudio.
- devwastaken 3y agoIt still is shunned. The only reason to use it is for compatability with existing code. Any new code written in C++ is already deprecated and will be an attack vector.