3 ms·
Hmm, that explains the situation (native code is discouraged for most purposes) but doesn’t explain why they take that approach. There is also the security asp
by iainmerrick 3y ago
Hmm, that explains the situation (native code is discouraged for most purposes) but doesn’t explain why they take that approach.
There is also the security aspect, why they discourage the use of those languages for full blown applications.
Native code in apps doesn’t seem like a security problem on iOS, though?
- pjmlp 3y agoWhy do you think Swift was invented, and there is a Safe C dialect used on iBoot? Spend some time reading iOS security updates from Apple, lots of nice CVEs fixes reported there.
- iainmerrick 3y agoSwift compiles to native code. C and C++ are well-supported userspace languages on iOS.
- pjmlp 3y agoJava also compiles to native code on Android. Try to write an iOS application using only C and C++, instead of either Objective-C or Swift. "Swift was designed from the outset to be safer than C-based languages, and eliminates entire classes of unsafe code" -- https://www.swift.org/about/#features https://www.swift.org/about/#features "Swift is a successor to the C, C++, and Objective-C languages. It includes low-level primitives such as types, flow control, and operators. It also provides object-oriented features such as classes, protocols, and generics, giving Cocoa and Cocoa Touch developers the performance and power they demand." -- https://developer.apple.com/swift/#fast https://developer.apple.com/swift/#fast Some of the information related their Safe C dialect, https://discourse.llvm.org/t/rfc-enforcing-bounds-safety-in-c-fbounds-safety/70854 https://discourse.llvm.org/t/rfc-enforcing-bounds-safety-in-... "2023 EuroLLVM - Keynote: “-fbounds-safety”: Enforcing bounds safety for production C code" https://www.youtube.com/watch?v=RK9bfrsMdAM https://www.youtube.com/watch?v=RK9bfrsMdAM Finaly a recent gem from CppNow 2023, "Introducing a Memory-Safe Successor Language in Large C++ Code Bases" https://www.youtube.com/watch?v=lgivCGdmFrw https://www.youtube.com/watch?v=lgivCGdmFrw
- iainmerrick 3y agoThe only point I’m trying to make is that C and C++ are well supported on iOS -- they work out of the box with the standard dev tools and there are plenty of Unix system libraries (e.g. libcurl). On Android, C and C++ are very much second class citizens. I find that a strange decision.
- pjmlp 3y agoTry to ship an iOS application using only C, C++ and UNIX calls, without touching Objective-C or Objective-C++ in any form or fashion.