Skip to content
Main menu
  • Main page
  • Discover
  • Unexpected connections
  • Topics
  • Random article
  • Search
Your library
  • Saved articles
  • Recent discoveries
  • Rabbit-hole trails
Topic areas
  • Computer Science
  • Mathematics
  • Physics
  • Engineering
  • Biology
  • Economics
  • Curiosities
WikiholeDeeper into Wikipedia
EnglishEN
  • Saved
  • History

  • Article text and media come live from Wikipedia via the official MediaWiki API and are available under the Creative Commons Attribution-ShareAlike 4.0 License; additional terms may apply. Each article links to its source and revision.
  • WikiHole is an independent project and is not affiliated with the Wikimedia Foundation.
  • How ranking works
  • All topics
  • Reading history
  • Random article
  • MediaWiki API

Interpreter (computing)

  • Article
  • Rabbit hole
  • Read
  • View history
Tools
Actions
  • Read
  • View history
General
  • Recent changes
  • Related articles
  • Random discovery
This article
Reading time
7 min
Topic
Computer Science
Quality
C-class
Views
1.8k in 14 days
Last edited
14 Aug 2026
Print/export
  • Printable version
In other projects
  • Wikidata item
From Wikipedia, the free encyclopedia
Rabbit hole:
  1. Interpreter (computing)
Interpreter (computing)
Software that executes source code directly

In computing, an interpreter is software that executes source code without first compiling it to machine code. An interpreted runtime environment differs from one that processes CPU-native executable code which requires translating source code before executing it. An interpreter may translate the source code to an intermediate format, such as bytecode. A hybrid environment may translate the bytecode to machine code via just-in-time compilation, as in the case of .NET and Java, instead of interpreting the bytecode directly.

Before the widespread adoption of interpreters, the execution of computer programs often relied on compilers, which translate and compile source code into machine code. Early runtime environments for and could parse source code directly. Thereafter, runtime environments were developed for languages (such as , , , , and ), which translated source code into an intermediate format before executing to enhance .

Lisp
BASIC
Perl
Raku
Python
MATLAB
Ruby
runtime performance

Code that runs in an interpreter can be run on any platform that has a compatible interpreter. The same code can be distributed to any such platform, instead of an executable having to be built for each platform. Although each programming language is usually associated with a particular runtime environment, a language can be used in different environments. Interpreters have been constructed for languages traditionally associated with compilation, such as ALGOL, Fortran, COBOL, C and C++.

Loading the rest of the article…

Recent changes

Rabbit hole

Where Interpreter (computing) leads. Every connection below has a source: a link in this article, a shared Wikipedia category, or CirrusSearch text similarity. Articles already on your trail are left out.

Contents
  • (Top)
  • History
  • Use
  • Efficiency
  • Implementation
  • Example
  • Just-in-time compilation
  • Variations
  • See also
  • References
  • Sources
  • External links
  • Recent changes
  • Rabbit hole
Contents
Contents13 sections
  • (Top)
  • History
  • Use
  • Efficiency
  • Implementation
  • Example
  • Just-in-time compilation
  • Variations
  • See also
  • References
  • Sources
  • External links
  • Recent changes
  • Rabbit hole
Study aids for Interpreter (computing)

Terminology

interpreter
In computing, an interpreter is software that executes source code without first compiling it to machine code.
Commands and scripts
Commands and scripts: Interpreters are frequently used to execute commands and scripts
Virtualization
Virtualization: An interpreter acts as a virtual machine to execute machine code for a hardware architecture different from the one running the interpreter.
Emulation
Emulation: An interpreter (virtual machine) can emulate another computer system in order to run code written for that system.
Sandboxing
Sandboxing: While some types of sandboxes rely on operating system protections, an interpreter (virtual machine) can offer additional control such as blocking code that violates security rules.
Self-modifying code
Self-modifying code: Self-modifying code can be implemented in an interpreted language.
Control table interpreter
Control table interpreter: Logic is specified as data formatted as a table.
Bytecode interpreter
Bytecode interpreter: Some interpreters process bytecode which is an intermediate format of logic compiled from a high-level language.
Threaded code interpreter
Threaded code interpreter: A threaded code interpreter is similar to bytecode interpreter but instead of bytes, uses pointers.
Abstract syntax tree interpreter
Abstract syntax tree interpreter: An abstract syntax tree interpreter transforms source code into an abstract syntax tree (AST), then interprets it directly, or uses it to generate native code via JIT compilation.

