COMPSCI 61C Lecture Notes - Lecture 12: Java Bytecode, High-Level Programming Language, Llvm
Document Summary
[easy to program; ine cient to interpret] scheme, java, c++, c, assembly, java. Bytecode, machine code [di cult to program; e cient to interpret] In general, we interpret a high-level language when e ciency is not critical and translate to a lower-level language to increase performance. Distinction without a di erence : many interpreters do just in time runtime compilation to bytecode that is either emulated or directly compiled to machine code (llvm) Interpreter: directly executes a program in the source language. Translator: converts a program from the source language to an equivalent program in another language. Could have required all programs to be re-translated from high level language. Instead, let executables contain old and / or new machine code, interpret old code in software if necessary (emulation) Interpreter closer to high-level, so you can give better error messages. Translator reaction: add extra info to help debug. Interpreter provides instruction set independence, so you can run on any machine.