# read–eval–print loop

> interactive software environment executing single user inputs in a given programming language

**Wikidata**: [Q2032810](https://www.wikidata.org/wiki/Q2032810)  
**Wikipedia**: [English](https://en.wikipedia.org/wiki/Read–eval–print_loop)  
**Source**: https://4ort.xyz/entity/readevalprint-loop

## Summary
A read-eval-print loop (REPL) is an interactive software environment that executes single user inputs in a given programming language. It serves as a command-line interface where users can input code, see immediate results, and iterate quickly without compiling entire programs.

## Key Facts
- The read-eval-print loop is a subclass of both processing mode and command-line interface
- It is categorized as an instance of software category and part of an interpreter
- Alternative names include REPL, interactive toplevel, and language shell
- The concept is used for interactive programming environments
- It has 19 sitelinks across different language editions of Wikipedia
- It's available in multiple programming languages including Ruby (Interactive Ruby Shell), Java (Jshell), and supported in Emacs modes for Racket and IDL (IDLWAVE)
- The freebase identifier for this concept is /m/06hqhz

## FAQs
### Q: What is the purpose of a read-eval-print loop?
A: A read-eval-print loop provides an interactive environment where users can input code snippets one at a time, immediately see the results, and make adjustments without needing to compile an entire program each time.

### Q: How does a read-eval-print loop differ from a regular command-line interface?
A: While both are text-based interfaces, a REPL specifically evaluates and executes code from a particular programming language, providing immediate feedback on the results, whereas a general command-line interface executes system commands.

### Q: Which programming languages commonly use read-eval-print loops?
A: Many languages include REPLs, such as Python's interactive shell, Ruby's Interactive Ruby Shell, Java's Jshell, and it's supported in various Emacs modes for languages like Racket and IDL.

## Why It Matters
The read-eval-print loop revolutionized how programmers interact with their code by providing immediate feedback and iterative development capabilities. Before REPLs, programmers had to compile entire programs before testing small changes, which was time-consuming and inefficient. REPLs enable rapid prototyping, debugging, and learning programming concepts in real-time. They've become essential tools in education for interactive learning, in development for quick testing of code snippets, and in various specialized applications like game development with dungeon-mode.

## Notable For
- Being a fundamental concept in interactive programming environments across multiple programming languages
- Enabling immediate code execution and feedback without full compilation cycles
- Supporting specialized implementations like dungeon-mode for creating multi-user dungeon games
- Having broad implementation in major programming languages and development environments

## Body
### Definition and Purpose
A read-eval-print loop (REPL) is an interactive computer programming environment that takes single user inputs, evaluates them, and returns the result to the user. This creates a conversational interface for programming where code can be tested incrementally.

### Components and Functionality
The "read" component accepts and parses user input
The "eval" component evaluates the input as an expression in the programming language
The "print" component outputs the result of the evaluation
The "loop" component returns to the beginning, ready for another input

### Technical Classification
As a software category, it is an instance of both processing mode and command-line interface
It serves as a part of interpreter systems
It functions as a facet of operating system environments
It is used specifically for interactive programming workflows

### Implementations Across Languages
- Interactive Ruby Shell (IRB) for Ruby programming
- Jshell for Java environments
- Support in racket-mode for Emacs users (inception: 2012)
- Integration in IDLWAVE for Interactive Data Language development (inception: 1999)

## Schema Markup
```json
{
  "@context": "https://schema.org",
  "@type": "Thing",
  "name": "Read–eval–print loop",
  "description": "Interactive software environment executing single user inputs in a given programming language",
  "sameAs": [
    "https://www.wikidata.org/wiki/Q641950",
    "https://en.wikipedia.org/wiki/Read–eval–print_loop"
  ],
  "additionalType": "Software category",
  "partOf": "Interpreter",
  "use": "Interactive programming",
  "aliases": ["REPL", "interactive toplevel", "language shell"]
}