- - -- v a p o r w a r e -- - -

Plastic

Doing Unnatural Things to Java

Introduction

The goal of Plastic is to make it easy to add new features to the Java language. It does this by introducing the idea of compiler plug-ins. The plugins are written in plain Java. At compile time, the plug-ins are passed objects representing the entire program being compiled. They can then make changes to these objects, thereby changing the behavior of the program.

For example, a plug-in called @yield could make it easy to create new Iterators:

public Iterator getNamesIterator() {
    String[] names = {"Mary", "Fred", "Joe"};
    for (int i=0; i < names.length; ++i) {
        @yield names[i];
    }
}

Other potential uses for plug-ins include:

There are existing products to implement each of these features separately, but there is no product that can implement all of them at the same time. Plastic could.

Status

Plastic is still vaporware. I have the beginnings of a code base, but it will be at least a few months before it is ready for release.

Related Work

OpenJava -- the most similar project that I know of. OpenJava has a is based on the idea of a meta-object protocol, while Plastic is based on the idea of program-as-data.

SCID (Source Code In Database) -- also based on the idea of program-as-data, but more focused on CASE tools than language extension.

Intentional Programming -- a much more thorough attempt to solve the same problem. However no code has been released, and there have been no new articles for two years.

Contact

You can email me: kimbly - at - cybercom - dot - net.


Last updated July 4, 2001
Back to Kimberley's Code.
Back to Kimberley's Home Page.