Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

Hence why UNIX on mobile is a Pyrrhic victory, as iOS, Android, ChromeOS rely on Objective-C, Java and JavaScript runtimes and their respective frameworks, just with good enough support from POSIX, that could be replaced by what is expected from any ANSI C implementation.


Isn't that the whole point of POSIX though?


ANSI C and POSIX aren't the same thing.

POSIX is more like the extended runtime that C needs to be portable outside UNIX walls, which isn't being fully implemented on iOS and Android.

http://www.cs.columbia.edu/~vatlidak/resources/POSIXmagazine...


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.


Of 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.


Did you read the very next sentence?


Android uses AOT compilation to native code since ART replaced Dalvik, no different than iOS APPs.

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...




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: