13 ms·
> The biggest technical hurdle is the inability to run external processes on iOS and iPadOS. > Apps on iOS and iPadOS must use Apple’s Javascript interpreter,
by saagarjha 6y ago
> The biggest technical hurdle is the inability to run external processes on iOS and iPadOS.
> Apps on iOS and iPadOS must use Apple’s Javascript interpreter, JavaScriptCore.
Both of these really suck because they are policy, not technical, decisions. Even setting aside the arguments of whether JIT code is a security concern (it is not unless your security model is one where codesigning exists to prevent the addition of new native code) that you cannot spawn a new process, nor can you ship another JavaScript interpreter, is really unfortunate.
Allowing apps to spawn new processes is easy (I mean, just inherit sandboxing rules and resource limits…) and allows for a lot of new usecases, like robust crash reporting, web servers, privilege separation, and more. That Apple allows this on macOS and even uses it for its own apps on iOS just shows how useful this can be and how little it affects the security model of iOS.
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. Coupled with the fact that the JavaScriptCore interpreter (which the framework uses for anything you run in-process) is literally designed for low resource consumption instead of than performance makes this even more infuriating.
- w0utert 6y ago>> The biggest technical hurdle is the inability to run external processes on iOS and iPadOS. >> Apps on iOS and iPadOS must use Apple’s Javascript interpreter, JavaScriptCore. > Both of these really suck because they are policy, not technical, decisions. They are policy decisions that kind of make sense for a device like a tablet or phone though. Even though you could technically allow installing a complete development toolchain on an iPad, I can't imagine what the process would look like in practice. Download and install a complete *nix userland through the app store? Plus a compiler toolchain and each and every tool used in the build phase for your product? Who is going to maintain and distribute all these parts if the whole ecosystem is designed around the idea that apps are sandboxed and distributed through a curated app store? Imagine the customer support burden if you are the maintainer of some app that depends on external tools that can be used in a zillion different build/deploy configurations. You could of course argue that the iOS ecosystem should not be based around a curated app store and sandboxed applications, but that would make it a MacBook... Maybe we should put the whole idea of having one device that does everything to rest and accept that there are advantages to have a split between 'real computers' and tablets/phones. That's just my opionion though... Edit: ah great, an immediate -3 because apparently people here think it is absolutely required to downvote straight away because they disagree with some opinion that is not their own. Goodbye Hacker News, after ~10 years I'm finally done with the comment sections here and will deactivate my account and ask for it to be deleted
- Siira 6y agoWith this level of reasoning, SMS also makes sense for phones, and banning messenger apps is no big deal. People have different needs, and a minority is always pushing the edges, and this pushing needs to happen so that the mainstream can pick and choose from the newly explored territory.
- simion314 6y agoAs long as Apple makes money from allowing people to buy "Pro" apps like IDEs, REPL , other creation apps then you wrong, otherwise Apple should reject this apps as not allowed because the device is not capable for Pro creator usage.
- em-bee 6y agoyes, downvoting hurts, and sometimes it's not fair, i got to feel that too. but it has been said repeatedly that downvoting is reasonable to voice disagreements. replying would be better, but not everyone can put their thoughts into words. try to think about it as a strong disagreement. (EDIT: i wonder who downvoted this comment now ;-)
- tannhaeuser 6y agoI haven't downvoted you, but voicing disagreement via downvoting isn't reasonable, since it tends to have dissenting opinions not be heard at all. When we're here to have a discussion after all, aren't we?
- easton 6y agoI was hoping with the announcement of the iPad Pro with the M1 chip and 16GB(!) of RAM it meant that Apple was going to give us some way of running arbitrary code inside sandboxes on the device in the next release of iPadOS. (So we could have Xcode, or at the least, Swift and Clang and a terminal). I suppose they probably would’ve told Panic though, even if under NDA since they’ve had a good relationship with Apple. Crap.
- Pulcinella 6y agoWWDC is in a month so we’ll see then. I will be disappointed if there isn’t at least XCode for the iPad. Swift Playgrounds already compiles Swift code on the iPad and has for years.
- lstamour 6y agoJust because it’s impossible for third-parties to write an IDE doesn’t mean Apple can’t. In fact, it seems more likely that Apple would ship Xcode for iOS as a way of trying out new API capabilities and then in a year or two allowing other devs to use some of the same capabilities. That said, I could imagine that if such an API existed, Visual Studio Code would be the first text editor devs would be excited for. I like Nova, it’s much faster than VS Code, but VS Code has all the extensions, and is cross-platform. I tend to use Nova for files, VS Code for folders and JetBrains IDEs for projects…
- 2OEH8eoCRo0 6y agoThat sounds like the exact thing that Microsoft was slapped with in the 90s. Microsoft used operating system functionality for their browser that 3rd parties did not have access to. Microsoft was forced to open this stuff up. Apple regularly leverages operating system calls that 3rd parties do not have access to.
- Jtsummers 6y agoThat's ignoring all the other things MS was up to at the time. They did a lot of embrace-extend-extinguish to reduce the effectiveness of competitors, a lot of dirty dealing with OEMs to block alternate OSes. The IE thing was just one piece of a much larger case.
- macintux 6y agoPlus the fact that Microsoft had a monopoly they were abusing; Apple doesn't by any reasonable metric.
- egeozcan 6y agoThey are part of a duopoly and I hope Google also gets scrutinized.
- macintux 6y agoUntil/unless the two companies are caught colluding against consumers, duopolies aren't covered by antitrust law afaik.
- hparadiz 6y agoThe Apple store is a monopoly when you consider just iOS. It is in fact 100% market share among apple devices. There is no alternative. Android doesn't replace an iPhone in many cases.
- 6y ago
- inetknght 6y ago> setting aside the arguments of whether JIT code is a security concern (it is not unless your security model is one where codesigning exists to prevent the addition of new native code) But, it is. 1) provide a JIT compiler 2) download code from the internet 3) provide code to JIT compiler 4) ??? 5) Profit! JIT code obfuscates the inspection of the app. It therefore is a security concern.
- SheinhardtWigCo 6y agoHow is this significantly different from: 1) link JavaScriptCore 2) download JavaScript code from the internet 3) provide code to JSC 4) ??? 5) Profit!
- lacker 6y agoApple makes sure that JavaScriptCore can safely run untrusted code, but they don't apply that same level of security to their native API.
- eat_veggies 6y agoI suppose the difference is that JSC can only execute javascript (an interface which is relatively self-contained and which Apple can control) and not arbitrary machine instructions?
- egeozcan 6y agoBut you can't provide a JS JIT as well.
- candiodari 6y agoJIT's can be made 100% secure. Inspection by humans cannot be made secure, for a lot of different reasons. So it's just the opposite. I've run bots that executed code from the internet and while yes, I've had to learn some lessons the hard way, you can have perfectly safe JITs.
- saagarjha 6y ago
- Valodim 6y 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 6y 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 6y agoApple uses some dynamic analysis as well, but of course this is limited to what they can see during review.
- threeseed 6y 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 6y agoIn all cases, sure. But static analysis people have been resolving virtual function calls effectively for decades.
- JonathonW 6y 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.
- nwienert 6y agoReact native has Hermes, it’s own JavaScript engine. The key is it’s not a JIT though. It actually performs better in many facets than JSC which is impressive. So you can run your own side process, and it can be its own JS engine. Also, I’ll repeat this, but Im a fan of the JSC only limitation, at least for now. By not allowing v8, we are least have some hedge against a… hegemony. I like Apple over Google for many reasons, and would like to see Googles extremely hostile actions towards the web curtailed. I’ll take the trade off. I’d be less happy actually as a consumer if they allowed third party browser engines.
- kmeisthax 6y agoIt's sad that the only hedge we have against the browser monoculture problem is Safari of all things.
- kitsunesoba 6y ago> By not allowing v8, we are least have some hedge against a… hegemony. I like Apple over Google for many reasons, and would like to see Googles extremely hostile actions towards the web curtailed. I’ll take the trade off. I’d be less happy actually as a consumer if they allowed third party browser engines. Similar deal with WebKit. At ~15% marketshare between mobile and desktop followed with Gecko at ~5%, it's the only real holdout against Chromium domination. If browser engines were opened up on iOS, you can bet anything that Google is going to go bananas with marketing Chromium-based Chrome for iOS and web devs will happily back those efforts, pushing most or all of that 15% over into Google's lap. At that point Mozilla will have an even more difficult time holding on as an increasing number of devs only develop against Chromium.
- moshmosh 6y agoNot only that, if Chrome gets enough marketshare on iOS Google could do things like taking away 5-20% of a huge fraction of iOS devices' battery life just by shipping a somewhat less efficient build, plus doing the same with any embedded versions they'd manage to convince everyone to use in their apps. I mean, Chrome's already less efficient than Safari, so that much of a penalty might happen regardless, but they could accidentally-on-purpose fail to optimize new features in their iOS code to harm their only competitor in the mobile OS arena. "But developers and users wouldn't stand for that!" OK except I can take 4-6 hours off my M1 Macbook's battery life by using a couple Electron apps and favoring Chrome over Safari. Lots of people do exactly that, maybe not because they want to, but because they need those crappy programs to get work done.
- dev_tty01 6y ago>Even setting aside the arguments of whether JIT code is a security concern (it is not unless your security model is one where codesigning exists to prevent the addition of new native code) ... I'm a neophyte on security issues, but this seems like a very open ended assertion. Doesn't JIT require rwx permission on a block of memory? Haven't there been thousands of security attacks over the years that started with some kind of buffer overflow (or similar approach) that is fundamentally enabled by rwx permission on a block of memory? Like I said, I'm just an observer in this area, so apologies if I am way off base. >is literally designed for low resource consumption instead of than performance I would say this is the right choice for a handheld device. At least it is for my phone.
- saagarjha 6y agoNo, these are reasonable questions, they just miss the fact that Apple ships JavaScriptCore with a JIT. By not allowing JITs in third party apps Apple claims they are the only ones who can write a secure JIT (obviously false) and that their platform sandbox is too weak to stand up to arbitrary code execution. Plus, it’s not like normal code doesn’t have buffer overflows or other security issues. As for the tuning on the VM: perhaps in isolation. But again, the high performance JIT exists; it’s just not available to anyone else.
- dev_tty01 6y agoYes, you are right that they allow their own JIT. Their position would be that they spend a great deal of time hardening that JIT and don't trust others to take that time. Their JIT isn't perfect of course, but they control it and can fix it fast if needed. (In their opinion.) They are really saying that they aren't willing to take the time to exhaustively test other JITs. That is a frustrating choice, but I do understand the thinking. You raise the bigger point. Is there no way for their platform sandbox to handle the concerns? That is a great question. >Plus, it’s not like normal code doesn’t have buffer overflows or other security issues. I think normal code on an M1 only runs in rx memory blocks [0,1], so no buffer overflow attacks. At least not without another attack to remap the blocks. This might go back to A12 processors. M1 strengthened the model. Perhaps with these newer processors, the hardware support can harden the sandbox enough to allow more flexibility. One can hope... [0] https://blog.svenpeter.dev/posts/m1_sprr_gxf/ https://blog.svenpeter.dev/posts/m1_sprr_gxf/ [1] https://siguza.github.io/APRR/ https://siguza.github.io/APRR/
- paxys 6y agoThis is also the reason why iPad Pro will never be the professional machine Apple is pushing it as, no matter how much processing power or marketing dollars they throw at it.
- tacker2000 6y agoSo it is. The gilded cage will never rival the open field.
- Fomite 6y agoThat depends on what field one is a professional in surely?
- katbyte 6y agoFor a lot of users it’s more then enough, professional writers editors writers photographers and many many more do not need to “run arbitrary code” it’s a professional device for many professions, just maybe not for software development and maybe that’s ok?
- jbverschoor 6y agoBut you’re allowed to run a vm for running code. Like the “ish” shell
- hctaw 6y ago> it is not unless your security model is one where codesigning exists to prevent the addition of new native code It is if your security model includes things like parental controls and payment processing.