Terms the article defines in bold, quoted in context.

Categories:
  • Interpreters (computing)
  • Programming language implementation

1,648 words · 16 references · revision 1369367199 · CC BY-SA 4.0

General
  • Recent changes
  • Related articles
  • Random discovery
This article
Reading time
7 min
Topic
Computer Science
Quality
C-class
Views
1.8k in 14 days
Last edited
14 Aug 2026

Key concepts

  • Lisp (programming language)3
  • Bytecode2
  • Just-in-time compilation2
  • C++2
  • Unified Modeling Language1
  • Computing1
  • Software1
  • Execution (computers)1
  • Source code1
  • Compiling1

The articles this one links to most, weighted towards the introduction.

Print/export
  • Printable version
In other projects
  • Wikidata item

History

In the early days of computing, compilers were more commonly found and used than interpreters because hardware at that time could not support both the interpreter and interpreted code and the typical batch environment of the time limited the advantages of interpretation.1

Interpreters were used as early as 1952 to ease programming within the limitations of computers at the time (e.g. a shortage of program storage space, or no native support for floating point numbers). Interpreters were also used to translate between low-level machine languages, allowing code to be written for machines that were still under construction and tested on computers that already existed.2 The first interpreted high-level language was Lisp. Lisp was first implemented by Steve Russell on an IBM 704 computer. Russell had read John McCarthy's paper, "Recursive Functions of Symbolic Expressions and Their Computation by Machine, Part I", and realized (to McCarthy's surprise) that the Lisp eval function could be implemented in machine code.3 The result was a working Lisp interpreter which could be used to run Lisp programs, or more properly, "evaluate Lisp expressions".

The development of editing interpreters was influenced by the need for interactive computing. In the 1960s, the introduction of time-sharing systems allowed multiple users to access a computer simultaneously, and editing interpreters became essential for managing and modifying code in real-time. The first editing interpreters were likely developed for mainframe computers, where they were used to create and modify programs on the fly. One of the earliest examples of an editing interpreter is the EDT (Editor and Debugger for the TECO) system, which was developed in the late 1960s for the PDP-1 computer. EDT allowed users to edit and debug programs using a combination of commands and macros, paving the way for modern text editors and interactive development environments.

Use

Notable uses for interpreters include:

Commands and scripts
Interpreters are frequently used to execute commands and scripts
Virtualization
An interpreter acts as a virtual machine to execute machine code for a hardware architecture different from the one running the interpreter.
Emulation
An interpreter (virtual machine) can emulate another computer system in order to run code written for that system.
Sandboxing
While some types of sandboxes rely on operating system protections, an interpreter (virtual machine) can offer additional control such as blocking code that violates security rules.
Self-modifying code
Self-modifying code can be implemented in an interpreted language. This relates to the origins of interpretation in Lisp and artificial intelligence research.

Efficiency

Interpretive overhead is the runtime cost of executing code via an interpreter instead of as native (compiled) code. Interpreting is slower because the interpreter executes multiple machine-code instructions for the equivalent functionality in the native code. In particular, access to variables is slower in an interpreter because the mapping of identifiers to storage locations must be done repeatedly at run-time rather than at compile time.4 But faster development (due to factors such as shorter edit-build-run cycle) can outweigh the value of faster execution speed—especially when prototyping and testing when the edit-build-run cycle is frequent.45

