4 ms·
Since 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
by bluetomcat 3y ago
Since 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,...
- jb1991 3y agoC++ is not first class on Apple platforms. The main APIs are only in Swift or ObjC. You can use C++ in your app, but you will need an actual first-class language to interact with the OS and UI.
- olliej 3y agoWell that’s a completely false statement. C++ is a first class language, and all C++ APIs and ABIs are stable. It is used extensively across macOS and iOS, and has large amounts of support through out the apple provided dev tools. Significant improvements to the C++ UX were part of the motivation for clang. C++ is not used for the majority of platform APIs because of all the problems, difficulties, and costs of ensuring ABI stability. C++ ABIs are notoriously fragile, which is a problem objc does not have, and swift was designed specifically to reduce ABI issues (that’s part of the reason generics are implemented as they are)
- jasode 3y ago>Well that’s a completely false statement. C++ is a first class language, I understand your clarification but gp (jb1991) is just using a different meaning of "first class" than you and gp (bluetomcat). For some people, a "first class language status" would also include examples such as: - C++ would be a menu dropdown choice in Xcode project options. In Xcode's "choose options for your new project", the only language options for "Storyboard"/"XIB" are "Swift" and "Objective-C". - C++ would be the programming language and API for Apple's VR headset ARKit. Instead, it requires Swift and SwiftUI. - C++ language would be prominently featured as the code examples in Apple WWDC developer conferences and presentations. E.g. go to WWDC sessions page and compare Ctrl+F search hits count for "C++" vs "Swift": https://developer.apple.com/wwdc23/sessions/ https://developer.apple.com/wwdc23/sessions/ Apple documentation has the sentence: "Swift is intended as a replacement for C-based languages (C, C++, and Objective-C)." -- from https://github.com/apple/swift/blob/main/docs/tools/swift.pod#:~:text=Swift%20is%20intended%20as%20a%20replacement%20for%20C%2Dbased%20languages%20(C%2C%20C%2B%2B%2C%20and%20Objective%2DC) https://github.com/apple/swift/blob/main/docs/tools/swift.po.... Understandable that some don't include the above bullets but just pointing out that's what "1st class language" means to others. Maybe it's a sign that the term "first class" is too ambiguous and just invites disagreements.