Site Overlay

Ten Teams

Translating source code with an interpreter In the old days, compilers were notoriously slow. You could feed source code to a compiler and literally come back the next morning to see if the compiler was done. If you made a single mistake in your program, you had to correct it and recompile your program all over again with another overnight wait to see if it even worked. Trying to write a program with such slow compilers proved maddening, so computer scientists created something faster called an interpreter. Just like a foreign language interpreter who listens to each sentence you speak and then translates that sentence into another language, a computer interpreter does the same thing.


Type a program command into an interpreter, and the interpreter immediately translates that command into its equivalent machine language command. Type in another command, and the interpreter translates that second command right away. The problem with interpreters is that they only store the equivalent machine language commands in memory instead of in a separate file like a compiler does.


If you want to sell or distribute your program, you have to give people your source code, along with an interpreter that can convert your source code into machine language commands. Because giving away your source code essentially means giving away your program, everyone who wants to sell their programs uses a compiler instead of an interpreter.