Field Guide · concept

Also known as: interpreter

An interpreter is a program that reads source code and executes it directly, statement by statement, every time the program runs — instead of translating the whole program to a native binary ahead of time the way a compiler does.1

line 1 line 2 line 3 interpreter runs now result
The interpreter reads each statement and executes it immediately, with no separate build step.

How it works

A pure interpreter walks the source program and performs each operation as it encounters it. In practice most modern “interpreted” languages take a half-step first: they compile the source to compact bytecode for a virtual machine, and the VM interprets that bytecode. CPython, for example, compiles .py files to .pyc bytecode and runs it on the Python VM. Either way, translation happens during execution rather than once up front.1

Trade-offs

Interpretation inverts the compiled story. Execution is slower, because the interpreter adds overhead to every operation, and the user must have the interpreter installed.1 In exchange you get fast iteration — no separate build step, so you edit and re-run instantly — and flexibility, including the runtime dynamism that dynamic typing allows and interactive read-eval-print loops (REPLs). JIT compilation is a hybrid that keeps the portable bytecode but compiles hot paths to native code to recover speed.

In practice

Python, Ruby, and classic JavaScript are the canonical interpreted languages. Their flexibility and quick edit-run cycle make them popular for scripting, data work, and rapid prototyping, where developer speed matters more than raw execution speed.

Sources

  1. Interpreter (computing) — Wikipedia, on how interpreters execute source or bytecode at run time and their trade-offs versus compilation.  2 3

See also