/ˌriːˈpl/

noun … “Interactive coding, one line at a time.”

REPL, short for Read-Eval-Print Loop, is an interactive programming environment that reads user input as source code, evaluates it, prints the result, and loops back to accept more input. It provides immediate feedback, allowing developers to experiment with language features, test functions, and inspect data structures dynamically. REPLs are common in interpreted languages such as Python, Ruby, JavaScript, and Lisp.

Operationally, a REPL performs three core stages:

  • Read: Parses user input into an internal representation, often an abstract syntax tree (AST) or Bytecode.
  • Eval: Executes the parsed code using the underlying Interpreter or runtime environment.
  • Print: Outputs the result of execution back to the user, then loops for additional input.

The REPL allows dynamic exploration of APIs, testing of small code snippets, and rapid debugging without writing complete scripts or compiling programs. For example, in Python, a developer can test a function immediately:

>> def square(x):
...     return x * x
>>> square(5)
25

This workflow demonstrates immediate evaluation: the function is defined, invoked, and the output printed without creating a separate program file. The REPL is also used in educational settings to teach programming concepts interactively, and in system administration or scientific computing for ad-hoc scripting.

From a conceptual perspective, a REPL functions like a conversation between the programmer and the computer. Each line of code is a statement, the interpreter responds instantly, and the loop continues, enabling iterative exploration, rapid prototyping, and immediate validation of ideas. It is a dynamic feedback loop that bridges human intent with machine execution.

See Interpreter, Bytecode, Python, API.