NextGen is an efficient and compatible extension of the Java programming language with support for generic types. Unlike other extensions of Java with genericity, such as GJ, JSR-14, and Java 5, NextGen does not restrict the programmer from using generic types in "type-dependent" contexts, such as casts, "instanceof" tests, and "new" operations. Nevertheless, NextGen maintains full compatibility with the JVM and existing compiled binaries. For more information on the NextGen design and implementation, see the list of papers below.

NextGen was designed as an extension to the GJ formulation of generics. The current version of NextGen is based on the Java 5 compiler. Therefore all valid Java 5 programs are also valid NextGen programs.

The NextGen prototype compiler and classloader, available for download from this site, provide a preliminary implementation of NextGen that may be of use for research and experimentation. All downloads are subject to the following licencing:

LICENSE

Use and distribution of this technology is subject to the Java Research License included herein and the following Java PLT licence:.

THIS SOFTWARE IS PROVIDED AS IS, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL RICE UNIVERSITY BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT, OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THIS SOFTWARE OR THE USE OF OR OTHER DEALINGS WITH THIS SOFTWARE.

Download

The zip files are provided as beta releases for the NextGen Generic Java Compiler. Note that not all features of the complete language are supported yet. Per-instantiation static fields are not yet supported. See the section Outstanding bugs and issues for more info.

Download

Requirements

Installation Instructions

1. Download nextgen2.zip

2. Extract the NextGen distrbution to the target directory

$ unzip nextgen.zip -d /usr/local/

3. Set the NGC_HOME environment variable

$ export NGC_HOME=path/to/nextgen/

4. Add nextgen/bin to your path.

$ export PATH=path/to/nextgen/bin/:$PATH

Usage Instructions

Compiling files

$ ngc a/b/C.java

Running a NextGen-compiled program

$ nextgen a/b/C

A few notes:

  1. The main entry point of your program must be contained in a public class so that the class is accessible by the NextGen classloader. Trying to run the main method of a non-public class will cause an IllegalAccessException. If NextGen were incorporated into a future version of Java, this restriction could be eliminated by giving the NextGen classloader the same access priviledges enjoyed by the default classloader.
  2. The jar file contains a MANIFEST file that allows compilation to be executed with java -jar. However, this usage is not recommended because the only classes available to the compiler will be those inside the jar. In particular, your bootclasspath will not be accessible, making almost all programs uncompilable. Unfortunately, we are legally prohibited from distributing the bootclasses of the Sun JDK (or any other JDK). We recommend constructing shell scripts on your platform of choice to run these programs more conveniently.

If you are a new developer on the NextGen project, please read the NextGen Developer's Guide.

Current Bugs and Outstanding Issues


Papers on NextGen and Related Topics

Cartwright, Steele. Compatible Genericity with Runtime Types for the Java programming language. ACM Symposium on Object Oriented Programming: Systems, Languages, and Applications (OOPSLA), Vancouver, British Columbia (OOPSLA) 1998. [CiteSeer]

Allen, Cartwright, Stoler. Efficient Implementation of Run-time Generic Types for Java. IFIP WG2.1 Working Conference on Generic Programming, July 2002. [pdf]

Allen, Cartwright. The Case for Run-time Types in Generic Java. Principles and Practice of Programming in Java, June 2002. [pdf]

Allen, Bannet, Cartwright. Mixins in Generic Java are Sound. Technical Report. December 2002. [pdf]

Allen, Bannet, Cartwright. A First-Class Approach to Genericity. OOPSLA 2003. [pdf]

Sasitorn, Cartwright. Efficient First-Class Generics on Stock Java Virtual Machines. SAC 2006. [pdf]


PowerPoint Presentations

Allen. Efficient Implementation of Run-time Generic Types for Java


Online Articles

Allen, December 2000. Behold the power of parametric polymorphism
Adding generic types to Java could mean less coding and fewer bugs

Allen, February 2003. Java generics without the pain
A guide to generics in the Java Tiger version and the JSR-14 prototype compiler


Send comments, questions, and bug reports to JavaPLT.