4 ms·
You can create new projects in C++, you can't create new projects using UI Cocoa, UIKit, or SwiftUI in C++ because those APIs are not in C++, because C++ is gen
by olliej 3y ago
You can create new projects in C++, you can't create new projects using UI Cocoa, UIKit, or SwiftUI in C++ because those APIs are not in C++, because C++ is generally bad as a language for APIs where ABI stability is important, but also seems to be particularly bad as a language for UI programming in general. The specific combination you get in Cocoa and UIKit is dynamic binding (requiring reflection) and developer subclassing of UI objects (causing aforementioned brittle ABI problems).
But Xcode does not care about exactly what your project is, and those are just starting templates. Most projects I have ever worked on are combination C++ and (UI language).
To me, you're using a very weird definition of what 1st class language support is. C++ is extremely heavily used, developed, and in invested in by Apple, and Xcode has extremely good and maintained support for it. It is not the language used for UI toolkits because C++ has proven to be bad at that task. Not applying the "everything is a nail" mentality to the C++ hammer is not "not a 1st class language" it's acknowledging one of the major deficiencies in the language.
Your final 'Apple documentation has the sentence: "Swift is intended as a replacement for C-based languages (C, C++, and Objective-C)."' comment is certainly reflective of what I think some people want, but the fact that the article itself is on the topic of Apple working on interop between C++ and Swift should be a pretty good indication that C++ support is such high priority that swift is the only language working towards full interop with native C++. rust, go, etc all just say "write a C bridge", the MS story is managed C++, etc.
Maybe in the future C++ won't be first class on the platform (probably good from safety PoV for all platforms), but that's not any time in the near future.
- deleted 3y ago[deleted]
- jb1991 3y ago> particularly bad as a language for UI programming in general. Interesting statement, considering how there are many popular and highly influential user interface frameworks in C++.