====== Alternatives to compilation? ====== ===== Interpreter ===== A program that reads source code and directly executes it * does not generate the translation of the source program first {{cc09:interpreter.png|Interpreter}} ===== Compiler ===== {{cc09:compiler-purpose.png|}} Advantages of **compilers** over interpreters: * once compiled, execution can be much faster * 'carefully prepare' program for fast execution * better semantic checks: examine the entire program and report errors before program is run This is our topic. ===== Just-in-time compiler ===== {{cc09:jit-purpose.png|}} e.g. Java virtual machine and .NET virtual machine * starts by interpreting the program * later compiles the parts where speed is critical At the end of course, we will say a few words about * Java virtual machine, e.g. [[wp>garbage collection (computer science)|memory management]]