.NET To Java Compiler?!#

Whow, this looks pretty awesome: Visual MainWin For J2EE from Mainsoft features a compiler that can translate .NET Intermediate Language to Java bytecode. [Via Miguel]

Think about this. No really. I just don't get it. Surely it's not able to compile any .NET code to Java, right? That would render Mono pretty useless, since Java is free and runs on any platform. And seeing that they're using parts of Mono themselves, I guess that kind of power is out of the question. So since their (overly simplified) goal is to map ASP.NET to J2EE and ADO.NET to EJB, maybe there are limits to what you can compile on their platform. But if they got this far, why not go all the way?

I'm pretty curious how this works, it's bound to be pretty nifty since it's patent-pending (although being nifty certainly ins't a prerequisite for filing patents). Too bad they won't open the can a little so we can have a peek inside. The whitepaper just doesn't satisfy me enough ;-)

Blog | Programming | .NET | Java
Tuesday, February 17, 2004 10:03:47 PM (Romance Standard Time, UTC+01:00)
Ah, Mainsoft! The guys that leaked the Windows source code!!! :-)
Tuesday, February 17, 2004 10:11:28 PM (Romance Standard Time, UTC+01:00)
Oh yeah, this smells like one giant conspiracy. Mainsoft gets all too friendly with Linux and Java and is now trying to kill both Windows (by leaking it) and .NET (by porting it) :-D
Friday, February 20, 2004 10:39:03 PM (Romance Standard Time, UTC+01:00)
"Surely it's not able to compile any .NET code to Java, right?"

I think that you are missing the point. you need to distinguish between the language compiler and the runtime libraries that supports it.

Mainsoft's compiler translates the IL into Java byte code and it can translate almost everything except unsafe code and native code. Including stuff not supported by Java like deleagtes, byref, structures and more. However, a language without a supporting SDK (j2SE and J2EE in Java or the Framework in .NET) are useless. After all what can you do with a language without using system.io? And compiling System.IO would be illegal, wouldn't it? Not to talk about impossible, because it is using native calls.

So, the compiler is pretty complete. Mainsoft provides the Java version the BCL and all the runtime required to supported Web applications, Web Services (ASP.NET) and ADO.NET (oved JDBC). This includes System.io, system.XML, system.text, system.threading and more.

Saturday, February 21, 2004 5:32:07 PM (Romance Standard Time, UTC+01:00)
Oved, let me see if I get this straight. You're saying that you have ported a subset of the .NET BCL to Java and then your compiler translates the .NET IL to Java bytecode, right?

I guess that means translate the type declarations, basic operands (like 'ldc', 'ldloc', 'stloc', etc.), method calls and other runtime goo to Java bytecode operands. You translate as much of the IL spec as possible and calls to BCL classes and their methods are supported as long as there is a ported Java counterpart.

If you plug directly into Visual Studio .NET then I guess you have a two-stage compilation which can then fail in two places: the (insert .NET programming language of choice) to IL phase (let's call that a programmer error) and the IL to Java phase (unsupported translation, e.g. using delegates). So the developer will still get direct feedback on where it went wrong. If I'm getting it now: looks nice!

Then how does Mono fit in here? How did you use those class libraries to provide your Java counterpart API? I'm just curious about the lower level details that's all :-)
Saturday, February 21, 2004 9:15:15 PM (Romance Standard Time, UTC+01:00)
You R right on target!!

About the Mono part. We took the parts of interest, compile to IL, and converted the things we need to Java using our compiler. Some of the things we did ourselves, because the Mono part did not fit.

Takes this a long with a cool integrated java debugger and a good integration with the IDE and you have a .NET development environment for the J2EE platform.

The neat part is that if we do not support a specific namespace, then you can use the J2SE or J2EE libraries directly. We provide them as references in the IDE. So, you can have intellisense and even an integrated help. You can get help on J2SE using MSDN.

It is pretty neat to write an ASP.NET application in C# or VB.NEt and debug your app wite within WebLogic, WebSphere or Tomcat.



Wednesday, April 27, 2005 10:52:37 PM (Romance Standard Time, UTC+01:00)
We are releasing 2 versions on May:Enterprise and Developers.

The Developer Edition will enable Visual Studio .NET developers to
create ASP.NET applications for Linux and any Java-enabled platform. The
Developer Edition will be attractively priced for individual developers,
and designed for small internal deployments.


BTW, check out Mainsoft VMW4J2EE in MSDN Longhorn column
An article by:
Eric Sink -Software Craftsman, SourceGear
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/dnsoftw
are/html/software04072005.asp


best regards,
Rafael Mizrahi
Mainsoft MVP
Code .NET -> Build Java -> Run Linux
rafael mizrahi
Comments are closed.
All content © 2012, Jelle Druyts
On this page

Recent Photos
www.flickr.com
This is a Flickr badge showing public photos from Jelle Druyts. Make your own badge here.
Advertising
Top Picks
Statistics
Total Posts: 350
This Year: 0
This Month: 0
This Week: 0
Comments: 530
Archives
Sitemap
Disclaimer
This is my personal website, not my boss', not my mother's, and certainly not the pope's. My personal opinions may be irrelevant, inaccurate, boring or even plain wrong, I'm sorry if that makes you feel uncomfortable. But then again, you don't have to read them, I just hope you'll find something interesting here now and then. I'll certainly do my best. But if you don't like it, go read the pope's blog. I'm sure it's fascinating.

Powered by:
newtelligence dasBlog 2.0.7226.0

Sign In