3 ms·
There is no Objective-C "runtime". (Well, there sort of is, but it's just a library, not a heavy-handed thing like you're thinking of). Unlike Android, iOS apps
by umanwizard 10y ago
There is no Objective-C "runtime". (Well, there sort of is, but it's just a library, not a heavy-handed thing like you're thinking of). Unlike Android, iOS apps are just normal compiled ARM machine language binaries executing natively.
Yes, you have to use their APIs in order to write graphical programs, but the same is true on any OS with a GUI system.
It's possible to write iOS apps in pure C if you want to. Sure, that'd be a pain, but it's possible. Less painful and actually decently reasonable would be to write all the GUI-specific stuff in Objective-C and any other logic in pure POSIX-conforming C or C++, since you can mix all those languages freely in a project.
- pjmlp 10y agoOf course there is a runtime, even C has a runtime. All programming languages, other than Assembly have runtimes. From the point of view of compiler design a runtime is everything required to support a programming language execution. On C's case, calling main (), floating point emulation, initializing globals, parallel code execution, thread locals.
- umanwizard 10y agoDid you read the very next sentence?
- pjmlp 10y agoAndroid uses AOT compilation to native code since ART replaced Dalvik, no different than iOS APPs. https://source.android.com/devices/tech/dalvik/#AOT_compilation https://source.android.com/devices/tech/dalvik/#AOT_compilat... Even with Android N, they are interpreted, JIT compiled with PGO, and eventually AOT compiled to native code when the device in not being used. Also iOS supports LLVM bitcode with AOT compilation at iTune infrastructure since iOS 9. Language runtimes have APIs, that is how they interact with compiler generated code. Using pure C on iOS means calling the API entry points of the Objective-C runtime https://developer.apple.com/reference/objectivec/objective_c_runtime?language=objc https://developer.apple.com/reference/objectivec/objective_c...