go to previous page   go to home page   hear noise   go to next page


Java. All the time (and expense) of getting the program to run on other computers is avoided. (Actually, the issue is not quite so clear-cut as this.)


Programs written in a high level language are never directly executed by the processor. You have already seen one way to execute such a program: use a translator to create a machine language program that can be executed directly.

Another way to is to use an interpreter for the language. An interpreter is a program that acts like a processor that can directly execute a high level language.

This is a fairly complicated thought. The figure might help:

Interpreting a source program

In this figure, the source program "program.bas" has been written in BASIC (a programming language) by a programmer with a text editor. It is being interpreted by the BASIC interpreter, which is running on the processor. The BASIC interpreter reads each command in the source program and does what it says.

You have probably done this many, many times without realizing it. It is exactly accurate (although an unusual use of the words) to say that the computer game DOOM (or any other game) is an interpreter for the commands that the user enters using the mouse and keyboard. The commands for the game DOOM are not the usual type of commands used in a general purpose programing language, but none the less, they are commands. The user enters commands, and the interpreter (the game) executes them one by one. The set of commands and the rules for how to use them correctly form a programming language for the DOOM interpreter.

When DOOM is running in "demo mode" (a sample game played without user input) it is in fact running a program written in the DOOM language. This program is not being directly processed by the Pentium chip in your computer. The DOOM game is interpreting it command by command.


An interpreter runs directly on the processor. What type of instructions must an interpreter consist of?