The great thing about mono and C#
So, it seems like a ton of programs I've been trying to use recently don't work with the latest version of their dependencies. For instance, Metasploit doesn't work with Ruby >= 2.0. I was using some other program that required Python 2.0 rather than 3. And we've all heard the horror stories about programs requiring specific versions of Java.
I never have this problem with C# though. In theory, it could happen.. but Microsoft really likes keeping things compatible, it's their business plan. And as an extension of that, Mono never seems to flat-out drop support for anything in their core software. I have never seen a program that requires a specific version of .Net or Mono.
This is awesome! The worst thing I have to do with Mono is compile it from git so that I get pre-release (good) support of portable class libraries. Now, let's break this down. Why exactly is it like this though?
- C#/.Net uses compiled-to IL
- This prevents that issue of deprecating or changing misleading language features. It's all IL after compilation, so it doesn't matter
- There is a spec for .Net. In theory, if you abide by the ECMA spec, most things should work, logic-wise
- It's easy to take my dependencies with me with .Net
Now let's step through why this isn't easy with Ruby/Python
- The language is improving and getting better. This can cause old programs to break, but is unavoidable with scripting languages
- There isn't a spec that the latest version will always implement. This is probably a good thing though
- There is a huge emphasis on not taking your dependencies with you. This leads to breaking changes in gems and such breaking your program.
What about Java? Honestly, I have no idea why Java doesn't benefit more. In theory, they should be equally as capable as .Net.
Am I saying .Net is perfect? By all means, no. In fact, .Net has seen some breaking changes
- I've a JIT bug that only happens when using .Net 4.5's runtime, not .Net 2.0's
- In .Net 4.5, they changed marshaling to be more "strict", breaking at least one program I've seen (at my work)
And mono of course is (by design), not a complete copy of Microsoft's .Net. In fact, I've even seen a bug where .Net accepted a piece of IL, where Mono broke, due to Microsoft not being "strict" about the ECMA spec.
With all that being said though, this seems to be the major leg-up for compiled to bytecode languages. They'll probably work a very long time, despite the bytecode runner being updated.
This is also avoidable. I've seen some scripting language use a version number attribute, so that it can avoid this scenario. I'm sure there are other methods as well.
All I know is, I'm tired having python 2 and 3 installed on my system because not all my programs will run on just one or the other.