title: Embed a JavaScript engine in an iOS application
body: <p>I wonder if anyone has successfully ported a javascript engine/interpreter to iOS. I'm writing an iPhone game that I would like to use Javascript as the high-level scripting language (AI, gameplay, etc.), but to do that, I need to compile the JS engine into a static library and link it against my objectiveC program for iPhone OS. There are some candidate JS engine I'm looking at but I couldn't find any successful cases for doing that. </p>
  
  <p>Here're the js engine I was hoping to use for iOS</p>
  
  <ul>
  <li>google's V8 javascript engine</li>
  <li>mozilla's SpiderMonkey</li>
  </ul>
  
  <p>The alternative is to use <code>UIWebView's</code> Javascript callback interface, but that requires loading the entire <code>UIWebView</code> into memory and the experiences I heard is that it is usually slow in performance. </p>
  
  <p>Appreciate if anyone had similar experiences of do this or know any references for that!</p>
  
  <p><strong>[UPDATED] as Kostis mentioned, Apple introduced <a href="https://developer.apple.com/library/mac/documentation/Carbon/Reference/WebKit_JavaScriptCore_Ref/_index.html">JavascriptCore</a> in WWDC 2013</strong></p>