Hacker News new | ask | show | jobs
by interpol_p 1065 days ago
You cannot download and execute native code on iOS, the sandbox prevents it. Memory protection ensures that pages marked as data cannot be executed

There is a special entitlement to allow some Apple apps and frameworks to do this — Apple’s JavaScriptCore can do JIT, which requires executing data pages. Similarly, Swift Playgrounds can compile to native code and execute that code

So, for example, you could ship a C compiler on iOS and it would compile perfectly valid binaries, but you would never be able to execute those binaries natively without code-signing them and deploying them in an Apple sanctioned way, which you cannot do on-device (except with the above mentioned exceptions)

1 comments

> Apple’s JavaScriptCore can do JIT

Only for Safari or if you use a WKWebView, otherwise if you use JavascriptCore yourself on iOS, JIT is disabled and quite slow. On macOS it’s enabled.