Professional Documents
Culture Documents
Compiled and Interpreted Languages
Compiled and Interpreted Languages
Compiled and Interpreted Languages
SAGAR REPALE
Compiler
Assembly (text)
Assembler
Relocatable Object Code (machine code without addresses) Linker/Loader Executable Code (machine code)
Compiling and Interpreting 2
#LOCAL 00000004 0000000C 00000012 00000018 00000022 00000028 #XREF_32 PRINTINT 0000002E
MOVE.W
#5,VAR1
= loader = linker
Interpreted Languages
Interpreted languages are not compiled The source code is run directly
Often compiled into a more efficient pseudolanguage just before running
Only machine code can run on the CPU, so how does an interpreted language run?
The interpreter is an executable program which interprets the source code and runs the appropriate machine code.
Output
Eval()
A key advantage of interpreted languages is that they can build and execute code on-the-fly
Essentially, the compiler is built into the interpreter program
10
11
Programming Tradeoffs
Efficiency
Assembly
C Fortran, Pascal C++ Java, Lisp Perl, Python, Ruby, etc.
Imperative
Perl
Functional
LISP, Scheme
14
15