In-Depth

Crossing the Divide

Paolo De Nictolis straddles disparate yet connected worlds. He's a Web developer who programs with PHP in Visual Studio (VS), and a systems administrator running apps in a world of heterogeneous server farms.

"When it comes to quickly prototyping an application and then having the possibility to evolve it to enterprise scale, no IDE offers you such a friendly and fit-to-you environment as Visual Studio 2005," he observes. "Other IDEs require you to think about the language you use and about the IDE itself; with Visual Studio 2005, you have such an intuitive way to build infrastructure code, you can concentrate on application goals, business logic and what you want to reach using your programming [and domain knowledge], not about how to reach it."

On the other hand, acknowledges De Nictolis, as a sys admin you can't simply "impose" your preferred operating system and enclose yourself in a Windows box.

As a developer, De Nictolis faced what he terms a "bad choice": either abandon Visual Studio and all his experience working with it, or always use a Windows server to host ASP.NET applications.

The problem was that the interoperability tools out there -- IIOP.NET, JNBridge, J-Integra -- generally were not visual environments.

Then De Nictolis discovered Grasshopper, a free Visual Studio plug-in for porting Web and server .NET applications to J2EE servers. Grasshopper enables .NET developers to cross-compile Microsoft IL to Java bytecode, using the open source Mono Project's class libraries.

