Compilers, Interpreters and IDEs
Q. How does a program go from the code you type to the GUI you can click
on?
A. It is compiled, then interpreted.
Compiling
is the process of translating from one language to another.
- In Java, we create a .class file. The class file is in bytecode (binary
ish) code. It is translated from English looking source code to binary.
- After compilation, the meaning of the new code is the same, but you still
have no idea what the output is.
- A compiler must do syntax analysis and parse (remember parse trees?) your
code for errors.

Interpreting
is the process of executing the program. When interpretation is done, you have
output and the GUI actually appears on the screen.
- An interpreter also does syntax analysis. It decides what it means and produces
output.
- At any stage in the compilation process from language to language, if it
is interpreted, the output should be identical.

Java has
a specific interpreter and compiler associated with it.
- The Java Virtual Machine (VM) is a program that interprets Java class files
into machine code. It is what makes Java portable onto different systems (UNIX,
PCs, Apples...). Each system has a different VM.
- The JDK (Java Development Kit) is the compiler that is the basis of IDE
(Integrated Development Environment) programs like Ready to Program. It takes
your source code and translates it into a class file. Every system has a series
of IDEs - some include Dr. Java, BlueJ and NetBeans. We are going to learn
another IDE so that you can get a feel for some of the features involved in
them.
