ONLamp.com    
 Published on ONLamp.com (http://www.onlamp.com/)
 See this if you're having trouble printing code examples


Mono: A Progress Report

by Edd Dumbill
08/09/2007

Mono is an open source implementation of the Microsoft .NET platform. More properly, it's an implementation of the ECMA 335 Common Language Infrastructure standard, along with work-alike implementations of various parts of Microsoft's .NET libraries.

The project was conceived in 2001 by Miguel de Icaza of GNOME fame, while working at Ximian, the start-up he co-founded with Nat Friedman. Ximian was acquired by Novell in 2003, and Mono became an important part of their strategy. De Icaza is still very much Mono's figurehead and inspiration, as well as a hands-on coder.

Mono 1.0 was released in 2004. Back then we were seeing it positioned in two ways: as a migration strategy from Window to Linux, using the work-alike implementations of technologies such as ASP.NET, and as a full and free development stack for Linux, with GTK used for the windowing toolkit.

Three years later, it's a good time to check in on those original directions and see where the Mono project is now.

Mono as a Linux Development Stack

When I first used Mono, I was most excited about it as a platform for writing GTK+ desktop applications, for Linux or any other place that runs GTK. The GNOME desktop itself had been primarily programmed in C for a long time; working in C# and Mono was a pleasure by comparison.

Along with others, I harbored strong hopes of Mono becoming one of the mainstream choices, if not the main choice, for programming the GNOME desktop. After all, the Mono project itself was an important point in Miguel de Icaza's search for a sane object programming model, which underpinned much of GNOME.

Unfortunately, despite a handful of excellent applications such as a the F-Spot photo manager and the Banshee music player, this hasn't really come to pass in any widespread way. Looking back on when I wrote Seven Cool Mono Apps in October 2004, it looks sadly like the excitement may have peaked around then.

figure
Figure 1. The Banshee music player playing music from a shared DAAP server

A lot of time is still wasted by desktop developers laboring with their C programs, and if, in fact, any higher level language has taken a hold, it's Python. (On my Ubuntu desktop, 168 packages depend on Python's GTK 2 support, as opposed to 44 on Mono's Gtk# 2).

There are various reasons for this inertia, among them the comparative aimlessness of the GNOME project in recent years, the suspicion many free software developers still have of Mono, the limit to the number of new desktop applications anybody actually needs, and the general move to web-based applications.

The desktop is, of course, a subset of possible Linux applications, but the story for Linux open source as a whole isn't too different. As I'll explain below, large chunks of the .NET open source world are compatible with Mono, but Mono hasn't really impacted its historic base of Linux much. De Icaza, like every prophet, is not always honored in his own town.

Interestingly, one of the common factors that holds back platform adoption, documentation and tools, isn't a problem for Mono. The MonoDevelop IDE is of good quality, and there are plentiful docs thanks to eager documenters, and, of course, Microsoft's own MSDN library.

Mono as a Windows Migration Strategy

Because of its implementation of ASP.NET and Windows Forms, Mono is well-positioned to help companies migrate away from an all-Windows infrastructure to running on Linux. Many Windows .NET applications run unchanged, or with slight tweaks, under Mono.

In the early years we, perhaps, suffered from the hubris of believing this was a way of routing companies towards a completely open source infrastructure. Had this been true, and given Mono's legal vulnerability in their implementation of non-standardized parts of .NET such as ASP.NET, it's fair to say we'd have seen Microsoft shut this down a while back. This may certainly be part of the reason that Novell seems to have soft-pedaled on Mono, rather than aggressively pushing it forward as a development platform.

The actual effect of Mono seems to have been to draw together the two worlds of Windows and Linux better. Rather than a migration route, the result has been to provide a unification route. (You could argue that unification is the first step to migration, of course, but with the rapidly evolving world of software-as-a-service we are likely to find events overtaking us and completely different models of enterprise application provision taking hold.)

Mono has been as much a carrier for the .NET world and ideas into Linux as it has been a carrier for Linux into the Windows world. The .NET world has its own open source ecosystem, which has integrated well with the Mono ecosystem to the benefit of both groups. One of the key drivers for writing open source is in maximizing its usefulness, and Mono allows .NET projects to be truly cross platform.

One of the costs to Mono in keeping open the bridge from Windows is that Microsoft itself is constantly evolving its own platform. To stay viable as a migration or unification technology, Mono must keep pace as much as it can. Inevitably this has drawn the project ever closer to the Microsoft roadmap, without the same emphasis placed on the Linux side of the development stack.

Mono as an Ongoing Political Statement

Due to the need to track .NET continually, there is a sense in which Mono seems like it's forever running to catch Microsoft up. For every new initiative and technology that Microsoft releases, Mono has to say "I can do that too," and prove its mettle. The energy that goes into this is astounding: witness the recent Moonlight sprint to replicate Microsoft's challenger to Flash, Silverlight.

Miguel de Icaza has two points to prove. To Microsoft, Mono demonstrates the power of open source and to some extent keeps them honest in their standardization of the CLI. (Though any standards hack will likely tell you that ECMA has the least stringent criteria on openness of all standardization bodies.) Miguel has been a constant advocate for open source to Microsoft and doubtless has contributed to Microsoft's embrace of open source in certain parts of its operations.

The second point Mono makes is one directed at the free software world. Miguel de Icaza is a passionate pragmatist. His commitment to open source is core to his work, but he doesn't find the "us and them" mentality to be a productive one. A recent blog posting of his concerning criticism of Microsoft's shared source licenses demonstrates this perfectly, in which he asserts the right to be pro-open source without having to be partisan. Whatever your viewpoint on the matter, Miguel's ability to dance with the devil and maintain his integrity is admirable.

Again though, there's a cost here. Mono can sometimes seem as if one of the main purposes of its existence is as a rhetorical device. With all its snapping at Windows' heels and demonstrations of how neat some of Microsoft's ideas are, Mono has failed to become a platform technology in its own right.

I will admit to having been strongly sold on the idea of using all the free side of Mono, with Gtk# for UI, but there's been little innovation or leadership there. Novell has never implemented any degree of product management, or evangelism, that aims at popularizing Mono with open source developers. It's probably not overstating the case too much to say that what adoption there has been is down to Miguel's own energy and blogging.

Mono on the Web

In recent years, much development work, whether in-house, proprietary, or open source, has switched to the Web. What role does Mono play there?

Mono's implementation of ASP.NET, Microsoft's web templating and integration technology, has been a vital part of its strategy. In fact, one of the first Mono success stories to be cited was a large application in the City of Munich running ASP.NET. The traditional stronghold of Linux is the server room, and Mono's ASP.NET support is an attractive way for organizations to migrate their web and application servers over to commodity Linux hardware. Mono has kept pace with ASP.NET, and now runs a large number of ASP.NET applications.

figure
Figure 2. MonoDevelop editing a freshly-created ASP.NET application

Its importance notwithstanding, ASP.NET is pretty much the only game in town for Mono web development. That means free software developers must step outside the security of Microsoft's "royalty free and non-discriminatory" licensing terms on the ECMA-standardized technology. While there are some emerging frameworks such as Jitsu or Dream, there's no practical alternative to ASP.NET in the same way that Python, say, offers Django, Turbogears, Pylons, Zope, and friends.

However, we may find this changing in the future. Microsoft's efforts to bring Python and Ruby to .NET, by virtue of the Dynamic Language Runtime (DLR), means that the ecosystems of Ruby on Rails and Django will become available at some point to .NET and Mono. How practical this will be remains to be seen, but there are encouraging signs. Check out this screenshot of Django on IronPython, running under Mono.

Indeed, we may find one day that these dynamic languages run faster and more reliably on the DLR than in their C-based version. On the Java side of the fence, there are rumblings that JRuby, for instance, could become faster than regular Ruby itself.

Mono has an important role to play on the Web, but it's strongly tied to making ASP.NET applications available to non-Windows platforms.

Mono as an Experimental Platform

The Common Language Infrastructure is an important platform for experimentation with programming languages and runtimes. Both inside and outside of Microsoft, the CLI has brought with it some interesting innovation in language design: not least C#. Because Mono is open source, it provides a very attractive route to undertake experimentation. It's pleasing and exciting to see new and experimental languages and environments growing up around Mono, some of which will graduate to commercial application.

The Mono runtime is also interesting as an alternative to Java for embedding purposes, both in hardware and software, and has received some uptake. For instance, at the beginning of this year, an MP3 player embedding Mono won an award at CES. Mono's port to the ARM processor has led to its use, at least in experimentation, on small Linux devices such as the Linksys NSLU2 network storage device or Nokia internet tablets. A managed runtime such as Mono or Java brings a lot more convenience to developing for embedded devices than just plain C/C++.

Conclusions

Mono is a thriving project, which continues to be significant in both the open source and the commercial .NET development worlds. From the start, its proximity to Microsoft's technology and intellectual property has caused controversy, and this has not receded to date.

As a framework for pure Linux development, Mono has not achieved its initial promise, as it has been dogged by concerns over its legal vulnerabilities and lack of vision to become a Linux platform. In the second component of its mission, to bring Windows closer to Linux, Mono has blossomed, and in doing so has also brought Linux closer to Windows.

We must now see Mono in the same sort of light we see the Samba project, as an important bridge to bring Windows and Linux platforms together. While some migrations will be achieved, it's integration that is the more likely outcome. Samba has ensured Linux servers an important entry point into Windows networks. Mono will ensure that, both in the web development sphere of ASP.NET, and likely in the future Rich Internet Applications being targeted by Silverlight, Linux is not left out in the cold.

Though areas of Mono are still incomplete with respect to fully implementing the contemporary .NET platform, there's a lot that works in production today and no reason to doubt the Mono project team's determination in reaching near-complete .NET compatibility.

Edd Dumbill is co-chair of the O'Reilly Open Source Convention. He is also chair of the XTech web technology conference. Edd conceived and developed Expectnation, a hosted service for organizing and producing conferences. Edd has also been Managing Editor for XML.com, a Debian developer, and GNOME contributor. He writes a blog called Behind the Times.


Return to ONLamp.

Copyright © 2009 O'Reilly Media, Inc.