Hacker News new | ask | show | jobs
by odo1242 14 days ago
Browser engines require JIT compilation to work with any sort of performance. The whole iOS security model is (at least partially) based on Apple being able to validate all app code in advance, so Apple doesn't want apps to be able to ship engines that can do their own code generation since they can't sign code generated at runtime.
2 comments

This argument falls apart when you consider that any app can use JavaScriptCore to JIT arbitrary code. Any app can also include an interpreter for arbitrary code.

Apps can ship engines that can run arbitrary code, it just needs to be so slow that it can't compete with WebKit.

You cannot JIT arbitrary code, only Javascript in the confines of a webview, no?

And yes, you indeed can run _arbitrary_ code, but it can only be interpreted. Fine for some things, but in general it will always be worse than JIT'ed or executing arbitrary machine code. And on iOS devices, which are almost always ran off of a battery, this makes interpreting code unviable as a general way to monkey patch things or delivering code to users without the app getting reviewed.

Exactly, that's what I'm saying. Apple clearly doesn't care about checking every piece of code that gets run, you can write your app in a webview and download and execute arbitrary JS, or you can write an interpreter and execute arbitrary unchecked code outside a webview.

So this clearly isn't about checking all the code that apps run before it gets shipped to users. It's about hampering competitors.

Afaik this is not possible no? JavaScriptCore JIT capabilities are heavily restricted
Nearly twenty years, the same thread dozens of times each year, filled with the same tired argument: simple-minded, juvenile “greed” dictates the policy and procedures of Apple’s corporate business strategy. As if.

But deep in the recesses of the mid-level sub-threads you finally spot it: standing there indiscriminately is the Where’s Waldo you’ve been searching for. The one guy that always gets it.

“You can’t map memory to execute on App Store binaries. Makes a lot sense actually…” he begins, but it’s already too late. You reach out back him up, but the comment is already fading. “and you could always sideload whatever you want on an iPhone, and that tiny fee has other benefits..”.

And then it’s gone. You pause, a moment of gratitude for witnessing it’s sad, brief existence, and continue scrolling onward. God bless you, Mr. Guy-That-Gets-It