Search code examples
javapythonprogramming-languagesbytecode

Why don't languages like java or python directly convert code in machine language like C++?


Why don't languages like java or python directly convert code in machine language like C++?:

What are the reasons for this since the fact that machine language is faster than byte code? I'm just curious.


Solution

  • For Java, the answer is portability. Compiling to machine code would reduce the amount of available platforms capable of being written for. A virtual machine is a good solution. There's a lot more information here: http://www.cs.umd.edu/~clin/MoreJava/Cycle/compile.html