This one comes up a lot - I hear it in quite a few places “Well, shame it’s in C#.”, it’s usually followed by some nebulous statement about Microsoft, followed by patent threats, embrace extend extinguish, etc etc.
So let’s start with the basics -
- C# is a ECMA and ISO standardized language. It went through the review procedures of ECMA and ISO in a standard fashion (unlike OOXML). Download the ECMA Spec here and the ISO Spec here.
- Yes, the base library is included in that standardization. The primary exceptions are, ADO.NET, ASP.NET, Web Services and Win Forms. Many of these exceptions are however separately covered via Microsoft’s Open Standards Patent program, although we’ve moved to avoiding them entirely in the standard release. (Extensions which use them are however available on the third-party utilities forge)
- The ECMA standard also includes the CIL byte code format.
- If Microsoft decide to add new extensions onto .NET (which they have done with every major release), the OpenSim developers are content to wait until those extensions are available under Mono (which moves fast enough that it isn’t a major problem).
- Microsoft is not known for breaking backwards compatibility to “extinguish” things - the mere fact you can still run Win3.1 applications on Windows Vista should give some assurances there. Microsoft is yet to make any kind of retroactive change to the .NET standard - all .NET 1.1 applications should still run under .NET 3.5 without changes. (and the cost to them of making a change like that would be significant in terms of people using applications under Windows)
- There are two completely F/OSS implementations of C#/.NET and the standard library. Mono (Licensing Concerns Addressed Here) and the FSF’s DotGNU PNET. OpenSim is regularly tested for compatibility under Mono (in fact our automated testing environment uses it). DotGNU is significantly less popular and has not been properly tested with due to not being feature complete yet. There is also a third source-availible implementation from Microsoft called Rotor, however it is not under a OSI-approved license.
- Microsoft maintains a reasonably healthy relationship with the Mono developers and has been known to collaborate in the past (such as for the development of the specialised Moonlight runtime).
The next question usually is “Well, why not write it in Java then?” the answer is multi pronged and highly likely to generate a flame war on the subject - the biggest reason is that coding the same thing in Java would probably take significantly longer to do.
Java is a beast of a language that has had layers of gunk added in every revision resulting in a hodge-podge of inconsistently named items in the standard library that may, or may not address what you want. The second major reason is that the C# standard library is both larger and more functional - the amount of time and effort the Base Class Library has saved is astonishing. Wikipedia has a nice article detailing the differences between the two languages.
However, since both Java and C# share a very similar byte code language - it is possible to do a machine driven cross-compilation so you could run OpenSim under the JVM runtime if you so wish. Source translation between the languages is also reasonably possible however requires a degree of manual work.
Some concluding facts which may actually surprise some people
- One of the largest contributors and users of the project is IBM. One of the first groups inside of IBM to get involved was IBM’s Linux Technology Center. All[?] of the IBM developers are using Linux, Emacs and Mono to develop and test.
- Approximately half the developers working on OpenSim are running under Linux/BSD. As a user base, Linux users represent approximately 80-90% of the casual testers and operators. (Windows is however much better represented in people running commercial operations)
- Our compatibility targets are Mono 1.2.5 (latest is 1.9) and .NET 2.0 - we dont use features which supercede these (although we may raise that to Mono 2.0 once it is out of beta).
Emacs?! Bah, I’m a vim user thanks very much :-). Though admittedly I actually do OpenSim coding in MonoDevelop (and occasionally with SharpDevelop if I’m stuck on a Windows box).
Justin Clark-Casey
20 Aug 08 at 6:40 pm
Hear-hear! Good to see some people understand the situation. My work is primarily a PERL shop, and is investigating other languages - the forerunners are Python and Java.
Ultimately Java will end up winning the war, but I’ve made the argument for using C# and targeting Mono - and there’s a lot of whining and gnashing of teeth from people who don’t know better and refuse to listen!
But what do you expect from a Linux shop, eh?
Will Dowling
21 Aug 08 at 11:26 am
By the reference to embrace and extend were you thinking of my post on the subject? http://www.litesim.com/blog/663
Because of course there’s a very obvious embrace and extend path in opensim itself with MS passport amongst other things. The issue is not so much the CLR platform but the license of the software itself.
Though, the use of .NET remoting is another problem, it’s a technical one rather than a political one.
Gareth Nelson
4 Sep 08 at 12:07 pm
Not really Gareth. For one, I did actually write this a full week before you wrote that.
If MS want to write a module to allow passport authentication, then by all means - the more plugins and modules the better. Remoting is something that will probably be addressed eventually, however it has provided a quick and accessible way to provide cross-network object access easily.
Adam Frisby
4 Sep 08 at 7:11 pm
“If MS want to write a module to allow passport authentication, then by all means - the more plugins and modules the better”
Of course, the issue here is that there’s a very obvious way they could use such an extension in the same old embrace and extend manner they’re famous for.
As for remoting, i’m glad to hear it’s going to be addressed - i’m curious if you’ve got any current thoughts on how?
Gareth Nelson
5 Sep 08 at 1:16 pm
Well, that’s up to them as to whether or not they want to build such a module and distribute it (the forge is ideal for third party things like that - as long as it’s OSS it’s suitable for it).
Choice isnt a bad thing - if someone wants to write something, and people want to use it then nothing should stop them from doing so.
Adam Frisby
5 Sep 08 at 6:31 pm
“Choice isnt a bad thing”
indeed
Hence why I don’t like vendor lockin.
Gareth Nelson
5 Sep 08 at 6:48 pm
Oh, and - remoting?
Gareth Nelson
5 Sep 08 at 6:48 pm
I feel C# with Mono is a compelling choice even Second Life is using Mono which says alot considering their Debian based OS. My Windows Server 2008 installations run beautifully and SQL Server 2008 is now in trials to replace the perfectly stable and fast SQL Server 2005.
G2 Proto
6 Sep 08 at 11:26 am