dotgnu-general
[Top][All Lists]
Advanced

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

Re: [DotGNU]Re: Java and Portable.NET


From: Marcin Krotkiewski
Subject: Re: [DotGNU]Re: Java and Portable.NET
Date: Sun, 13 Jan 2002 20:01:42 +0100

> (Example:  In both options, you can reference 'String' and be actually
> pointing
> at the CLI System.String.  In the former case, all method references are
> to the
> CLI names and the classname returned by reflection is 'System.String'.
> In the
> latter case, it *looks* like you're referring to a normal
> java.lang.String object,
> even though its an 'enhanced' System.String object under the hood.

Okay, but programs do not consist only of internal data structures and
methods that operate on them. You need input/output too, at least ;)
How do you intend to compile this

main(){
        System.out.println("");
}

into a portable IL code?
You found a way to run java bytecode in pnet. But IL generated by my java
source compiler will *only* run on pnet and nowhere else. 
Is that what we want?

> I don't think you can solve the dual-interface problem with a shim
> layer, which is
> what I think you're proposing, unless you're planning on inserting
> translation
> thunks between all cross-language calls

basicly...yes. but only cross-language system calls.

> ... which gets really ugly if you
> try to
> write a C# class that inherits from a Java class that inherits from a C#
> class.

I don't think so. If you have the sources of all those classes, then there
is no problem at all. Translation could be done on the ilasm level, so 
the language in which each class is written doesn't matter. Still, the system
calls do matter, and those could be translated depending on output format.

> If you don't allow cross-language inheritance, you've got a smaller
> problem, but
> the resulting system is a lot less flexible.

Of course I want to allow it, I would simply like to produce IL form java 
sources,
which would run anywhere, not on pnet only. I understand this is
a tough thing to do, but maybe it's worth it? It would be certainly more
easier to do such translation from Java to .NET than the other way round,
as C# itself is much more complicated. (I also heard that MS has
supplied a porting tool from Java to .NET)

There are other options. Gopal.V mentioned GNU ClassPath. If we compiled
it to IL, we would have 100% portability... Unfortunately, we would have to
have the binaries delivered to every user on the planet ;).

Marcin


reply via email to

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