Mono (http://www.go-mono.org) is an open source implementation of portions of the .NET Framework, including the C# and the Common Language Infrastructure, which are open standards as specified under Ecma-334 and Ecma-335. The project is funded by Novell Inc., which acquired Mono's sponsor Ximian in 2003. Mono 1.0 shipped in 2004; the latest build is Mono 1.2.

De Nictolis downloaded Mainsoft's Grasshopper 2.0 Technology Preview and used it to develop a prototype of an ASP.NET 2.0 accounting application running on Linux. He built the prototype, dubbed JExpenses for JavaWorld, using Visual Studio 2005, an integrated Java debugger, and IBM Corp.'s Cloudscape database (instead of Microsoft SQL Server). "You can continue to use Microsoft SQL Server, he says, "but basically a DBMS is a DBMS." (Mature database applications are not interchangeable.)

Grasshopper 2.0 is the result of a three-year collaboration between Mainsoft Corp. and the Mono Project; the VS add-in uses the open source Mono runtime. Mainsoft released the Grasshopper 2.0 Technology Preview 2 (http://dev.mainsoft.com), which is bundled with the Apache Tomcat Web server, in January. The latest version adds support for VS2005 and ASP.NET 2.0 development. The company launched Grasshopper in May 2005, and 17,000 developers have downloaded it, reports Mainsoft President Yaacov Cohen.

"We enable companies with existing investments in .NET, in .NET code, in .NET skills to be able to use these skills even inside of the J2EE application server or an enterprise Java portal," explains Cohen.

Mainsoft offers an enterprise edition, Visual MainWin for J2EE, which uses some of the open source Mono libraries, and supports J2EE servers (IBM WebSphere Application Server and BEA WebLogic Server). A Portal edition enables developers to expose ASP.NET and Web Parts technology (SharePoint) and recompile the .NET code to run natively on an IBM WebSphere Portal Server. Mainsoft is an IBM partner.

"If you access .NET services remotely, you end up having two classes of applications," says Cohen.

Develop Once
De Nictolis' challenge was hardly unique. Mergers and acquisitions, reorganizations, Web applications and legacy apps have made heterogeneous server environments a reality. "The chances of getting below three platforms in a large enterprise are slim to none," says Michael Goulde, a senior analyst at Forrester Research.

Michael GouldeCross-platform .NET development is a niche requirement. "But there are certain applications in a lot of these companies where it would be a lot easier to develop it once instead of having to develop it multiple times," says Goulde.

For .NET developers, Mono is the development framework that holds the most promise, Goulde asserts. Many other approaches require proprietary libraries, and that's where they start to fall apart.

Best of Both Worlds
Mono enables Windows .NET developers to code in C# or VB.NET using Visual Studio and .NET 1.1 or 2.0 development technologies, and then compile and run .NET code base on multiple platforms, including Windows, Linux, Sun Solaris, Unix and Mac OS X. Mono supports multiple languages, and both open source and commercial compilers. In February, Mono released the Mono Visual Basic Compiler, which .NET developers can use to program in Visual Basic.NET. The new compiler is written in Visual Basic and is "self-hosting."

"The situation is that we're binary-compatible. We have tools that are similar to Windows so we're very close in terms of compatibility," explains Miguel de Icaza, founder of the Mono Project, and vice president of developer platforms at Novell. "Windows developers typically use Visual Studio. We don't have Visual Studio for Linux, we only have the underlying tool chain.

"What we've been trying to do is build some tools so that developers can do these things from Windows, and it's my hope that later this year we'll have tools that will allow you to do everything in Windows without ever having to learn anything about Linux, so that you only do the testing on Linux, but you debug and compile what you develop from Windows.

"It's a hunch that we have. We think that once we do that, we're going to get more users, but we don't have really hard data," he says.

In December, Mono launched MoMA, the Mono Migration Analyzer. "In three months, we've received 15,000 submissions," says de Icaza. "We got information about what APIs people are using today, and in the last two months we've implemented 2,000 P/I calls. We estimate that if we keep going through this list, in the next four months we're going to be able to port 50 percent of the .NET applications to Linux. The other 50 percent are more complex, which requires changing of the application, and a little more portability work on the part of the developer."

Project members are working to provide more tools for Windows developers, but the Mono ecosystem is much larger than just Microsoft APIs, de Icaza notes: "We've developed a lot of APIs that are Unix-, Linux-, desktop- or Gnome-specific. Some of those APIs have been ported to Windows and are used in Windows as well; some are too specific to be ported."

In the short term, the Mono team is working on shipping a .NET 2.0 compatible runtime that will likely come in stages. The first stage will include the core and ASP.NET 2.0 support. "This is almost ready and we're going into beta in a couple of months," says de Icaza. The second stage, expected by the end of the year, will provide complete Windows Forms 2.0 support.

Some Mono subprojects include work with .NET 3.0 technologies, specifically CardSpace, Windows Communication Foundation and Windows WorkFlow Foundation -- but the Windows Presentation Foundation API is not among them.

Ports in a Storm
Confusion about intellectual property, reverse engineering and Microsoft's looming presence has helped keep Mono out of many corporate environments.


The different LINQ modules
[click image for larger view]
The Mono Stack includes more than just Microsoft APIs, some of which can be ported to Windows.

"There are people who back off from Linux for the same reasons," says Forrester's Goulde.

Novell's de Icaza says Mono was developed with an eye toward such concerns. "Microsoft published everything related to .NET so that developers can digest the APIs," he says. "What we've done is the same thing that Linux has done. They take the published APIs and use them in their open source platform.

"We've implemented Mono strictly from published documentation," he says. "Microsoft hasn't told us about any infringements. We have a strict policy. If anyone is concerned that we're infringing on their IP, not only Microsoft but anyone else, we will be happy to remove that stuff."

Microsoft's mixed messages on open source are clouding the issue, however. Most developers who are keenly interested in the ideas of cross-platform or platform independence have moved to the Java camp, says Mark Driver, research vice president at Gartner Inc. "There has been a long assertion that if one is leveraging .NET then it's a Windows-only play."

But there's confusion because much of the infrastructure of .NET is designed like Java, with the potential of being cross-platform. "Microsoft was even going so far as to submit portions of the CLR to standards bodies, which of course are going to focus on open platforms," says Driver, "but Microsoft's business strategy right now is Windows-only"

"The problem is that the [CLR] isn't enough," according to Driver, who says 90 percent of components and libraries on top of the runtime are proprietary to Microsoft. And that's where the legality question comes in. Although what Mono did is perfectly legal, he says, "In this day and age with all the copyright issues out there and patents, there's an awful lot of people who feel that Microsoft could shut that project down if they want to."

Microsoft is reaching out to the open source community to some extent. Microsoft and Novell shocked the industry when the companies announced a series of agreements addressing customer requirements for Windows and Linux interoperability: The collaboration, according to the companies, will involve technology, service and support, and a five-year patent cooperation agreement that covers Mono, Samba, OpenOffice.org and .NET and Windows Server. According to a Microsoft spokesperson, under the agreement, the company is "pledging not to assert its patents against individual, non-commercial open source developers."

"Part of the deal says that Microsoft won't go after any of Novell's customers for any perceived patent infringements -- it doesn't say [it] won't sue Novell," says Gartner's Driver.

"You have to look at the potential there," observes Forrester's Goulde, "that Microsoft will recognize that one of the big competitive challenges it has is not just Linux, it's also Java. And with the whole notion of write once, test and run anywhere, Microsoft could probably benefit from a similar kind of story, and that's really what Mono would do."

"My position with Microsoft and others is not to be afraid of open source. We can work together," says de Icaza.

Redmond is making moves that loosely reflect de Icaza's sentiment. Sam Ramji, Microsoft's director of the Open Source Software Lab, put out a call in January for resumes to staff up a Microsoft/Novell interoperability lab. Developers will collaborate on projects related to virtualization and identity management.

"There are currently no plans between Microsoft and Novell for collaboration on Mono," says de Icaza. However, Novell set aside "a chunk of money for future collaborations." Mono is among the 100 or so other development groups vying for the funding.

Microsoft's position on Mono remains unclear. It's very unpredictable, says Goulde, and that's one of the reasons Novell hasn't made vast investments in it. "Microsoft will probably never directly have a hand in it, but there are things that Microsoft could do to make it simpler and more straightforward for the Mono project to not just complete functionality, but also to be current with the current release of the .NET Framework. "[Microsoft is] not leaning that way," he says.

Realistically, what the agreements show is that the two companies are at least talking, Driver says: "The right people are behind closed doors and could potentially warm up Microsoft about Mono."

For its part, Novell is serious about Mono. All of its apps are Mono-based and the company would like to officially drive Mono into the mainstream. "It's too risky," says Driver. "Novell would love to have a set of certifications and compatibility tests, just like with Java."

Windows World
Cross-platform development technology has been around for a while, and most corporate environments use multiple platforms, so why isn't it more mainstream? In the .NET world, the short answer is Microsoft.

Many corporations use Mono, asserts de Icaza, but have policies against "endorsements" so the information is not available publicly. A notable exception is financial services powerhouse Fiducial, which is running its trading system on Mono.

If you're committed to .NET and a Microsoft approach to application development, and you have Linux in your environment, "you should be all over Mono," advises Forrester's Goulde. "Even if you're not using Mono, you should be intimately familiar with it and should have someone in your organization on the mailing lists, as well as the discussions."

However, the early innovators all the way to the early majority are willing to take more aggressive risk management positions on these technologies. "The technology itself is very impressive, but the better mousetrap doesn't always win," says Gartner's Driver. "It has got to be delivered to the market in a context that provides low enough business risk to justify how sexy the technology is, and right now the perception of Mono is that it is not quite there yet." He adds that if Mono takes off, the real loser long-term is Java, not Microsoft.