In fact, depending on the language features you use, it may even be possible to compile down to an older CLR version, as the new language features are often simply syntactic sugar for some code generation that happens behind the scenes.
Re:Android Ported to C#
by bunderbunder on Tuesday May 01, 2012 @07:49PM
(#3916871)
That's exactly what's happening. All versions of .NET since version 2.0 are primarily library updates. They can all safely run on the same CLR, and there haven't had to be any changes to the CLR to enable new language features. A computer really only needs to have a second version of the CLR installed in order to run code that targets .NET 1.x
This isn't true. .NET 4.0 and on use a different runtime than 2.0, 3.0, and 3.5.
Re:Android Ported to C#
by bunderbunder on Tuesday May 01, 2012 @10:00PM
(#3917282)
I stand corrected. Thanks.
> (running newer code in older vms).
That's pretty much how Java works too. In general, you can't take code compiled with a newer version and run it on an older VM. You will get class version mismatch errors.. they update the class version every time there's an incompatible change, such as when 'enum' became a keyword.
The compatibility that Sun, err.. Oracle, strives for is to be able to mix code compiled with old & new versions without issues.
This translates to "compatible, except in the case most people would and should not care about" (running newer code in older vms).
This is far better than SUN's idea of Java forever keeping compatibility with old VMs with makes the language stagnate.