Skip to content
AgileLogics

Programming glossary

Interpreter

A program that reads and runs source code directly, line by line, without a separate compile step.

Running code as it's read

Picture a live interpreter at a meeting, translating each sentence as the speaker says it rather than waiting for a finished transcript. A software interpreter works in a similar spirit. You hand it source code, and it executes the statements right away, with no executable file created along the way. That makes the edit-and-try loop very short: change a line, run again, see what happens.

Interpreters also make interactive sessions possible. Type python or node in a terminal and you get a prompt (often called a REPL, for read-eval-print loop) where each expression runs the moment you press Enter.

Trying the Python REPL

>>> total = 0
>>> for n in range(1, 4):
...     total += n
...
>>> total
6

Each line is evaluated immediately. Had the third line contained a typo, you would have found out right there, not before the session began.

Interpreted vs compiled: less clear than it sounds

Beginners often hear that Python is "interpreted" and C is "compiled." That describes the usual tooling, not the languages themselves. Real implementations mix both approaches:

  • CPython first turns your source into bytecode (the .pyc files you may spot in __pycache__ folders), then its interpreter runs that bytecode.
  • JavaScript engines such as V8 interpret code at first, then use a JIT compiler to turn hot paths into machine code.
  • PHP translates scripts into opcodes, and the OPcache extension can keep those opcodes in memory between requests.

The practical difference from a traditional compiler is that you never ship or launch a separate output file. One trade-off: some errors that a compiler would flag in advance only surface when the interpreter reaches that line.

You can experiment with an interpreter straight from your browser using the online Python editor or JavaScript editor.

Learn more

Last updated