Is it possible to limit what compiler compiles to
1.4
so it can do it cleanly? Just Generics?
We cannot legally do this unless there is a platform
specification that describes this version of the
language. JLS2 doesn't allow generics, and JLS3 will
have ALL the new language features. What would be the
TCK compatibility requirements for this hybrid
language?
neal,
i agree with you, but the idea is to promote features like
generics, auto-boxing ... by providing a way compile
with j2sdk 1.4 rutime.
I think the wrong way is to use the flag -version with the value
1.5, because what we want is an hybrid language.
the compiler could recognize instead the value "1.4hybrid"
that enable some features of the java 1.5 that works
with j2sdk1.4 runtime.
If i examine the java 1.5 feature list :
- for-each loops could use java.lang.Iterable,
=> use Iterator instead.
- StringBuilder
=> replace by StringBuffer
- generics uses Signature attributes,
=> only at compile time, so provide a jar
with all generics signature for compilation
in the same way that you provide it for the
"adding_generics" compiler prototype.
- bridge attributes,
=> currently works with -version 1.4
- varargs or new flags on the class files
=> Oups, this issue embarassing me,
i propose that all new flag could have their byte-code
attributes counterpart.
- auto-boxing/unboxing
use new Integer() instead of Integer.valueOf()
- enum & annotation
=> too closely linked with new java.lang classes,
no support provided.
...
I'm very happy to see retroweaver available!
yes, me too.
R?mi Forax