JSR-223 support
rsommerard opened this issue · 2 comments
Hi, are you planning to support the JSR-223 ?
https://docs.oracle.com/javase/8/docs/technotes/guides/scripting/prog_guide/api.html
Currently not. I've taken a look at the JSR-223 interfaces. They are not very different from the ones used in JSVM, but there are serveral, important differences. The biggest one is that JSVM uses JSValue wrapper objects with methods such as .asInt()
whereas JSR-223 uses unwrapped Java objects and Java casts (e.g. (Double) value
).
One feature JSValues provide that would be impossible to support with unwrapped values is accessor chains, which provide better error messages on bad casts. (See https://github.com/ntrrgc/jsvm/wiki/Accessor-chains-for-type-error-messages)
What would be the value in supporting JSR-223? So far, from skimming over the technical notes the only advantage I can see is ease of migration from Nashorn to JSVM.
Yep the value would be to be able to easily change the jsvm engine by an other one without change the application code that use it.
Nevermind, thanks for your answer. 😃