The Mozilla
Organization
At A Glance
Feedback
Get Involved
Newsgroups
License Terms
Newsbot
Developer Docs
Roadmap
Projects
Ports
Module Owners
Hacking
Get the Source
Build It
Testing
Download
Bugzilla
Bug Writing
Tools
View Source
Tree Status
New Checkins
Submit A Bug
FAQ
Search

Rhino: JavaScriptTM for JavaTM


What is Rhino?

Rhino is an implementation of JavaScript written entirely in Java. It gets its name from the animal on the cover of the O'Reilly book about JavaScript.

Release 1.5

We're wrapping up work on JavaScript 1.5. See the JavaScript 1.5 Announcement for more information.

Rhino 1.5 Beta 1 is availble for download from ftp, or can be obtained by checking out the Rhino150R1_BRANCH tag from CVS.

Binaries

You can download binaries (JAR files) from ftp://ftp.mozilla.org/pub/js/. Rhino 1.4 Release 3 is the last qualified release. The current Rhino tip reflects the latest checkins and bug fixes, but has not been fully qualified. The differences between the two are reflected in the change log.

Source

The source code for Rhino is available under NPL 1.1 and can be found in the CVS tree at mozilla/js/rhino. It can also be viewed using LXR at http://lxr.mozilla.org/mozilla/source/js/rhino/. Finally, the zip files available with binaries from the ftp site also contain source.

Documentation

Reporting bugs

Use Bugzilla to enter bugs against Rhino. Note that Rhino has its own product category.

History

The Rhino project was started at Netscape in Fall 1997. At the time, Netscape was planning to produce a version of Navigator written entirely in Java and so it needed an implementation of JavaScript written in Java. When Netscape stopped work on "Javagator", as it was called, somehow Rhino escaped the axe (rumor had it that the executives "forgot" it existed). Since then, a couple of major companies (including Sun) have licensed Rhino for use in their products and paid Netscape to do so, allowing us to continue work on it. Now Rhino is planned to be part of several server products from Netscape as well.

Originally, Rhino compiled all JavaScript code to Java bytecodes in generated classfiles. This produced the best performance (often beating the C implementation of JavaScript when run on a JIT), but suffered from two faults. First, compilation time was long since generating Java bytecodes and loading the generated classes was a heavyweight process. Also, the implementation effectively leaked memory since most JVMs don't really collect unused classes or the strings that are interned as a result of loading a class file.

So in Fall of 1998, Rhino added an interpretive mode. The classfile generation code was moved to an optional, dynamically-loaded package. Compilation is faster and when scripts are no longer in use they can be collected like any other Java object.

Originally Rhino classfile generation had been held back from release. However the licensees of Rhino have now agreed to release all of Rhino to open source, including class file generation.
 

Wish List

We'll continue to evolve Rhino to match the JavaScript language as it changes. If you'd like to contribute bug fixes from your use of Rhino, or even help grow the beast, we'd love your input. Here are a few items on our wish list that we haven't been able to do yet.
  • The JavaScript debugger currently works on generated class files, but not the interpreter mode that is distributed on mozilla.org. It shouldn't be too hard to get the debugger working on the interpreter using the current implementation as a guide. Some documentation is available here.
  • LXR, the HTML source cross-reference borrowed from Linux, doesn't know about JavaScript. It would be nice to have support at least equal to what Java has.
  • Bugzilla tracks open bugs  against Rhino. Please feel free to take a look...

Rhino image courtesy of Paul Houle.
Copyright © 1998-2000 The Mozilla Organization.
Last modified January 11, 2000.