3 ms·
Unfortunately, JIT will never be allowed on iOS because it invalidates the security model of the iOS App Store. The current security model requires that all iO
by pudquick 13y ago
Unfortunately, JIT will never be allowed on iOS because it invalidates the security model of the iOS App Store.
The current security model requires that all iOS App Store executables are monolithic - with the only exception being Apple-provided Apple-allowed dynamic libraries. You cannot publish an iOS App Store app that includes separate third-party dynamic libraries - they have to be statically linked into the final executable, which Apple then encrypts during the signature process.
This allows Apple to have 100% vetting control over the native code published in their iOS App Store. You can't side load unsigned code / code they haven't seen. There was actually an exploit / proof of concept where someone published a financial app in the App Store that called home and loaded arbitrary bytes into executable memory. The bug was patched and the developer was banned from the App Store.
A JIT would effectively allow the same thing: arbitrary native code execution on an iOS device that isn't part of an executable Apple has seen / signed.
However! This does not mean python is unavailable in the App Store. Python for iOS, Pythonista (my favorite), and several other flavors of interpreter already exist. It's just that they're bytecode interpreters only - no JIT allowed. And any attempts to use ctypes to dynamically load a module actually triggers a segfault (it's an intentional part of the iOS dynamic linker that does this - segfaults loading anything non-standard).
So go ahead and enjoy python on iOS - just don't hold your breath waiting for JIT.