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 off 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:
Use and distribution of this technology is subject to the Java Research License included herein.
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.
This jar file is provided as a beta release of the NextGen 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
First add the nextgen.jar to your classpath. On unix based systems this would be:
> export CLASSPATH=$CLASSPATH:[path/to/nextgenjar]
To compile class C.java in directory a/b, type:z
java edu.rice.cs.nextgen.compiler.main.Main a/b/C.java
java edu.rice.cs.nextgen.classloader.Runner C
A few notes:
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.
Allen, December 2000. Behold the power of parametric polymorphism
Allen, February 2003.
Java generics without the pain
Send comments, questions, and bug reports to JavaPLT.