Rhino (JavaScript engine)
Rhino is a written fully in and managed by the as . It is separate from the engine, which is also developed by Mozilla, but written in and used in .
History
The Rhino project was started at in 1997. At the time, Netscape was planning to produce a version of written fully in Java and so it needed an implementation of JavaScript written in Java. When Netscape stopped work on Javagator, as it was called, the Rhino project was finished as a JavaScript engine. Since then, a couple of major companies (including Sun Microsystems) have licensed Rhino for use in their products and paid Netscape to do so, allowing work to continue on it.
Originally, Rhino compiled all JavaScript code to in generated . This produced the best performance, often beating the C++ implementation of JavaScript run with (JIT), but suffered from two faults. First, compiling time was long since generating bytecode and loading the generated classes was a resource-intensive process. Also, the implementation effectively since most (JVM) didn't unused classes or the that are as a result of loading a class file. (This has changed in later versions of Java.)
As a result, in the fall of 1998, Rhino added an interpretive mode. The classfile generation code was moved to an optional, package. Compiling is faster and when scripts are no longer in use they can be collected like any other Java object.
Rhino was released to in April 1998. Originally Rhino classfile generation had been held back from release. However the licensors of Rhino have now agreed to release all of Rhino to open source, including class file generation. Since its release to open source, Rhino has found a variety of uses and an increasing number of people have contributed to the code.[1] The project gets its name from the animal on the cover of the JavaScript book from . As of version 1.7R11 (May 2019), Rhino supports and up, and supports a number of ES6/ES2015 features.
Use
Rhino converts JavaScript scripts into . Rhino works in both and mode. It is intended to be used in desktop or applications, hence there is no built-in support for the objects that are commonly associated with JavaScript.
Rhino can be used as a by using the Rhino . The JavaScript shell provides a simple way to run scripts in batch mode or within an interactive environment for exploratory programming. It can be used in applications by embedding Rhino.
A slightly modified version of Rhino 1.6r2 comes with the release of version 6, which was released in December 2006. This makes it easier to integrate JavaScript as part of Java programs and to access Java resources from JavaScript. Other implementations of Java 6 may differ.
See also
- - the new default JavaScript engine for the JVM, starting at Java 8
References
- ^ "Rhino History". Mozilla Foundation. Retrieved 2008-03-20.