Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

JSR-223 support #1

Open
rsommerard opened this issue Apr 20, 2017 · 2 comments
Open

JSR-223 support #1

rsommerard opened this issue Apr 20, 2017 · 2 comments

Comments

@rsommerard
Copy link

Hi, are you planning to support the JSR-223 ?

https://docs.oracle.com/javase/8/docs/technotes/guides/scripting/prog_guide/api.html

@ntrrgc
Copy link
Owner

ntrrgc commented Apr 21, 2017

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.

@rsommerard
Copy link
Author

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. 😃

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants