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

Intermediate representation

  • Article
  • Rabbit hole
  • Read
  • View history
Tools
Actions
  • Read
  • View history
General
  • Recent changes
  • Related articles
  • Random discovery
This article
Reading time
3 min
Topic
Computer Science
Quality
C-class
Views
878 in 14 days
Last edited
12 Aug 2026
Print/export
  • Printable version
In other projects
  • Wikidata item
From Wikipedia, the free encyclopedia
Rabbit hole:
  1. Intermediate representation

An intermediate representation (IR) is the data structure or code used internally by a compiler or virtual machine to represent source code. An IR is designed to be conducive to further processing, such as optimization and translation.1 A "good" IR must be accurate – capable of representing the source code without loss of information2 – and independent of any particular source or target language.1 An IR may take one of several forms: an in-memory data structure, or a special tuple- or stack-based code readable by the program.3 In the latter case it is also called an intermediate language.

"Intermediate form" redirects here. For the use of the term in biology, see Transitional fossil.

A canonical example is found in most modern compilers. For example, the CPython interpreter transforms the linear human-readable text representing a program into an intermediate that allows and re-arrangement before execution. Use of an intermediate representation such as this allows compiler systems like the and to be used by many different source languages to for many different target .

graph structure
flow analysis
GNU Compiler Collection
LLVM
generate code
architectures

Loading the rest of the article…

Recent changes

Rabbit hole

Where Intermediate representation 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)
  • Intermediate language
  • Other
  • See also
  • References
  • External links
  • Recent changes
  • Rabbit hole
Contents
Contents7 sections
  • (Top)
  • Intermediate language
  • Languages
  • Other
  • See also
  • References
  • External links
  • Recent changes
  • Rabbit hole
Study aids for Intermediate representation

Terminology

IR
An intermediate representation (IR) is the data structure or code used internally by a compiler or virtual machine to represent source code.
intermediate language
In the latter case it is also called an intermediate language.

Terms the article defines in bold, quoted in context.

Categories:
  • Compiler construction
  • Programming language classification

789 words · 10 references · revision 1369059868 · CC BY-SA 4.0

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

Key concepts

  • LLVM4
  • GNU Compiler Collection3
  • Data structure2
  • Compiler2
  • Virtual machine2
  • Source code1
  • Compiler optimization1
  • Program transformation1
  • Tuple1
  • Stack (abstract data type)1

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

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

Intermediate language

An intermediate language is the language of an abstract machine designed to aid in the analysis of computer programs. The term comes from their use in compilers, where the source code of a program is translated into a form more suitable for code-improving transformations before being used to generate object or machine code for a target machine. The design of an intermediate language typically differs from that of a practical machine language in three fundamental ways:

  • Each instruction represents exactly one fundamental operation; e.g. "shift-add" addressing modes common in microprocessors are not present.
  • Control flow information may not be included in the instruction set.
  • The number of processor registers available may be large, even limitless.

A popular format for intermediate languages is three-address code.

The term is also used to refer to languages used as intermediates by some high-level programming languages which do not output object or machine code themselves, but output the intermediate language only. This intermediate language is submitted to a compiler for such language, which then outputs finished object or machine code. This is usually done to ease the process of optimization or to increase portability by using an intermediate language that has compilers for many processors and operating systems, such as C. Languages used for this fall in complexity between high-level languages and low-level languages, such as assembly languages.

Languages

Though not explicitly designed as an intermediate language, C's nature as an abstraction of assembly and its ubiquity as the de facto system language in Unix-like and other operating systems has made it a popular intermediate language: Eiffel, Sather, Esterel, some dialects of Lisp (Lush, Gambit), Squeak's Smalltalk-subset Slang, Nim, Cython, SystemTap, Vala, V, and others make use of C as an intermediate language. Variants of C have been designed to provide C's features as a portable assembly language, including C-- and the C Intermediate Language.

