This is the mail archive of the
java@gcc.gnu.org
mailing list for the Java project.
Re: generic type support
Tom Tromey wrote:
"Geert" == Geert Bevin <gbevin at uwyn dot com> writes:
Geert> I know that generic types are only planned to be included in the Sun
Geert> JDK as of release 1.5. However with the current develop preview JSR-14
Geert> implementation it's already possible to comfortably use the language
Geert> extension currently and apparently many already do so. Are there any
Geert> plans to support for this in gcj?
As far as I know, nobody is working on this.
We'd definitely be interested in an implementation.
And it will be difficult. I spent an entire semester working on adding
the starts of supporting generics in jikes, and only got generic classes
partially working (well, the hardest part of that was rewriting the
proposed grammar in an LALR(1) form). Generic methods is another step
that I would love to get working as well, but I don't have time this
semester if I want to graduate. Then there are plans for type-safe
enumerations, autoboxing of primitives, a foreach construct ("for
(String s : list) {...}" replacing "for (Iterator i = list.iterator();
list.hasNext(); ) { String s = (String) i.next(); ...}". So there are a
lot of proposed front-end changes in the upcoming JDK 1.5 - JSR 14 and 201.
And there are bytecode changes proposed as well - such as increasing
limitations in the .class file to allow things such as more than 64k
bytes per method, and allowing CONSTANT_Class info structures to be
compile time constants like CONSTANT_Strings - JSR 202. Gcj would need
to be taught about the available extensions, and the interpreter would
need to be updated to accept them.
The gcj .java front end needs serious work. Sometimes I daydream
about somehow using the jikes front end instead; that might be the
most efficient route to fixing all our bugs :-/
Tom
Using jikes as a front end might work - if you can figure out how to
convert the type information associated with its abstract syntax tree
into the tree structure that the gcc backend expects. But licensing is
a different issue, as jikes is NOT GPL'd, but IBM open source license.
--
This signature intentionally left boring.
Eric Blake ebb9 at email dot byu dot edu
BYU student, free software programmer