dotgnu-general
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[DotGNU]Re: Java and Portable.NET


From: Marcin Krotkiewski
Subject: [DotGNU]Re: Java and Portable.NET
Date: Sat, 12 Jan 2002 22:01:52 +0100

> I've been thinking off and on about how a Java-to-IL compiler could be
> made to work, and have a bunch of rather ill-defined ideas.

I think we should give Java-.Net interoperability some more thought and
decide on how to define those "ill-defined" ideas Glenn mentioned.
Here is a more general approach.

First of all, a Java bytecode - Il bytecode compiler is not enough.
Suppose someone writes a program in Java and compiles it to IL. This
program most probably calls java system methods, not mentioning language
specific issues, like Object, String, exceptions etc. IL code produced that way
will not be portable (i.e. it will only run on Portable.NET). As Glenn
said, we would like such program to run on any .NET implementation
(including MS one), so from practical point of view such bytecode is useless.
And the same thing the other way round - C# compiled to JL, but using
NET system calls is, too, useless. Nobody will actually use these features
of Portable.NET, as it will only cause portability problems.
 
That's why I think we should implement a translation module, 
which would translate between Java<->.Net system calls and language properties 
when compiling to the other platform. 
This may not be possible in some cases (in case of non-existant
classes/methods/system types etc. on either of the platforms), or maybe it will
not be possible to do it through simple textual substitutions. 
In both cases we could either provide OpenSource, Free substitutes for missing 
classes/methods and add them to the program at compile time, or we could 
add some extra code, which would solve the compatibility issues 
(also at compile time).

This approach would allow us to compile programs transparently between both
architectures. The ability to include C# classes in Java programs and vice versa
could still be included, but in that case using it would be the programmer's
own choice.

Am I right, or maybe I am missing something important about .NET? I wouldn't
suspect MS supports JL execution in their .NET implementation.

Marcin



reply via email to

[Prev in Thread] Current Thread [Next in Thread]