Any language targeting a virtual machine or p-code machine can be considered an intermediate language:

  • Java bytecode
  • Microsoft's Common Intermediate Language is an intermediate language designed to be shared by all compilers for the .NET Framework, before static or dynamic compilation to machine code.
  • While most intermediate languages are designed to support statically typed languages, the Parrot intermediate representation is designed to support dynamically typed languages—initially Perl and Python.
  • TIMI is used by compilers on the IBM i platform.
  • O-code for BCPL
  • MATLAB precompiled code
  • Microsoft P-Code
  • Pascal p-code

The GNU Compiler Collection (GCC) uses several intermediate languages internally to simplify portability and cross-compilation. Among these languages are

  • the historical Register Transfer Language (RTL)
  • the tree language GENERIC
  • the SSA-based GIMPLE. (Lower-level than GENERIC; input for most optimizers; has a compact "bytecode" notation.)

GCC supports generating these IRs, as a final target:

  • HSA Intermediate Layer
  • LLVM Intermediate Representation (converted from GIMPLE in the now-defunct llvm-gcc which uses LLVM optimizers and codegen)

The LLVM compiler framework is based on the LLVM IR intermediate language, of which the compact, binary serialized representation is also referred to as "bitcode" and has been productized by Apple.45 Like GIMPLE Bytecode, LLVM Bitcode is useful in link-time optimization. Like GCC, LLVM also targets some IRs meant for direct distribution, including Google's PNaCl IR and SPIR. A further development within LLVM is the use of Multi-Level Intermediate Representation (MLIR) with the potential to generate code for different heterogeneous targets, and to combine the outputs of different compilers.6

The ILOC intermediate language7 is used in classes on compiler design as a simple target language.8

Other

Static analysis tools often use an intermediate representation. For instance, Radare2 is a toolbox for binary files analysis and reverse-engineering. It uses the intermediate languages ESIL9 and REIL10 to analyze binary files.

See also

  • Abstract syntax tree – Tree representation of the abstract syntactic structure of source code
  • BURS
  • Bytecode – Instruction set designed to be run by a software interpreter
  • Graph rewriting – Creating a new graph from an existing graph
  • Interlingual machine translation – Type of machine translation
  • Pivot language – Intermediary language between different languages
  • Source-to-source compiler – Translator of computer source code
  • Symbol table – Data structure used by a language translator such as a compiler or interpreter
  • Term rewriting – Replacing subterm in a formula with another termPages displaying short descriptions of redirect targets
  • UNCOL

References

  1. 1Walker, David. "CS320: Compilers: Intermediate Representation" (Lecture slides). Retrieved 12 February 2016.
  2. 2Chow, Fred (22 November 2013). "The Challenge of Cross-language Interoperability". ACM Queue. 11 (10). Retrieved 12 February 2016.
  3. 3Toal, Ray. "Intermediate Representations". Retrieved 12 February 2016.
  4. 4"Bitcode (iOS, watchOS)". Hacker News. 10 June 2015. Retrieved 17 June 2015.
  5. 5"LLVM Bitcode File Format". llvm.org. Retrieved 17 June 2015.
  6. 6"MLIR".
  7. 7"An ILOC Simulator" Archived 2009-05-07 at the Wayback Machine by W. A. Barrett 2007, paraphrasing Keith Cooper and Linda Torczon, "Engineering a Compiler", Morgan Kaufmann, 2004. .

External links

  • The Stanford SUIF Group
ISBN
1-55860-698-X
  • 8"CISC 471 Compiler Design" by Uli Kremer
  • 9Radare2 Contributors. "ESIL". Radare2 Project. Archived from the original on 18 August 2015. Retrieved 17 June 2015.
  • 10Sebastian Porst (7 March 2010). "The REIL language – Part I". zynamics.com. Retrieved 17 June 2015.
  • Created
    25 Nov 2004
    History
    206 edits
    147 contributors
    No edits in the last 30 days
    Last edited
    12 Aug 2026

    206 revisions in total · 147 contributors

    1. 12 Aug 2026, 17:10 UTCDestinyokhiriamPer move: Changed link from Squeak to Squeak (programming language) using Move++30diff
    2. 17 Oct 2025, 13:33 UTCЯ сошла с умаChanging short description from "Data structure or code used internally by a compiler or virtual machine to represent source code" to "Data structure or code used by a compiler"−55diff
    3. 2 Oct 2025, 10:33 UTCTercerm§ Languages remove spam−11diff
    4. 30 Aug 2025, 07:06 UTCThunder491mBold initialism+6diff
    5. 11 Aug 2025, 13:38 UTCStevebrosharrevertedSeems overkill (death by bolding) to bold the abbreviation ... unless the abbreviation is _very_ well-known ... which IMO is not true here−6diff
    6. 11 Aug 2025, 13:34 UTCStevebroshar§ See also use Annotated link; alphabetize; normalize+138diff
    7. 20 Feb 2025, 00:57 UTCCoulomb1m§ Intermediate language Little citations+48diff
    8. 2 May 2024, 00:27 UTCPancho507§ See also add BURS+11diff

    View full revision history

    Created
    25 Nov 2004
    History
    206 edits
    147 contributors
    No edits in the last 30 days
    Last edited
    12 Aug 2026

    Go deeper: linked from this article

    • Listed under See also

      Source-to-source compiler

      Translator of computer source code

      A source-to-source translator, source-to-source compiler (S2S compiler), transcompiler, or transpiler is a type of translator that takes the source code of a program written in a programming language…

      37 min readGo deeper
    • Listed under See also

      Rewriting

      Replacing subterm in a formula with another term

      In mathematics, linguistics, computer science, and logic, rewriting covers a wide range of methods of replacing subterms of a formula with other terms.

      12 min readGo deeper
    • Linked from the introduction

      Optimizing compiler

      Compiler that optimizes generated code

      An optimizing compiler is a compiler designed to generate code that is optimized in aspects such as minimizing program execution time, memory usage, storage size, and power consumption.

      16 min readGo deeper
    • Linked from the introduction

      GNU Compiler Collection

      Free and open-source compiler for various programming languages

      The GNU Compiler Collection (GCC; formerly GNU C Compiler) is a collection of compilers from the GNU Project that support various programming languages, hardware architectures, and operating systems.

      21 min readGo deeper
    • Linked from the introduction

      Instruction set architecture

      Model that describes the programmable interface of a computer processor

      An instruction set architecture (ISA) is an abstract model that defines the programmable interface of the CPU of a computer, defining how software interacts with hardware. A device (i.e.

      14 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

      Stack (abstract data type)

      Abstract data type

      In computer science, a stack is an abstract data type that serves as a collection of elements with two main operations: Push, which adds an element to the collection, and Pop, which removes the most recently added element.

      15 min readGo deeper
    • Linked from the introduction

      Tuple

      Finite ordered list of elements

      In mathematics, a tuple is a finite sequence (or ordered list) of numbers. More generally, it is a sequence of mathematical objects, called the elements of the tuple.

      6 min readGo deeper
    • Listed under See also

      Pivot language

      Intermediary language between different languages

      A pivot language, sometimes also called a bridge language, is an artificial or natural language used as an intermediary language for translation between many different languages – to translate…

      1 min readGo deeper
    • Linked from the introduction

      LLVM

      Compiler backend for multiple programming languages

      LLVM is a set of compiler and toolchain technologies that can be used to develop a frontend for any programming language and a backend for any instruction set architecture.

      13 min readGo deeper
    • Listed under See also

      Graph rewriting

      Creating a new graph from an existing graph

      In computer science, graph transformation, or graph rewriting, concerns the technique of creating a new graph out of an original graph algorithmically.

      6 min readGo deeper
    • Listed under See also

      Bytecode

      Instruction set designed to be run by a software interpreter

      Bytecode (also called portable code or p-code) is an instruction set designed for efficient execution by a software interpreter.

      8 min readGo deeper
    • Linked from the introduction

      Virtual machine

      Software that emulates an entire computer

      In computing, a virtual machine (VM) is the virtualization or emulation of a computer system. Virtual machines are based on computer architectures and provide the functionality of a physical computer.

      13 min readGo deeper
    • Linked from the introduction

      Graph (abstract data type)

      Abstract data type in computer science

      In computer science, a graph is an abstract data type that is meant to implement the undirected graph and directed graph concepts from the field of graph theory within mathematics.

      6 min readGo deeper