A REPL, or Read-Eval-Print Loop, is a simple interactive computer programming environment that takes single user inputs, executes them, and returns the result to the user. It is also known as an interactive toplevel or language shell. A program written in a REPL environment is executed piecewise. REPLs can be created to support any text-based language. They are useful for interactive prototyping, mathematical calculation, creating documents that integrate scientific analysis, interactive software maintenance, benchmarking, and algorithm exploration. The most common use for REPLs outside of operating system shells is for interactive prototyping. The key features of a REPL include:
- Read: It reads the inputs from users and parses it into a data structure.
- Eval: The parsed data structure is evaluated for the results.
- Print: The result is printed after the evaluation.
- Loop: Loops the input command.
REPLs provide an interactive environment for users to access relevant features of an operating system in addition to providing access to programming capabilities. They allow programmers to work out ideas and explore problems, and because of the instant feedback, it makes it easy to improvise, nose around, and delve into what the computer is doing. The REPL is actually a part of the Jupyter project, which is a way of creating and sharing documents that contain live code, visualizations, and other fun stuff.