Glossary

Interpreter

An interpreter is a program that reads source code and executes it directly, in contrast to a compiler which translates the entire source into machine code before execution. Python is commonly called an interpreted language, though the reality is more nuanced: CPython first compiles source to bytecode, then interprets that bytecode on a virtual machine. The distinction matters because the compilation step catches syntax errors before any code runs.

The Python interpreter can be used interactively through the REPL (Read-Eval-Print Loop), where you type expressions and see results immediately. This interactive mode is one of Python's great strengths for exploration, debugging, and learning. You can start it by typing python or python3 at a terminal prompt.

Each Python process runs one interpreter instance. That instance maintains the runtime state: loaded modules, the call stack, the garbage collector, and (in CPython) the Global Interpreter Lock. The sys module exposes interpreter internals — the version string, the module search path, recursion limits, and reference counts. Understanding the interpreter helps you reason about performance, import behaviour, and the boundary between compile time and run time.

Related terms: CPython, Bytecode, REPL

Discussed in:

This site is currently in Beta. Please email Chris Paton (cpaton@gmail.com) with any suggestions, questions or comments.