by saagarjha · 5y ago · 0 comments
> 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.
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/#sof...
https://arstechnica.com/gadgets/2021/05/apple-brass-discusse...
So it's impossible to have static analysis work in all cases.
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.
That rule is honored more in the breach though
(Both languages have fairly well-known and reasonably widely used alternative implementations that include JIT.)
> 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
Also, what you're describing already exists, it's called iSH. It runs an x86 emulator with a copy of Alpine Linux inside. Somehow, they even convinced App Review to allow it (yes, Apple did threaten to remove it at one point, they backed down). You can use this penalty box to run pretty much any developer tool you like, you can mount file providers inside of the VM, etc. The only limitation is that it's x86 emulation is incomplete, I can't get it to run cargo so I can't compile Rust programs on it yet.
They want their customers to buy both. Apple has nothing to gain by killing off the Mac via the iPad.
If tablets are going to replace laptops for consumers in the long term, Apple would prefer that those tablets be iPads. If that shift means the iPad eats the Mac, so be it.
This already worked for them once - the iPhone cannibalized the (then-very profitable) iPod business with Apple’s explicit support, and now the company’s worth a trillion dollars.
Just because most of us on HACKERnews write code doesn't mean your average 'computer user' does. iPads work very well as computer replacements for the majority of people who just want to browse the web/do shopping/use their favourite video and other media viewer etc etc.
It's an everyday computer for the masses. Not a developer's workstation.
I would not be surprised if iPadOS 15 ships with virtualization support, since the M1 has ARM EL2. If that is the case and Apple allows iSH to use it, then it probably would make sense to add ARM support to iSH for extra performance.
They could pick something easier to emulate perhaps, but x86 has benefits from a compatibility standpoint.
Maybe one day there would be a benefit of targetting WASM with a natively implemented syscall api?
Like every other computer ever.
> 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.
Microsoft and Google seem to work just fine. People seem to be able to ship when they have the tools to do so.
> They are policy decisions that kind of make sense for a device like a tablet or phone though.
They are strategic decision under the guise of policy decisions. Apple is "protecting you from dangerous apps" (read: dangerous apps = competition for Apple).
Apple is anti-competitive.
But there are lots of hybrid tablets and touchscreen laptops. What makes the iPad an amazing device for me is its outstanding software library (e.g. Procreate) and the Apple Pencil.
I could certainly imagine Apple bringing its Pro apps - notably Final Cut, Logic, and XCode - to the iPad. But I can't imagine Apple opening up iOS any time soon any more than I would imagine Nintendo opening up the Switch.
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.
That’s a very heterogenous example, but at some point we will be discussing personal clouds, where people have a little cluster of commodity/older ARM hardware that they balance a bunch of services across.
For example, you can download the server part of Don’t Starve Together as a separate app that you can then leave running even if you log off. That should be the standard for coop games, and probably for multiplayer games in general.
We are also overdue for a rethink of CI/CD pipelines, and I don’t mean As A Service.
Exactly what I would argue, and the only thing that would bring me back to iOS at this point.
> 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.
Google "convergence Pinephone", and imagine how powerful that would be with an iPhone running convergent macOS. And how much more powerful having macOS (with a mobile-optimized GUI) on the phone would make it on the go.
It's bad on HN, and it's much worse on other sites.
I've got Termux running on my phone, complete with vim plugins, language server support, several compilers and all kinds of other tools. Combined with a bluetooth keyboard, it can be very useful in a pinch. It'll stop working on Android 11 because of "security concerns", but either thankfully or sadly, my phone has no stable Android 11 release yet. Everything is running inside a sandbox, I don't even have root access, and the binaries are distributed through a normal Linux package manager. With the right software you can even run a normal GUI on it through VNC or Spice, although that's something I haven't explored yet.
No need for other app developers to have any relation with Termux, that's what the sandbox is for. On Android, you can theoretically implement a system for sharing binaries and virtual files quite easily if Termux would support it, but I haven't seen such need myself.
These tools are maintained by volunteers and the Termux developer, and can be extended by adding repositories made by other people. So "who is going to maintain and distribute all these parts" comes down to the same question as "who is maintaining and distributing all of these Debian packages": the developers who want to make the ecosystem and apps function.
Most users won't use their phone or tablet like this, but I honestly don't see why they shouldn't be allowed to if they wish to. Apple is selling a complete keyboard and display stand for iPads, so these devices are clearly being targeted for productive use. Yet Apple refuses to allow developers to be productive on these devices, because they don't want competition for their crappy mobile browser engine.
As far as hardware is concerned, the touch screen, keyboard and OS are pretty much the only serious differences between the iPad and the Macbook Air. If you prefer a two-in-one tablet/laptop combo (which quite a lot of people do), the iPad is the closest Apple product to fit the description, if it would allow users more software freedom.
I do see the advantage of the curated app store, but I don't see the advantage of banning customers from not using said app store for the end user. You don't _have_ to install any apps from outside the app store, you just get the option to do so if you wish. I don't know any non-technical people who have installed apps from outside the Play Store, so it's not like allowing any lifted restrictions will make the ecosystem collapse.
I have a hard time understanding why you would want a company to tell you what you can and cannot use a device for. Their suggestions are always welcome, but why would you be in favour of their restrictions?
1. I'm in favor of locked-down devices for certain classes of users, because it reduces the technical support burden, one that I might otherwise be saddled with!
2. I'm willing to put up with walled gardens that have high-quality software, such as certain iPhone games and music apps, or first-party Nintendo games on the Switch. DRM is irritating, but I can live with it if it doesn't get in my way too much.
3. I'm in favor of several of Apple's developer restrictions that are aligned with my priorities of privacy, security, and battery life, so I'm willing to put up with the others that support Apple's business interests. Sideloading obviously makes such restrictions less enforceable.
I actually agree with most of those reasons as long as there's a developer mode setting somewhere deep down to turn them off. I've only seen hidden settings being accessed on a large scale once, which was during the Pokemon Go hype, to allow GPS spoofing through the developer options; something that can't be easily done anymore.
With an off switch, normal users are protected and given a nice ecosystem while anyone else can benefit from the freedom of using their device the way they want to. This solves the technical support burden and the software quality issue, because to reach that audience, you still need to go through some form of accepted app store. If you prefer Apple's judgement for whatever reason, you just stick to their store and ignore the existence of any other app out there.
I have to disagree with you on the developer restrictions, though, and I think that's where my lack of understanding your mindset came from. The mandatory 15/30% cut and arbitrary rules (such as the ban on most parental control apps the moment Apple brings out a competitor) make it impossible for me to tolerate the other minor annoyances that come with Apple's decisions. Of course, Google has been going the same route, sadly.
Google has been applying many of the same protections, except for many of the privacy ones, and their platform doesn't suffer a side-loading problem at all. This indicates that the ecosystem would be fine if Apple would loosen up a bit, sticking to their privacy guns but allowing developers to still compete with whatever project they've come up with next.
Neither Google nor Apple have my best interests at heart, but in the case of Google I can at least work around their stupidity. I'll gladly lose access to some "exclusive" content if that's what it takes to install open source apps onto my phone.
I don’t think accounts can be deleted? I tried once and was told no. :(
try to think about it as a strong disagreement.
(EDIT: i wonder who downvoted this comment now ;-)
https://news.ycombinator.com/item?id=16131314
I wish I could downvote downvoting
personally, i only downvote if i feel someone says something unreasonable or worse. but not if it is a good argument, even one that i disagree with. in those cases i even counterupvote other downvotes.
as for the downvote on my comment, that was more a rethorical question. i was actually just laughing at that, given the subject of the message. and the subsequent upvotes show that a lot of people agree with the comment.
(edit: it gets funnier. by now my above comment received at least 8 upvotes and 4 downvotes (or up to 4 people changed their mind))
Exactly, downvoting as a way to disagree is the easy way, it’s childish, puerile, and ridiculous. But let’s put things into perspective. A comment is just an opinion in a sea of random opinions. Opinions, for the most part, are not even personal, people tend to borrow them. To think through something and come up with an original opinion takes a lot of work. A downvote is just an easy dismissal, in a sea of easy dismissals. That’s not a proper way to communicate.
Downvoting is imperfect, but that said, I understand how people can find it useful as a curating system. I never downvote comments I disagree with because it doesn’t accomplish anything. It also takes too much energy.
Apple regularly leverages operating system calls that 3rd parties do not have access to.
I think a lot of iOS's limitations come from a philosophical stance Apple took at the start of the (iOS) App Store -- iPhones and iPads should be treated like consoles, not general purpose computing platforms. Despite them marketing the iPad Pro as if it's a full-bore computer replacement -- and to be fair, there are a lot of use cases where it really can be (e.g., office worker, photographer, writer[1], even video/audio editor -- on an OS level, they've stubbornly stuck with the "Mac = computer, iPad = console" approach[2] and I don't think they're going to change it unless forced.
[1] With certain limitations. I can use an iPad well enough for my fiction and non-fiction, but not for my technical writing.
[2] The "Mac = computer" part of that is why I disagree with the prevailing opinion on HN about how Apple will "inevitably" lock down the Mac to the same degree they have the iPad; I think they continue to see them as fundamentally different classes of products, even as that distinction grows ever more arbitrary.
It is likely a "careful what you wish for" with regulating the platforms like utilities, because they would likely regulate much farther down - the governments would become an additional party setting app store policy to a much greater degree than we see today.
https://en.wikipedia.org/wiki/United_States_v._Microsoft_Cor...
Part of their punishment was to open up APIs and allow 3rd parties to audit. If this wasn't the main part of the case why was this used to remedy?
The browser was not special, the abuse was the issue and the browser case was solid to use as a central claim against MS.
And this bears repeating again and again:
The browser was not and is not special. It does not matter. It was the abuse that was at issue, not the browser itself. The browser was a symptom of the abuse. Again, the browser was not the issue, only a symptom of abuse of their monopoly position.
Any claims against Apple about the Safari browser on mobile being like the IE situation on Windows is the result of a shallow reading of the case.
Apple apologists will blur this by taking about the smart phone market as a whole. But once someone has bought a device, they are no longer in that larger market. They need apps, and there's only one place to get them.
That only leaves the question of whether they are abusing the monopoly.
Google has a similar monopoly over Android applications, but it's not as tight, because of side-loading and fragmentation by Amazon and others. Still, it's a near-monopoly because few people bypass the Play Store.
They used that position to force OEMs to sell Windows only. BeOS was going to be on <vendor> desktops [0], but MS went to them and said, in short, "If you do this, you will have to pay retail price for our OS. And if you have to pay retail price, you will have to raise your hardware prices when selling Windows desktops. And if you have to do that, in this cutthroat low-margin industry, you won't be able to compete with the other OEMs."
The anti-trust case is really interesting reading (to me at least), and worth checking out. Most people only know the headlines of what was covered by it ("it's about browsers") but aren't aware of the deeper and over decade long issues that were covered by it.
Embrace, extend, extinguish: https://en.wikipedia.org/wiki/Embrace,_extend,_and_extinguis...
It wasn't just the browser's hooks into the OS (or the OS dependency on IE). It was the deliberate non-conformant manner that MS developed it in. It literally did things in the opposite way the standard described at times. See also their effort at implementing Java as part of their developer suite, where they were later forced to drop the J++ line because they were making an incompatible, non-standard Java.
[0] Compaq? It's in the suit, I may track it down before the edit window is closed.
> Courts do not require a literal monopoly before applying rules for single firm conduct; that term is used as shorthand for a firm with significant and durable market power — that is, the long term ability to raise price or exclude competitors. That is how that term is used here: a "monopolist" is a firm with significant and durable market power.
Also, iOS has 60% of the mobile operating systems market in the US[2]. Apple's App Store is responsible for 100% more revenue than the Play Store[3].
Apple and Google are certainly leveraging their duopolies in both the mobile operating systems market and the mobile app distribution market in order to prevent competition in those markets and others.
[1] https://www.ftc.gov/tips-advice/competition-guidance/guide-a...
0: indeed, can, without stupedous efforts of reverse engineering that they actively oppose
Apple isn’t even a majority of the market, so laws on monopolies don’t readily apply here.
It is if your security model includes things like parental controls and payment processing.
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.
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/ [1] https://siguza.github.io/APRR/
“We work hard to make our engine secure. We don’t think anyone else should try.”
“But here’s a security issue in your engine. Can I use this other one which I think does a better job? Can I even try?
“No.”
FWIW, W^X is generally implemented by all good JITs these days because it’s a good idea. I’m sure the if given the opportunity browsers would adopt this, just like they’ve adopted sandboxing on macOS despite there being zero documentation or support for that interface. It’s just that Apple does not even allow them to do so on iOS. (Also, W^X does mot protect against all buffer overflow attacks.)
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.
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.
"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.
Lastly Chrome is power hungry. When I need to use Chrome for work, I go through my battery almost 2 - 3 times faster than when using Safari.
I much prefer the integrated experience I get with Safari and how it feels like it fits in with the rest of the OS over Chrome which does its best to tie me into Google services.
That sentence is weird to me - you appreciate Safari for binding you into using in-house Apple built functionality but you begrudge Chrome trying to do the same with Google build functionality.
But Apple is a Pro at PR so Google PR should not work, the only issue would be if Safari is garbage or Google attempts to use some non standard APIs on their pages - but in this case Apple could give everyone a hand by using their expsensive lawyers and doing once in their life something good and go after Google.
Google pushes their APIs and calls them standard. And then employs "developer advocates" to bash iOS and Safari.
Here's a non-exhaustive list of APIs that are "standard" even though both Safari and Firefox are against them: https://webapicontroversy.com/
I'm sorry but I only see "I like X and I hate Y".
Worse, you want your preference to be forced on other people.
On iOS, third party JIT is blocked by disabling mprotect + PROT_EXEC syscall, which allows execution of arbitrary blocks of memory.
No thank you, I don’t want rando apps to have that kind of power. Especially given the trade-off is some marginally different browser experience.
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.
1) link JavaScriptCore
2) download JavaScript code from the internet
3) provide code to JSC
4) ???
5) Profit!
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.