Compiling vs. Interpreted vs. Bytecode
Compilation (example: C)
- Create a source file (filename.c, etc)
- Give a compiler the source file as input
% gcc filename.c
- The compiler generates an executable as the output
file (a.out, etc)
- End user runs the executable
% ./a.out
Interpreted (example: Perl, php)
- Create a source file (filename.pl, etc)
- End user runs the file using the interpreter
% perl filename.perl
(Note: the php3 interpreter is part of the web server)
Bytecode (example: Java)
- Create a source file (filename.java, etc)
- Give a compiler the source file as input
% javac filename.java
- The compiler generates a byte code file
(filename.class, etc)
- End user runs the bytecode through the Java virtual machine
% java filename
mstrout@cs.ucsd.edu
.... May 25, 2000