Oracle Blog

JavaScript for the JVM.

Latest news from the Nashorn team

Things have been busy on the Nashorn front, getting ready for the JDK 8 rollout and all. March 18 is the magic day (EclipseCon.)

I see that JetBrains has added Nashorn debugging to IntelliJ. This rounds out the debugging story with support in NetBeans and Eclipse.

The Nashorn team has been working hard on performance improvements for the next round. The first set involves caching of compiled scripts. This will make a huge difference for reoccurring scripts (think servers.) The second set of changes involve optimistic typing, where code generated for functions assumes optimal data types in expressions (ex. integers) and falls back to broader types (ex. double) if it doesn't work out. This provides a huge performance win, since most of the time the assumptions prove correct. These fixes are in staging repos moving to the JDK9-dev and JDK8u20-dev repos in the next few weeks. Both these changes should be in the JDK 8u20 update targeted for August.

Finally, on the Node.js front, Node has found a permanent home in the Java EE world. The project has been renamed to Avatar.js to tie in with the large Avatar project and is taking full advantage of multithreading.

Documentation will come with the release. In the mean time
--persistent-code-cache=true and --class-cache-size=50 are the two main options
for managing the code cache. The cache is off by default to get better startup
performance for run once scripts.