20 Mar 2004 lupus   » (Master)

Mono vs JVM for the desktop
Both in the initial post from Havoc and in the replies some simplifications of the issues were made to keep the discussion focused and manageable, but when simplifications start blurring the data points, it's better to spell out the options we have available.
The issues to consider are technical, legal and strategic in nature and as Havoc points out each of the proposed changes to the way the Gnome desktop will be developed has stregnths and weaknesses in each of these areas. Let's see some of them.

Technical issues: as a platform, both Mono and the free software Java virtual machines are mostly on par maturity and stability-wise. gcj has currently probably the lead on portability (I guess, since it's based on gcc, but I have no hard data: anyone knows the status here?), while Mono currently has JIT ports to x86, sparc and ppc (though itanium, s390, amd64 and arm are in the works): things are moving fast on this issue in Mono, though, so I expect more ports to be completed by the end of the year.
From another point of view, Mono has better features to easily integrate with the existing codebase (P/Invoke and embeddability): I think this is important since the core libraries for Gnome are likely to continue to be written in C for the next few years.
Language independence has always been one of the strong points of Gnome and the architecture of the Mono virtual machine provides for a better foundation than the JVM: support for structures, function pointers, tail calls, etc, enable people to write compilers that target Mono and produce reasonably good code for a variety of languages. For example, while it is possible to run Java code in Mono (using IKVM) the opposite is not true. When you want to choose a platform that could be used as a base for Gnome, it's better to choose one which actually supports the use and the interoperation of different programming languages (either with compilers that target the virtual machine directly or with easy to use and implement bridges).
I won't go into the details of a C# vs Java programming language, but it looks like most people (who used to program in Java) found that C# fixed many of the issues they had with the language (though the new version of Java due out in the next few months implements some of them, too).

Legal issues: most of the legal issues are centered around the availability of the code under a free software license and on patents. The Mono code is available under the LGPL license (the runtime) and the X11 license (the class libraries). Some tools, like the C# compiler are GPL. GNU classpath is available as GPL+exception, so there doesn't seem to be any huge difference here, though Havoc cites legal issues with the use of GPL code and the proprietary JDK (to me this just means that the open source Java community needs to reimplement the relevant code as we have been doing in the mono project).
The patent issue is somewhat different: the major companies backing the CLR and C# standard agreed to RAND and royalty-free licensing of the patents needed to implement the standard. Libraries non included in the standard may have patent issues, though AFAIK no patent has been granted or claimed yet (this is a similar case as for the libraries we already use in Gnome development: no dying company claimed patents on them yet, but there is no guarantee that won't happen). This is a general issue of patents as has been pointed out multiple times, so it's not something specific to Mono. In fact there are likely several patents on Java and the JVM and no explicit license fortheir use has been granted.
So, for Mono, at least the core virtual machine and library is free from reasonable legal issues, while the JVM is not, as things are known today.
Of course, people see Microsoft as the devil and, as Havoc says, joining forces with Sun may give better results against Microsoft. I'll just note two things: both Sun and Microsoft are big companies with a variety of positions inside them. From one side, for example, Sun donated OpenOffice to the community (I consider it a contribution as big as the Linux kernel, the GNU tools and Gtk+/Gnome for the success of free software systems today) and from the other, they funded SCO, threatened JBoss etc. Microsoft, instead, is completely outside of our community; they, too, injected funds into SCO and they are competing against us. But at the same time they support the standardization of the CLR and C# as Sun never did for the JVM.
And rejecting a standard only because MS proposed it doesn't look like a rational move to me: I bet that today, 90% of the standard committees have MS representatives and a good chunk of the proposals come from them. Are we going to refuse to interoperate with the standard because of that? One of the reasons of the success of free software is that we tryed to implement standards whenever possible, to interoperate with other systems and to allow the migration from proprietary systems to open source ones.
So, in the end, it boils down to this: do you trust more someone who is ambivalent with our community and hasn't granted a license on its patents for our use, or someone who is outside, but did grant the patent license? Please don't answer that not all the possible patents on all the .Net technologies have been licensed, because I can easily reply that no patent license at all has been granted for the JVM:-) Also note that Microsoft is currently in a dominant position, but they may need to cave in on interoperability issues as a result of the antitrust case currently going to a (favorable for us) end in the EU.
I know some people will reply that they won't trust either Sun or Microsoft. What I think they are missing is that in the current patent situation any alternative technology has the same risks: it's not Sun or Microsoft the issue, but the patent system. Consider the issue this way: whichever technology we choose for the development of Gnome or of our applications and libraries, the patent risk is a constant. If instead you plot the patent and legal risk in a graph against the success of Gnome and free systems you'll find it's a steep, increasing line. If we want to be successfull in providing a free software mainstream platform we'll face patent and all sorts of legal threats (even if they are unsubstantiated, like the SCO case shows).
We'll be free of legal issues only if we become irrelevant.

Latest blog entries     Older blog entries

New Advogato Features

New HTML Parser: The long-awaited libxml2 based HTML parser code is live. It needs further work but already handles most markup better than the original parser.

Keep up with the latest Advogato features by reading the Advogato status blog.

If you're a C programmer with some spare time, take a look at the mod_virgule project page and help us with one of the tasks on the ToDo list!