Interpreter
Cornell University
Compilers and Interpreters¶
Compilers¶
- translation: source program -> target program
- better performance: target program is faster
Interpreters¶
- execute the program in the most direct way
- easier to implement
Virtual Machine¶
- program written for virtual machines can be run cross-platform, as long as virtual machine is installed
- security: can limit what the program can do
Architecture of Compiler and Interpreter¶
Front End: source code -> AST -> (IR) intermediate representation
Lexical Analysis with lexer
Syntactic Analysis with parser
Semantic Analysis
Back End:
- Interpreter: executes AST or IR
- Compiler: translates IR into machine code