Rambling thoughts on C# on Linux

Livnat Peer just posted an interesting look at converting a large source base from C# to Java.  This was done because when Red Hat aquired the company that wrote KVM, they also got a huge .NET management application that they wanted to run on Linux.  It’s a pretty interesting look at the various approaches you could take, and how they were eventually successful.

C# on Linux is an interesting beast.  I like C# better syntactically than Java.  Properties are just too damn useful.  Having to have lots of getFoo(), setFoo() in Java when we’ve got this perfectly good key on our keyboard ‘=’ that everyone has known about since they were 7 bugs me architecturally.  It is a short coming that Java will probably never get past.

Mono, the open source C# runtime, was the only open source Just In Time Compiler (JIT) you could get your hands on a few years ago.  That made it a huge boon to language implementers, and was the defacto runtime that people would play with and hack on to build scripting engines inside over other applications.  It’s the reason you’ll see Mono specifically show up all over the place in the gaming industry.  Since that time Java went open source, under GPL, and LLVM, which is under a very permissive license, really grew up.  This gave developers interested in language design some options for VMs they could run on top of.

But, there is always another hand.  Microsoft casts a long shadow over C# on Linux.  The Mono project remains many years behind Microsoft on features, and many more years behind that on stability and performance.  While I was working on OpenSim, I was continuously frustrated by how much worse the environment performed on Linux than on Windows.  Any project that is written in C# will be relatively poor performing on Linux.  The word relative is in reference to the same code on Microsoft .NET, it’s still 20 times faster than if it was in Python.  Microsoft’s sword rattling over Linux infringing their IP ensured that the Mono community remained somewhat small and close nit, with no large organizations investing in it other than Novell.

Mono makes for some decent desktop Applications.  I use three of them on a regular basis: F-Spot, Tomboy, and Do.  I can’t function on a computer without Do any more.  But I still have a personal grudge with Mono over a simple fact: I can’t watch Netflix Instant on Linux.  There was this theory that because of the way the media framework worked that it was going to work “real soon”.  That was 3 years ago… and I’m still waiting.

C# has the basic issue that Java had for a long time, it’s a vendor language.  And that’s just a tough thing to really believe in, unless you have a sufficient reality distortion field.  Java has finally transcended that.  It took building a community process for future features and open sourcing the JVM.  Google’s entirely parallel Java implementation for Android was additional proof that it’s no longer in the hands of a single vendor.  And while Java remains far from perfect, if you are on Linux, and want performance, it’s a pretty decent approach.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s