An interpreter may generate an intermediate representation (IR) of the program from source code in order to achieve goals such as fast runtime performance. A compiler may also generate an IR, but the compiler generates machine code for later execution whereas the interpreter prepares to execute the program. These differing goals lead to differing IR design. Many BASIC interpreters replace keywords with single byte tokens which can be used to find the instruction in a jump table.4 A few interpreters, such as the PBASIC interpreter, achieve even higher levels of program compaction by using a bit-oriented rather than a byte-oriented program memory structure, where commands tokens occupy perhaps 5 bits, nominally "16-bit" constants are stored in a variable-length code requiring 3, 6, 10, or 18 bits, and address operands include a "bit offset". Many BASIC interpreters can store and read back their own tokenized internal representation.

Implementation

Since the early stages of interpreting and compiling are similar, an interpreter might use the same lexical analyzer and parser as a compiler and then interpret the resulting abstract syntax tree.

Example

An expression interpreter written in C++.

import std;

using std::runtime_error;
using std::unique_ptr;
using std::variant;

// data types for abstract syntax tree
enum class Kind: char { 
    VAR, 
    CONST, 
    SUM, 
    DIFF, 
    MULT, 
    DIV, 
    PLUS, 
    MINUS, 
    NOT 
};

// forward declaration
class Node;

class Variable { 
public:
    int* memory; 
};

class Constant {
public:
    int value; 
};

class UnaryOperation {
public:
    unique_ptr<Node> right; 
};

class BinaryOperation { 
public:
    unique_ptr<Node> left;
    unique_ptr<Node> right;
};

using Expression = variant<Variable, Constant, BinaryOperation, UnaryOperation>;

class Node {
public:
    Kind kind;
    Expression e;
};

// interpreter procedure
[[nodiscard]]
int executeIntExpression(const Node& n) {
    int leftValue;
    int rightValue;
    switch (n->kind) {
        case Kind::VAR:
            return std::get<Variable>(n.e).memory;
        case Kind::CONST:
            return std::get<Constant>(n.e).value;
        case Kind::SUM:
        case Kind::DIFF:
        case Kind::MULT:
        case Kind::DIV:
            const BinaryOperation& bin = std::get<BinaryOperation>(n.e);
            leftValue = executeIntExpression(bin.left.get());
            rightValue = executeIntExpression(bin.right.get());
            switch (n.kind) {
                case Kind::SUM: 
                    return leftValue + rightValue;
                case Kind::DIFF: 
                    return leftValue - rightValue;
                case Kind::MULT: 
                    return leftValue * rightValue;
                case Kind::DIV: 
                    if (rightValue == 0) {
                        throw runtime_error("Division by zero");
                    }
                    return leftValue / rightValue;
            }
        case Kind::PLUS: 
        case Kind::MINUS: 
        case Kind::NOT:
            const UnaryOperation& un = std::get<UnaryOperation>(n.e);
            rightValue = executeIntExpression(un.right.get());
            switch (n.kind) {
                case Kind::PLUS:
                    return +rightValue;
                case Kind::MINUS:
                    return -rightValue;
                case Kind::NOT: 
                    return !rightValue;
            }
        default: 
            std::unreachable();
    }
}

Just-in-time compilation

Just-in-time (JIT) compilation is the process of converting an intermediate format (i.e. bytecode) to native code at runtime. As this results in native code execution, it is a method of avoiding the runtime cost of using an interpreter while maintaining some of the benefits that led to the development of interpreters.

Variations

