[2014.11.18] java script execution environment survey
TRANSCRIPT
JavaScript Execution Environment Survey
2014.11.18.KAIST IT 융합연구소 한동균
Motivation Instability of Anode
Inactive development of Anode
Structural defect of Anode application
Depending on external service call which is hard to manage whole application
Implementation of native Java based cloudlet platform is almost done
MotivationApp1
App2Implement two applications which have same behavior but in different language
Implemented in Objective-C
Implemented in Java
Motivation
App
One Source Multi Use
Implemented in JavaScript
JS Execution Environment
Anode
V8(Webview)
V8(Zazl)
Rhino
Anode https://github.com/paddybyers/anode
A port of node.js to the Android OS and libraries
Able to leverage web socket
Unstable execution environment
Not active development
Anode (cont’d)
node.js is ported by Paddy Byers
Anode is implemented by Paddy Byers
5 contributors on Github (including me)
Not in active development
V8 (WebView) https://code.google.com/p/v8
Google’s open source JavaScript engine which is written in C++ and used in Chrome.
V8 is the default JavaScript engine of Webkit
Since Webkit runs on UI thread, only one thread per application, we cannot run multi-thread computation leveraging WebView
V8 (WebView)
V8 (WebView)
V8 (Zazl) http://www.zazl.org
Java based server-side JavaScript tools
Zazl contains V8 Java Bridge (i.e. Enable the use of the V8 JavaScript Engine within Java)
Inactive development
Rhino https://www.mozilla.org/rhino/
An open-source implementation of JavaScript written entirely in Java.
Stable JavaScript computation
Since it is implemented in pure Java, it shows relatively low performance than other JS engines.
Rhino (cont’d) Implemented by Mozilla developers
Rhino is embedded in Java SE 6 and 7 as the default Java scripting engine
Oracle has announced Nashorn as the default JavaScripting engine in Java SE 8 (JSR-292)
However, Android does not support Java 8 yet.
Performance Comparison
http://ariya.ofilabs.com/2014/03/nashorn-the-new-rhino-on-the-block.html
Comparison TableApproach Implemented Stability Maintainabilit
y Performance Complexity
AnodeC/C++
(node.js) with Java
low no more support normal
high(External
Service Call)
V8(WebView) C/C++ high Officially support
low(Single Thread)
low
V8(Zazl) C/C++ with Java high no more
support high low
Rhino Java high no more support
low(Java
Implementation)
low
Nashorn Java high not support yet high low
Java V8 Bridge Leverage JavaScript V8 Engine in Java via JNI
It guarantees high performance, low complexity, and high stability
Not familiar (JNI, Android NDK), but looks simple
http://www.zazl.org
http://lorinbeer.github.io/tutorial/2013/03/22/vatedroid-embedded-v8-in-android.html
Java V8 Bridge
C/C++JavaScript V8 Engine
Java
JNI (Java Native Interface)
Android Application
Comparison TableApproach Implemented Stability Maintainabilit
y Performance Complexity
AnodeC/C++
(node.js) with Java
low no more support normal
high(External
Service Call)
V8(WebView) C/C++ high Officially support
low(Single Thread)
low
V8(Zazl) C/C++ with Java high no more
support high low
Rhino Java high no more support
low(Java
Implementation)
low
Nashorn Java high not support yet high low
V8 Bridge C/C++ with Java high support
ourselves high low