0
votes

From my understanding the default Python interpreter (CPython) compiles source code into bytecode and then interprets the bytecode into machine code.

PyPy on the other hand makes use of JIT to optimize often interpreted bytecode into compiled machine code. How is this different then the JVM? The JVM is an interpreter + compiler. It compiles source code to bytecode and then optimizes the often interpreted bytecode into compiled machine code.

Is there any other difference?

1
The JVM is a Virtual Machine, not an interpreter + compiler. The Java compiler compiles source code to bytecode.Leon
This is really broad. A JVM and PyPy are entirely different programs. They're similar in the broad sense of both running code and both using similar technologies, but there are tons of differences on all sorts of levels. It's like asking what the differences are between two skyscrapers.user2357112 supports Monica
Not quite the same question, but close enough so that the information should be valuable. stackoverflow.com/questions/441824/…Leon

1 Answers

0
votes

(CPython) compiles source code into bytecode and then interprets the bytecode

  • CPython can eval raw source code but compile it into bytecode for more performance of interpretation.
  • PyPy also interpreter but can translate sourcecode to machine code (or C, JVM-bytecode, CIL).
  • Java compile source code to machine code of JVM. Further JVM run this code inside itself. Also JVM include JIT, which helps JVM convert currently executing byte code into machine code. Read more.