Control table interpreter
Logic is specified as data formatted as a table.
Bytecode interpreter
Some interpreters process bytecode which is an intermediate format of logic compiled from a high-level language. For example, Emacs Lisp is compiled to bytecode which is interpreted by an interpreter. One might say that this compiled code is machine code for a virtual machine – implemented by the interpreter. Such an interpreter is sometimes called a compreter.78
Threaded code interpreter
A threaded code interpreter is similar to bytecode interpreter but instead of bytes, uses pointers. Each instruction is a word that points to a function or an instruction sequence, possibly followed by a parameter. The threaded code interpreter either loops fetching instructions and calling the functions they point to, or fetches the first instruction and jumps to it, and every instruction sequence ends with a fetch and jump to the next instruction. One example of threaded code is the Forth code used in Open Firmware systems. The source language is compiled into "F code" (a bytecode), which is then interpreted by a virtual machine.
Abstract syntax tree interpreter
An abstract syntax tree interpreter transforms source code into an abstract syntax tree (AST), then interprets it directly, or uses it to generate native code via JIT compilation. In this approach, each sentence needs to be parsed just once. As an advantage over bytecode, AST keeps the global program structure and relations between statements (which is lost in a bytecode representation), and when compressed provides a more compact representation. Thus, using AST has been proposed as a better intermediate format than bytecode. However, for interpreters, AST results in more overhead than a bytecode interpreter, because of nodes related to syntax performing no useful work, of a less sequential representation (requiring traversal of more pointers) and of overhead visiting the tree.

See also

  • Dynamic compilation
  • Homoiconicity – Characteristic of a programming language
  • Meta-circular evaluator – Type of interpreter in computing
  • Partial evaluation – Technique for program optimization
  • Read–eval–print loop – Computer programming environment

References

  1. 1"Why was the first compiler written before the first interpreter?". Ars Technica. 8 November 2014. Retrieved 9 November 2014.
  2. 2Bennett, J. M.; Prinz, D. G.; Woods, M. L. (1952). "Interpretative sub-routines". Proceedings of the ACM National Conference, Toronto.
  3. 3According to what reported by Paul Graham in Hackers & Painters, p. 185, McCarthy said: "Steve Russell said, look, why don't I program this eval..., and I said to him, ho, ho, you're confusing theory with practice, this eval is intended for reading, not for computing. But he went ahead and did it. That is, he compiled the eval in my paper into IBM 704 machine code, fixing bug, and then advertised this as a Lisp interpreter, which it certainly was. So at that point Lisp had essentially the form that it has today..."
  4. 4This article is based on material taken from Interpreter at the Free On-line Dictionary of Computing prior to 1 November 2008 and incorporated under the "relicensing" terms of the GFDL, version 1.3 or later.
  5. 5. . Retrieved 2022-09-16.

Sources

  • Aycock, J. (June 2003). "A brief history of just-in-time". ACM Computing Surveys. 35 (2): 97–113. CiteSeerX 10.1.1.97.3985. doi:10.1145/857076.857077. S2CID 15345671. {{cite journal}}: Cite uses deprecated parameter |citeseerx= (help)

External links

  • IBM Card Interpreters page at Columbia University
  • Theoretical Foundations For Practical 'Totally Functional Programming' (Chapter 7 especially) Doctoral dissertation tackling the problem of formalising what is an interpreter

There are various compromises between the development speed when using an interpreter and the execution speed when using a compiler. Some systems (such as some Lisps) allow interpreted and compiled code to call each other and to share variables. This means that once a routine has been tested and debugged under the interpreter it can be compiled and thus benefit from faster execution while other routines are being developed.6

