Technical Overview of the CLR
Well, both have features that make them usefull but, mostly depends of the kind of language to implement, so is convenient to be consent of what the language needs to perform.
the article Technical Overview of the Common Language Runtime by Erik Meijer and Jim Miller, is a comparison between JVM (Java Virtual Machine) and CLI (Command Line Interface).
The main difference is that the CLI is a platform that supports a big range of languages.
About the JVM, is usual to think that it is only a runtime environment for Java programs, but as an example of the opposite, some variants of LISP uses JVM for its execution.
Some of the important consideratios with implementation of alternative paths for native compilers are:
Portability: This is, using an intermediate language you need n + m translators instead of n * m translators (n languages in m platforms).
Compactness: Intermediate code is more compact than the original source.
Efficiency: you can adapt the dynamic behavior of the program delaying the commitment to a specific native platform.
Security: Intermediate code is more amenable to deploy.
Interoperability: sharing a common type system and high-level execution environment, becomes easier than binary interoperability.
Flexibility: Combining high level intermediate code with metadata enables some features like: dynamic code generation.
Some of the points in the article about CLI and JVM:
*JVM does not provide encoding type-unsafe
* In the JVM all storage locations are 4 bytes wide
* In the CLI, storage locations are polymorphic, this means that the wide could be 4 bytes or longer.
*In the CLI the generic types can readjust the value size according with the current processor.
*JVM is that it does not indicate overflow during operations on integer data types
* CLI provides built-in support for boxing and unboxing, it means, a value can be turned into reference type object and viceversa.
Well, both have features that make them usefull but, mostly depends of the kind of language to implement, so is convenient to be consent of what the language needs to perform.