It's not exactly what I would call "hostile", language-wise. Swift, on the other hand, might be a bigger barrier...
Android Framework on the other hand is not great in this department. Practically speaking it’s just Java and Kotlin. I wish I could write Swift there because even if Kotlin is similar syntactically the JVM baggage can be irritating.
There's about a billion things about developing on Android that are absolutely miserable. HLL-induced perf bottlenecks aren't usually one of them.
I don’t really understand why the Android team haven’t made it easy to call any Java API from C, with auto-generated bindings or some such.
I think they just don’t believe in apps using native code, beyond the special case of games (note that pretty much all the native APIs are to do with low-level graphics and sound).
"The Android NDK is a toolset that lets you implement parts of your app in native code, using languages such as C and C++. For certain types of apps, this can help you reuse code libraries written in those languages."
-- https://developer.android.com/ndk
"The NDK may not be appropriate for most novice Android programmers who need to use only Java code and framework APIs to develop their apps. However, the NDK can be useful for cases in which you need to do one or more of the following:
- Squeeze extra performance out of a device to achieve low latency or run computationally intensive applications, such as games or physics simulations.
- Reuse your own or other developers' C or C++ libraries.
"-- https://developer.android.com/ndk/guides
There is also the security aspect, why they discourage the use of those languages for full blown applications.
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?
Spend some time reading iOS security updates from Apple, lots of nice CVEs fixes reported there.
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
"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
Some of the information related their Safe C dialect,
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
Finaly a recent gem from CppNow 2023,
"Introducing a Memory-Safe Successor Language in Large C++ Code Bases"
Also considering the number of iOS devices, those two languages are probably more usable in practice than for example C#, even if the latter is cross-platform.
Platform vendors seek to lock in developers and discourage development on competing platforms, while developers wish to leverage their skills portably across multiple platforms.
They could capture alot more developers this way, as learning 1 language for both mobile platforms would facilitate more iOS only apps (there are many still even today) to get ported to Android.
This may finally make Android tablets viable, as the app ecosystem for tablets isn't as good as iPadOS
Also Kotlin and Android Studio are mostly developed by JetBrains that is in bed with Google for Android tooling, if anything I expect more Google acquiring JetBrains than supporting Swift on Android.
Since Android 5, with ART introduction, that Android uses a mix of AOT/JIT code.
Java was invented for low end IoT, there isn't anything more low powered than anything in the last 20 years of mobile computing.
Apple and Google should be cherished by not keeping the old C and C++ song of POSIX tunes going.
As Rob Pike puts it, it is like only listening to David Cassidy records.
Just some examples of bindings:
Python https://pypi.org/project/pyobjc/ Rust https://docs.rs/objc/latest/objc/ C# https://learn.microsoft.com/en-us/xamarin/ios/get-started/ob... Javascript https://www.npmjs.com/package/objc
As long as they tie into bringing Apple money- it’s fair game