harmony-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Tim Ellison <t.p.elli...@gmail.com>
Subject Re: [classlib] Switching to a 5.0 compiler
Date Wed, 05 Apr 2006 12:51:51 GMT
Geir Magnusson Jr wrote:
> Tim Ellison wrote:
>> A while ago we agreed to switch to a class library compilation story
>> that would allow us to use 1.5 Java syntax on a 1.4-compatible VM (i.e.
>> using syntax that is erased by the compiler).
>> Here's where I'm at...
>> Using the Sun compiler:
>> Specifying source=1.5 and target=1.4 (understandably) fails as an
>> invalid option set, but there is an undocumented and unmaintained option
>> that, AIUI, was introduced during the syntax transition to full 1.5
>> support.  On Sun-based compilers we can specify source=1.5 target=jsr14
>> and get some support for erased 1.5 syntax.
> Ok
>> Using the Eclipse compiler:
>> In the Eclipse JDT UI you *can* specify source=5.0 target=1.4 and I
>> successfully ran code written using generics on a 1.4 VM.  However, the
>> Eclipse batch compiler does not allow this source=5.0 target=1.4
>> combination; and when I asked why the answer was that the UI usage is
>> wrong and will be fixed to prevent that combination.
> LOL!  How about suggesting that users find it useful right now?

My understanding is that there is a spec compliance issue, hence...

>> Unless we void the warranty on the compiler by making non-API calls into
>> their code we cannot therefore use the Eclipse to do back-level
>> compilations.
> Warranty?  From Eclipse?  <chuckle>

(that was a joke BTW, I guess it needed a winky)

my point is that we could hack the Eclipse batch compiler to make it do
something it is not meant to do (source=1.5 target=1.4).  If we get
burnt then we'll have nobody to complain to ;-)

>> Geir voted -1 to the proposal if it meant that we could only use one
>> compiler, so I have looked around thought a bit more about it ...
>> Using RetroWeaver:
>> Retroweaver (retroweaver.sourceforge.net) is a bytecode weaver that
>> takes 1.5 class files and modifies them to run on 1.4-compatible VMs.
>> It is BSD-licensed.
>> The weaver does a bit more than we actually want in that it not only
>> rewrites the class file format (to remove class literals, synthetic
>> access specifiers etc) but also replaces references to some runtime
>> dependencies (replaces StringBuilder with StringBuffer,
>> Float.valueOf(float), etc.)
> <geir runs away screaming>

Come back, take a deep breath.
This would only be doing what the source=1.5 target=1.4|jsr14 is doing.

> [SNIP]
>> Comments?
> Thanks for doing this.
> It seems like we have two options - Sun and Eclipse, and because the
> eclipse compiler is CDDL, and can be integrated into our build system,
> we seem to be safe.

As it stands we have no option to use the Eclipse batch compiler
(without tweaking it and therefore I assume bringing a modified JAR into
our SVN for people to use etc. -- yuk!)

> Sun isn't going to change, I'd bet, and in the event Eclipse does, we
> simply fork it. :)
> This really is a temporary situation.  Maybe the thing to do is
> 1) get as much non-1.5 things done as possible this week or two (yes, I
> know it's "Java 5" now, but  calling it 1.5 is a good parallel to 1.4)

We should do this anyway.

> 2) do a snapshot and also make a branch, for discussion sake call it
> branch_1.4, which is unsupported and not an official objective of the
> project

Hmm, you mean branch so that VMs can implement the VMI to that level
before moving on to 1.5?

> 3) In head, get going w/ erasable 5 stuff under the assumption that
> we'll be able to use Sun and Eclipse, for a while anyway.

... and use a source=1.5 target=1.5 compiler setting, and run it on...a
new IBM VME?  Is that what you were thinking?

> 4) If anyone feels sufficiently motivated, they can add to branch_1.4 if
> we get more good code that we'd want to make available to the other 1.4
> VMs out there, but again, it's not something we as a project would
> commit to do - people could work on it as they see fit...

I see more people chomping at the bit to use 5.0 syntax rather than
continue on 1.4 -- we are just waiting for the VMs to catch up ;-)



Tim Ellison (t.p.ellison@gmail.com)
IBM Java technology centre, UK.

Terms of use : http://incubator.apache.org/harmony/mailing.html
To unsubscribe, e-mail: harmony-dev-unsubscribe@incubator.apache.org
For additional commands, e-mail: harmony-dev-help@incubator.apache.org

View raw message