9
10
11
Template interpreter
Rather than implement the execution of code by virtue of a large switch statement containing every possible bytecode, while operating on a software stack or a tree walk, a template interpreter maintains a large array of bytecode (or any efficient intermediate representation) mapped directly to corresponding native machine instructions that can be executed on the host hardware as key value pairs (or in more efficient designs, direct addresses to the native instructions),1213 known as a "Template". When the particular code segment is executed the interpreter simply loads or jumps to the opcode mapping in the template and directly runs it on the hardware.1415 Due to its design, the template interpreter very strongly resembles a JIT compiler rather than a traditional interpreter, however it is technically not a JIT due to the fact that it merely translates code from the language into native calls one opcode at a time rather than creating optimized sequences of CPU executable instructions from the entire code segment. Due to the interpreter's simple design of simply passing calls directly to the hardware rather than implementing them directly, it is much faster than every other type, even bytecode interpreters, and to an extent less prone to bugs, but as a tradeoff is more difficult to maintain due to the interpreter having to support translation to multiple different architectures instead of a platform independent virtual machine/stack. To date, the only template interpreter implementations of widely known languages to exist are the interpreter within Java's official reference implementation, the Sun HotSpot Java Virtual Machine,12 and the Ignition Interpreter in the Google V8 JavaScript execution engine.
Microcode
Microcode provides an abstraction layer as a hardware interpreter that implements machine code in a lower-level machine code.16 It separates the high-level machine instructions from the underlying electronics so that the high-level instructions can be designed and altered more freely. It also facilitates providing complex multi-step instructions, while reducing the complexity of computer circuits.
"Compilers vs. interpreters: explanation and differences"
IONOS Digital Guide
  • 6Nanz, Sebastian; Furia, Carlo A. (May 2015). "A Comparative Study of Programming Languages in Rosetta Code". 2015 IEEE/ACM 37th IEEE International Conference on Software Engineering. pp. 778–788. arXiv:1409.0252. doi:10.1109/icse.2015.90. ISBN 978-1-4799-1934-5.
  • 7Kühnel, Claus (1987) [1986]. "4. Kleincomputer - Eigenschaften und Möglichkeiten" [4. Microcomputer - Properties and possibilities]. In Erlekampf, Rainer; Mönk, Hans-Joachim (eds.). Mikroelektronik in der Amateurpraxis [Micro-electronics for the practical amateur] (in German) (3 ed.). Berlin: Militärverlag der Deutschen Demokratischen Republik, Leipzig. p. 222. ISBN 3-327-00357-2. 7469332.
  • 8Heyne, R. (1984). "Basic-Compreter für U880" [BASIC compreter for U880 (Z80)]. radio-fernsehn-elektronik (in German). 1984 (3): 150–152.
  • 9AST intermediate representations, Lambda the Ultimate forum
  • 10Kistler, Thomas; Franz, Michael (February 1999). "A Tree-Based Alternative to Java Byte-Codes" (PDF). International Journal of Parallel Programming. 27 (1): 21–33. CiteSeerX 10.1.1.87.2257. doi:10.1023/A:1018740018601. ISSN 0885-7458. S2CID 14330985. Retrieved 2020-12-20. {{cite journal}}: Cite uses deprecated parameter |citeseerx= (help)
  • 11Surfin' Safari - Blog Archive » Announcing SquirrelFish. Webkit.org (2008-06-02). Retrieved on 2013-08-10.
  • 12"openjdk/jdk". GitHub. 18 November 2021.
  • 13"HotSpot Runtime Overview". Openjdk.java.net. Retrieved 2022-08-06.
  • 14"Demystifying the JVM: JVM Variants, Cppinterpreter and TemplateInterpreter". metebalci.com.
  • 15"JVM template interpreter". ProgrammerSought.
  • 16Kent, Allen; Williams, James G. (April 5, 1993). Encyclopedia of Computer Science and Technology: Volume 28 - Supplement 13. New York: Marcel Dekker, Inc. ISBN 0-8247-2281-7. Retrieved Jan 17, 2016.
  • Created
    28 Jun 2002
    History
    967 edits
    553 contributors
    No edits in the last 30 days
    Last edited
    14 Aug 2026

    967 revisions in total · 553 contributors

    1. 14 Aug 2026, 15:00 UTCComp.archmNo edit summary+3diff
    2. 5 Jun 2026, 20:18 UTCRopoxWikimrevise short description to make it inline with other programming articles−21diff
    3. 3 Jun 2026, 21:51 UTCCitation botAlter: title, template type, journal. Add: isbn, arxiv, chapter. Removed URL that duplicated identifier. Removed access-date with no URL. Removed parameters. Some additions/deletions were parameter name changes. | Use this bot. Report bugs. | Suggested by Headbomb | #UCB_toolbar−43diff
    4. 20 May 2026, 01:22 UTCTemporary accountUpdated short description+1diff
    5. 16 May 2026, 19:29 UTCIra LevitonmFixed a reference. Please see Category:CS1 errors: dates.+1diff
    6. 16 May 2026, 06:56 UTCTemporary accountsupport the claim that there are trade-offs between interpreter development speed and compiler execution speed.+339diff
    7. 16 Apr 2026, 23:08 UTCComp.archmNo edit summary−10diff
    8. 16 Apr 2026, 09:42 UTCAnnh07mReverted 1 edit by ~2026-23394-04 (talk) to last revision by Martinm07−2,818diff

    View full revision history

    Created
    28 Jun 2002
    History
    967 edits
    553 contributors
    No edits in the last 30 days
    Last edited
    14 Aug 2026

    Go deeper: linked from this article

    • Linked from the introduction

      MATLAB

      Numerical computing environment and programming language

      MATLAB (Matrix Laboratory) is a proprietary multi-paradigm programming language and numeric computing environment developed by MathWorks.

      16 min readGo deeper
    • Linked from the introduction

      Python (programming language)

      General-purpose programming language

      Python is a high-level, general-purpose programming language that emphasizes code readability, simplicity, and ease-of-writing with the use of significant indentation, an extensive ("batteries-included") standard library, and garbage collection.

      53 min readGo deeper
    • Linked from the introduction

      Compiler

      Software that translates code from one programming language to another

      In computing, a compiler is software that translates computer code written in one programming language (the source language) into another language (the target language).

      25 min readGo deeper
    • Linked from the introduction

      Computing

      Activity involving calculations or computing machinery

      Computing is any goal-oriented activity that requires, benefits from, or creates computing machinery.

      19 min readGo deeper
    • Linked from the introduction

      Central processing unit

      Central computer component that executes instructions

      A central processing unit (CPU), also known as a central processor, main processor, or simply processor, is the primary processor in a given computer.

      38 min readGo deeper
    • Linked from the introduction

      Lisp (programming language)

      Programming language family

      Lisp (historically LISP, an abbreviation of "list processing") is a family of programming languages with a long history and a distinctive, fully parenthesized prefix notation.

      32 min readGo deeper
    • Linked from the introduction

      C++

      General-purpose programming language

      C++ is a high-level, general-purpose programming language created by Danish computer scientist Bjarne Stroustrup.

      24 min readGo deeper
    • Linked from the introduction

      Fortran

      General-purpose programming language

      Fortran (formerly FORTRAN) is a third-generation, compiled, imperative programming language designed for numeric computation and scientific computing.

      42 min readGo deeper
    • Linked from the introduction

      C (programming language)

      General-purpose programming language

      C is a general-purpose programming language created in 1972 by Dennis Ritchie.

      38 min readGo deeper
    • Linked from the introduction

      Ruby (programming language)

      General-purpose programming language

      Ruby is a general-purpose programming language designed with an emphasis on programming productivity and simplicity. In Ruby, everything is an object, including primitive data types.

      22 min readGo deeper
    • Linked from the introduction

      BASIC interpreter

      Interpreter that enables users to enter and run programs in the BASIC language

      A BASIC interpreter is interpreter software that enables users to enter and run programs in the BASIC language and was, for the first part of the microcomputer era, the default application that computers would launch.

      43 min readGo deeper
    • Linked from the introduction

      Raku (programming language)

      Programming language derived from Perl

      Raku is a member of the Perl family of programming languages. Formerly named Perl 6, it was renamed in October 2019. Raku introduces elements of many modern and historical languages.

      18 min readGo deeper
    • Linked from the introduction

      COBOL

      Programming language with English-like syntax

      COBOL (Common Business-Oriented Language;) is a compiled English-like computer programming language designed for business use.

      48 min readGo deeper
    • Linked from the introduction

      ALGOL

      Family of programming languages

      ALGOL (short for "Algorithmic Language") is a family of imperative computer programming languages originally developed in 1958.

      14 min readGo deeper