The Java and C # compilers are compiled into machine code for an intermediate virtual machine that is independent of the final execution platform; JVM and CLR respectively.
The JVM was originally designed solely to support Java. Although you can compile languages other than Java to work on the JVM, there are aspects of its design that are not entirely suitable for some classes of the language. In contrast, the CLR and its instruction set were developed from day one to support a number of languages.
Another difference is how JIT compilation works. According to Wikipedia , the CLR is designed to run fully compiled code, so (presumably) the JR CLR compiler should readily compile the entire application before launching it, (I also intend that you can compile the bytecodes to your own code ahead of time.) In contrast, JVM Hotspot use true time-only compilation. The bytecode methods are initially executed by the JVM using the bytecode interpreter, which also collects information about the trace of the execution paths accepted inside the method. Those methods that are executed several times are then compiled into native code by the JIT compiler, using the obtained trace information to help optimize the code. This allows you to optimize your own code for a real execution platform, and even for the behavior of the current application execution.
Of course, the C # and Java languages have many significant differences, and the corresponding compilers differ from each other due to the need to handle these language differences. For example, C # compilers do more types of output ... because C # relies more on output types.
source share