44 total
By the end of this section, you should be able to:
Before a computer can run a program written in a high-level language (like Python or Pascal), it needs to understand what the instructions mean. One way to do this is with an interpreter.
An interpreter is a type of translator. However, unlike a compiler (which translates the whole program at once before running it), an interpreter works one statement at a time. It reads the first line of your program, checks whether it follows the correct rules, and then immediately carries out that instruction. Then it moves to the next line and repeats the process.
Because of this approach, an interpreter never produces a separate, permanent translated version of the program. Every time you run the program, the interpreter has to translate it all over again from scratch. No file called "object code" or "executable" is saved.
This has some important consequences:
In summary: an interpreter executes a program directly by reading, translating, and running each statement in sequence, without ever creating a standalone machine-code file.
Sign in to view full notes