Live data from Hacker News

NativeScript Replaces JavaScriptCore with V8 for iOS Apps

infoq.com

1–6 of 6 posts

Re: NativeScript Replaces JavaScriptCore with V8 for iOS Apps

#2
Will Apple allow this to be used in apps distributed through the App Store? As far as I know, they explicitly disallow any web browsers from using rendering/JS engines other than WebKit. I think this is for security reasons.

Are the JavaScript pseudo-native apps exempt? Can they use a custom JavaScript engine?

Re: NativeScript Replaces JavaScriptCore with V8 for iOS Apps

#4
post #2

Will Apple allow this to be used in apps distributed through the App Store? As far as I know, they explicitly disallow any web browsers from using rendering/JS engines other than WebKit. I think this is for security reasons. Are the JavaScript pseudo-native apps exempt? Can they use a custom JavaScript engine?

You can use interpreters as long as they run code that was bundled with the app. You can’t build a jit compiler though, the operating system won’t let you.

Re: NativeScript Replaces JavaScriptCore with V8 for iOS Apps

#5
post #4
post #2

Will Apple allow this to be used in apps distributed through the App Store? As far as I know, they explicitly disallow any web browsers from using rendering/JS engines other than WebKit. I think this is for security reasons. Are the JavaScript pseudo-native apps exempt? Can they use a custom JavaScript engine?

You can use interpreters as long as they run code that was bundled with the app. You can’t build a jit compiler though, the operating system won’t let you.

I don’t understand. JS can’t be precompiled, so the interpreter would still be doing JIT compilation (or be very slow?)

Re: NativeScript Replaces JavaScriptCore with V8 for iOS Apps

#6
post #5
post #4

Earlier quoted context omitted.

You can use interpreters as long as they run code that was bundled with the app. You can’t build a jit compiler though, the operating system won’t let you.

I don’t understand. JS can’t be precompiled, so the interpreter would still be doing JIT compilation (or be very slow?)

In iOS a block of memory that is writeable cannot become executable. The only blocks of memory that can be executable are those loaded from disk. So you can’t compile Javascript code to machine code, write it to memory and then run it.

An interpreter instead just runs the code step by step. If the next statement is this command, run this function. If it’s a jump continue interpreting from somewhere else. That’s slower but the processor never directly runs machine code that wasn’t already in the package.