Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Is Google's V8 JavaScript engine available for iOS?

Can I use V8 on iOS? If not, which embeddable JavaScript engine do you recommend?

EDIT:

We don't plan on using it in conjunction with HTML rendering, just for internal scripting.

like image 563
Tony the Pony Avatar asked Apr 23 '11 13:04

Tony the Pony


1 Answers

Apple requires that you use WebKit when rendering web-content in an app, and they may reject your app if you use something else.

That said, you may want JavaScript for something other than rendering a webpage, and in theory that use-case should allow you to use whatever JavaScript engine you want. As the V8 source-code is available in C++, it should be possible to compile it into an iOS project. To do so you'll need to rename any .m files that make use of V8 functionality (either directly or indirectly through transitive dependencies) to .mm so that XCode knows to compile those files as Objective-C++.

This process of getting it to work will likely be a bit finicky, but in theory it should be possible.

like image 114
aroth Avatar answered Sep 22 '22 05:09

aroth