Baran Topal

Baran Topal


May 2024
M T W T F S S
« Feb    
 12345
6789101112
13141516171819
20212223242526
2728293031  

Categories


.NET CLR vs. Java JVM and .NET MSIL vs. Java Bytecode

baranbaran

At their core both the .NET CLR and the Java JVM are very similar platforms.  They both provide a common language independent framework that supports many possible languages on a common base.

Today C# is really the only major language using the CLR and while Java clearly the dominant language using the JVM there are a flock of new languages that are implemented on top of the JVM and thereby offer Java compatibility.  The most notable is probably Scala (used at Twitter among others).

The reason the platforms are so similar is because C# grew directly out of Java when Microsoft wished to add extensions that Sun didn’t like.  The two languages parted ways but started life from the same point, hence the great similarities.  C# has gone on to add features that Java lacks (e.g. properties and delegates) but the promise of true cross platform implementations of the CLR have remained largely ideals with 95% of CLR development happening on Windows.  The JVM has maintained that successful cross platform hold, although today most of Java is run on either a Linux server or an Android phone.

As for the byte codes (MSIL vs Java byte code) it’s been a while since I looked at those.  If memory serves they are also pretty similar, again coming from the same roots.  I think MSIL has evolved a little more as the whole .NET framework has been more willing to cast off backwards compatibility and innovate compared to Java.  That probably means greater capabilities in MSIL at the cost of smaller market share (JVMs dominate CLRs in terms of deployments).