5 ms·
I have a somewhat different perspective to offer: C or C++ for components (effectively 90% of all code), a managed or scripted code (10%) for the glue. The rea
by Koshkin 8y ago
I have a somewhat different perspective to offer: C or C++ for components (effectively 90% of all code), a managed or scripted code (10%) for the glue.
The reason is that the modern C++ is perfectly suitable for high-level programming -- on par with Java, C# or Visual Basic. No "taming" is needed.
- pjmlp 8y agoTaming is necessary, because regardless of what you and me think about modern C++, there is a large crowd that still writes C with C++ compiler with total disregard for any kind of security validation tools. So the only way to prevent such security exploits is by preventing copy-paste compatibility with C, which C++ sadly cannot do without breaking backwards compatibility. You can see this happening across all desktop and mobile oriented OSes, where both C and C++ have been reduced to high performace low level OS layers, with userspace migrating to something else. Microsoft is the only vendor left on OSes for the consumer space that still cares enough to support C++ on their UI toolkits.
- saagarjha 8y agoApple supports Objective-C, which is arguably just as bad as C++.
- pjmlp 8y agoIt does, due to its NeXTSTEP legacy, but the roadmap is quite clear. "Swift is intended as a replacement for C-based languages (C, C++, and Objective-C)." Taken from https://swift.org/about/ https://swift.org/about/ "Swift is a successor to both the C and Objective-C languages." Taken from https://developer.apple.com/swift/ https://developer.apple.com/swift/
- saagarjha 8y agoI would be very surprised if Apple’s frameworks ended up becoming Swift-only any time in the next decade. While Swift is the spiritual sucessor to Objective-C, there is far too much Objective-C already written that would be costly to obsolete, even if Swift had the facilities to do everything Objective-C can (and, as I’m sure you’re aware, it is not at that point yet).
- pjmlp 8y agoSure, but that will eventually happen, even if they do just a couple of components per OS release. Launchd, dock were announced as rewritten at WWDC 2017, the new XCode build system and instrumentation at WWDC 2018, and it will continue little by little. Naturally it won't happen overnight, but Apple isn't known to endure Python 2/3 scenarios for that long.
- saagarjha 8y agoThose are not frameworks, those are apps that ship as part of the system. Apple has not and seemingly will not deprecate Objective-C for third party developers. They haven’t even rewritten any significant code in Swift, IIRC. Maybe parts of launchd?
- mnem 8y agoTimac analysed several MacOS and iOS versions for swift usage, and its growing through the system surprisingly rapidly for a language awaiting a stable ABI. Here’s the most recent analysis, which also links to others: https://blog.timac.org/2018/0924-state-of-swift-ios12/ https://blog.timac.org/2018/0924-state-of-swift-ios12/
- saagarjha 8y agoYup, I’ve read those and that’s what I based my statement on. Apple doesn’t seem to have rewritten any code in Swift “just for the sake of it”; they have slowly introduced it the in places they could to add new features.
- pjmlp 8y agoThey need to start somewhere. At WWDC 2017 they mentioned that launchd was fully ported. The video is available.
- icholy 8y ago> C++ is perfectly suitable for high-level programming -- on par with Java, C# or Visual Basic. No "taming" is needed. This is completely untrue.
- typon 8y agoThis is the "right" approach - speaking from experience after having tried both ways (10-90 vs 90-10). The general structure is that your application is built as a DAG with the nodes representing C++ functions (not methods on classes), with edges representing arbitrary datastructures (not objects), with the graph being constructed and hooked up in python and executed using a library like TBB