4 ms·
You could just use Java as the example: Compiled to bytecode, which is executed by a runtime interpreter. So: It's compiled & interpreted.
by kerblang 4y ago
You could just use Java as the example: Compiled to bytecode, which is executed by a runtime interpreter. So: It's compiled & interpreted.
- svieira 4y agoCompiled to bytecode which is executed by a runtime interpreter which traces the values passing through sections of it and uses those values to perform additional runtime optimizations on the newly annotated code and compile the new representation into machine code (or faster interpreted code). So you're right twice!
- tsimionescu 4y agoIf it were that simple, I would simply say that Java is compiled, while JVM byte code is interpreted. However, JVM bytecode is actually both interpreted and JIT compiled depending on runtime performance and other parameters. The JVM can even switch between compilation and interpreting for the same piece of code multiple times (most commonly, when attaching a debugger and hitting a breakpoint).
- sigjuice 4y agoThere are Java compilers that emit machine code.