Does Multi-OS support any of ScriptEngine-s like Nashorn?

I am looking for any scripting language that is not LUA and works on Desktop, Android and iOS without any native libraries. Preferably JavaScript with ES6. I couldn’t find any links on how many features does Multi OS support from the JVM, and I don’t have means to test it atm.

Thanks for help

I do not see how this relates to MOE, but we use Mozillas Rhino for js execution in MOE.

1 Like

Hi Daniel,

MOE is using our enhanced version of Android ART. MOE 1.3 uses a version from Android 6, MOE 2.x is based on Android 7. This means, any standard Java code (using java., javax.), that works on Android, should work on MOE as well.

I don’t know if the ScriptEngine API is supported on Android. Theoretically it should work, as long as the ScriptEngine implementation does not use unsupported features, like invokeDynamic.

Thanks @pkirill for sharing your experience with Rhino on MOE, good to know, that it works fine.

Best Regards,
Gergely

2 Likes

It seems that javax.script.ScriptEngineManager is not supported on Android 4.4.2. What I ended up using is Rhino, which is actually written in pure Java to my surprise. To make it work on older androids, I disabled optimizations by setting them to -1 as they make Rhino use features which DalvikVM didn’t support apparently. Hopefully I will even have ES7 working in the future.

Maven Repository - Rhino is an open-source implementation of JavaScript written entirely in Java. It is typically embedded into Java applications to provide scripting to end users.

Dear Kisg,
“MOE is using our enhanced version of Android ART. MOE 1.3 uses a version from Android 6, MOE 2.x is based on Android 7. This means, any standard Java code (using java., javax.), that works on Android, should work on MOE as well.”
Do you mean that MOE implenments the complete jre on android 6? My means is that like NIO, or any other non-android specific code are all implenments on MOE (nio on iOS)? if then, it is great to reuse android app code.
Thanks!

I am using Java NIO code, sockets and Jackson library in my MOE app. All working great.

1 Like