5 ms·
> Likewise, not allowing other JavaScript interpreters is just…annoying. Regardless of your opinions of JavaScriptCore, this is an unfair limitation on an alrea
by Valodim 5y ago
> Likewise, not allowing other JavaScript interpreters is just…annoying. Regardless of your opinions of JavaScriptCore, this is an unfair limitation on an already slanted playing field.
Reading the actual policies reveals that other interpreters are in fact allowed, but they may only be used for code that is part of the app bundle.
The actual limitation is that apps must be self-contained, and only javascriptcore and webkit may be used to run code from an external source (e.g. downloaded or user input).
See app store review guidelines, section 2.5.2: https://developer.apple.com/app-store/review/guidelines/#software-requirements https://developer.apple.com/app-store/review/guidelines/#sof...
- miohtama 5y agoApple tries to rely on static analysis. But it does not work and the engineering premise for it to work is shaky. This was discussed in Epic vs. Apple recently https://arstechnica.com/gadgets/2021/05/apple-brass-discussed-disclosing-128-million-iphone-hack-then-decided-not-to/ https://arstechnica.com/gadgets/2021/05/apple-brass-discusse...
- saagarjha 5y agoApple uses some dynamic analysis as well, but of course this is limited to what they can see during review.
- threeseed 5y agoObjective-C supports dynamic dispatch i.e. call methods using a string at runtime. So it's impossible to have static analysis work in all cases.
- UncleMeat 5y agoIn all cases, sure. But static analysis people have been resolving virtual function calls effectively for decades.
- JonathonW 5y agoWith the big caveat that only JavaScriptCore can JIT, so third-party interpreters will always be performance-constrained. Not a big deal for languages like Python or Lua that are always interpreted, but things like .NET on iOS (Xamarin) have to be ahead-of-time compiled for decent performance, and it's a complete non-starter for third-party JavaScript interpreters.
- atq2119 5y agoNeither Python nor Lua are always interpreted. (Both languages have fairly well-known and reasonably widely used alternative implementations that include JIT.)
- dunham 5y agoJavaScriptCore can’t JIT when run in process, the entitlement isn’t there on your app, so the kernel won’t let it. I think that’s part of the reason for WKWebView (which runs the browser in a separate process and proxies it).
- tinus_hn 5y agoNo, the actual limitation is that you can’t implement a JIT compiler. You can’t create executable memory blocks unless you have a special entitlement only Apples Javascript engine has. Even using that engine your app must be self contained, you can’t download extra code, no matter the language. As your link says: > Apps should be self-contained in their bundles, and may not read or write data outside the designated container area, nor may they download, install, or execute code which introduces or changes features or functionality of the app, including other apps.
- iudqnolq 5y ago> Even using that engine your app must be self contained, you can’t download extra code, no matter the language. That rule is honored more in the breach though