JavaGI

JavaGI is a conservative extension of Java 1.5 that generalizes interfaces with concepts from Haskell type classes. In particular, JavaGI supports the following features:

  • Interfaces can have retroactive implementations.
  • Interfaces can specify binary methods.
  • Interfaces can span multiple types.
  • Interfaces can support multiple dispatch.
  • Interfaces can have type-conditional implementations.
  • Interfaces (and classes) can have type-conditional methods.
  • Interfaces can have static methods.
  • Interface implementations can be type-checked in a modular way.
  • Interface implementations can be loaded dynamically.

As a result, JavaGI unifies formerly separate language extensions and renders many anticipatory uses of design patterns such as Adapter, Factory, and Visitor obsolete. Moreover, JavaGI allows several extension and integration problems to be solved more easily.

There exists a full-blown Implementation and an Eclipse Plugin for JavaGI.

We provide two implementations of JavaGI:

  • a full implementation supporting all features of JavaGI and Java 1.5
  • a protype implementation supporting JavaGI's core features but not the full Java 1.5 language

It is highly recommended to use the full implementation.

Full implementation

The full implementation of the JavaGI compiler is based on the Eclipse Java Compiler and made available under terms of the Eclipse Public License. We provide releases in source and binary form.

The binary release is self-contained, no external libraries are needed. To invoke the JavaGI compiler, simply execute the command java -jar javagic-X.X.X.jar, where X.X.X is the correct version number. (An Ant plugin will be available soon.) The resulting bytecode runs on every Java 1.5 compliant JVM, just make sure that the file javagi-rt-X.X.X.jar is in your classpath.

Starting with release 0.4.0, JavaGI provides a custom class loader which allows for less strict runtime checks. To use the custom class loader, you must start your application through the command java jvm-opts javagi.runtime.Main application-mainclass application-args (make sure that the file javagi-rt-X.X.X.jar is in your classpath).

Instructions for building from source are included in the README file shipped with every source release.

Downloads

Version Date Source release Binary release
0.7.0 2009-12-07 javagi-src-0.7.0.tar.gz javagic-0.7.0.jar, javagi-rt-0.7.0.jar
0.6.0 2009-07-27 javagi-src-0.6.0.tar.gz javagic-0.6.0.jar, javagi-rt-0.6.0.jar
0.5.0 2009-06-19 javagi-src-0.5.0.tar.gz javagic-0.5.0.jar, javagi-rt-0.5.0.jar
0.4.0 2009-04-04 javagi-src-0.4.0.tar.gz javagic-0.4.0.jar, javagi-rt-0.4.0.jar
0.3.0 2009-03-25 javagi-src-0.3.0.tar.gz javagic-0.3.0.jar, javagi-rt-0.3.0.jar
0.2.0 2009-03-04 javagi-src-0.2.0.tar.gz javagic-0.2.0.jar, javagi-rt-0.2.0.jar
0.1.0 2009-02-09 javagi-src-0.1.0.tar.gz javagic-0.1.0.jar, javagi-rt-0.1.0.jar

ChangeLog

Prototype implementation

The prototype implementation is written in Haskell and released under the GPL. Detailed installation instructions are provided in the README file distributed together with the program code.

Downloads

Version Date Source release
0.1 2009-01-19 core-javagi-0.1.tar.gz

The JavaGI Eclise Plugin (JEP) is a way to use the familiar Eclipse IDE with the new language constructs proposed by JavaGI. The aim is to provide a drop-in replacement for the Eclipse Java Development Toolkit (JDT). The functionality is still a bit rough, but you can already perform most of the basic development tasks.

In its current version, JEP supports the following features:

  1. Transforming a Java project to a JavaGI project
  2. Compiling a JavaGI project
  3. Build-path setup, just as in JDT
  4. Running a JavaGI program
  5. A basic JavaGI-aware editor
  6. (Most of the) refactorings work
  7. Ctrl-Space content assist works (in most places)

(Some of) the features JEP still doesn't support:

  1. JavaGI debugging

Within JavaGI projects you can use classes from other Java Projects and from other jars, the build path works like in JDT. You can also have a normal Java project which can use classes from JavaGI.

Getting Started

Warning: The current version of the JEP contains version 0.6.0 of the JavaGI compiler.

Development

The JavaGI Eclipse Plugin has been developed by Alina Swiderska (Email: alina DOT swiderska AT gmail DOT com

The file javagi-mode.el defines a very simple Emacs mode for JavaGI. I've tested the mode with GNU Emacs 22.3 and XEmacs 21.4.

Imprint & privacy policy // Last modified: 2023-03-13T08:46:55+01:00