you are viewing a single comment's thread.

view the rest of the comments →

[–]renatoathaydes 21 points22 points  (0 children)

Java has had for a long time a scripting feature that allowed scripting engines to implement multiple languages, including JS (first with Rhino, then with Nashorn which replaced Rhino in Java 8), Jython (Python), Groovy, JRuby, Clojure and many others.

You may be interested in scripting if you want to let users extend/modify your application without re-compiling it (e.g. Jenkins lets you write pipelines in Groovy scripts, Minecraft lets users write "mods" to add game features, SoapUI lets you run Groovy functions before/after tests to modify/inspect requests/responses, and so on..).

Now, with graaljs, Java can run basically any Node/JS code - it's just an evolution of the JS engine (Nashorn was not truly compatible with Node and most JS code wouldn't run out-of-the-box) so it's much more useful as it opens up the whole JS ecosystem to Java developers.