Slashdot Mirror


Oracle Proposes New Native JavaScript Engine for OpenJDK

hypnosec writes "Oracle has proposed a new project for OpenJDK — Nashorn, which aims to implement a high-performance yet lightweight JavaScript runtime that would run on the JVM natively. Nashorn will be headed by Jim Laskey, multi-language Lead at Oracle and the project will be sponsored by HotSpot group. The project proposes an implementation of JavaScript such that it can run standalone JavaScript applications via the JSR 223 APIs. Nashorn's design will enable it to take advantage of new JVM technologies like the MethodHandles and the InvokeDynamic APIs."

9 of 80 comments (clear)

  1. Oh good going . . . by Mitchell314 · · Score: 4, Funny

    Now this will just make describing the differences between java and javascript even more painful . . . :P

    --
    I read TFA and all I got was this lousy cookie
  2. Re:Don't let them patent it! by Trepidity · · Score: 4, Informative

    There have also been standalone javascript engines running on the JVM; the best-developed is Rhino from Mozilla.

  3. And we have known this since July 2011 by jockm · · Score: 5, Informative

    This was first discussed in July 2011 at the JVM Language Summit (PDF) link. It was discussed at the most recent JavaOne, and there have been more than a few articles about it.

    --

    What do you know I wrote a novel
  4. Nashorn is German for Rhinocerus by Anonymous Coward · · Score: 5, Informative

    Thought people should know

  5. What's different is that they're opening it by PCM2 · · Score: 4, Informative

    As the actual proposal notes, while Project Nashorn has been in the works within Oracle for some time, what they're doing now is proposing to make it part of OpenJDK, to get more people working on it so that the code can be tightened up for production use.

    --
    Breakfast served all day!
  6. Re:Useful as a configuration language by John+Bokma · · Score: 4, Insightful

    If you mean JSON; YAML (1.2 and up) is a superset of JSON.

    I don't think you mean actual JavaScript in a configuration file and eval-ing that....

  7. Re:Don't let them patent it! by M.+Baranczak · · Score: 3, Interesting

    Rhino has been a part of the default Java distro since long before v8.

    What I'd like to know is, how does this thing improve on Rhino? And can parts of it be reused in scripting engines for other languages? The article is pretty light on details.

  8. Re:Useful as a configuration language by dshk · · Score: 3

    I do mean Javascript. Something like this:

    init(Car, {
      driver: "john@example.com",
      color: "red"
    });

    It is similar to JSON, but notice the init function. This example creates a new Java (not Javascript) Car object, sets its driver and color attributes and starts the car when the application starts and stops it when the applicaton stops.

    If in your particular configuration there are many such cars, than you are free to define your own Javascript function which can be used as a shortcut:

    addCar("john@example.com", "red");

    The administrator is allowed to bend the configuration syntax to his situation. And this power is almost free, the integration between Java and Javascript only requires a few lines of code in the application. For example you do not need to modify the source code of Car in the above example.

  9. Re:node? by TopSpin · · Score: 4, Funny

    Node.js uses Google's V8 Javascript engine which is too fast for some applications. Also, it doesn't use enough memory, a problem the JVM is likely to correct. You can't expect much from an app that fails to allocate 900MB of virtual space and an 60MB working set on start-up.

    --
    Lurking at the bottom of the gravity well, getting old