CLRJVM

Embed Size (px)

Citation preview

  • 8/3/2019 CLRJVM

    1/1

    CLR & JVM

    You may wonder about how the CLR and JVM compare with each other. Here isthe answer to that

    Lets start with what CLR and JVM have in common. Firstly, both re

    responsible for executing the code produced b either ones compilers- JVM executes bytecode , while CLR does the same with IL code. Both provide facilities for memory

    management for their respective program executions, and both look after the code

    verification before letting it execute.Coming to the differences, the first is the concept of platform independence .

    Theoretically, languages running on top of CR and JVM are platform independent,

    because the code the respective compilers produce target the underlying runtime, and not

    the microprocessor. It is the underlying runtime which is different for different platforms,and thus, code written on one platform can run on another one. Practically , this concept

    is available for JVM since we have JVMs for various platforms, but as of now , the CLR

    is fundamentally designed for platform independence, as of date, due to lack of CLRs for

    various other platforms, you are still restricted to Windows.The second difference is in the binary reusability across languages under a

    runtime. As of date, ther is only one language running over the JVM Java. So, developerswanting to reap the benefits of platform independence have a learning curve before them,

    depending on their previous programming knowledge. For instance , a VB programmers

    learning curve is going to far more than that of a C++ programmer.

    On the other hand, many languages run on the CLR, prominent ones being C#,VB.NET, and VC.NET. So, a VB programmer will have almost no learning since thery

    have VB.NET developers as well. Switching to C# will have its learning curve but that

    will be highly reduced, if you are proficient in like environments like C++, Java etc.The most important implication of having many programming languages over a

    runtime like CLR, is that Microsoft has gone to the lengths of making the interoperable.We can write one module in C#, another which handles the exception in VB.NET, andthe user interface in VC.NET, and the three will execute as single entity. This is

    something similar to what COM proposed to do, But it is done in a better manner in

    .NET.So, while JVM currently scores in being practically platform independent, CLR

    is limited in the same for the reasons discussed above. But as far as language

    interoperability is concerned, CLR has a definite edge over JVM