World Library  
Flag as Inappropriate
Email this Article

Intermediate language


Intermediate language

In computer science, 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:

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.


  • Intermediate representation 1
  • Languages 2
  • Other 3
  • See also 4
  • References 5
  • External links 6

Intermediate representation

An Intermediate representation (IR) is a data structure that is constructed from input data to a program, and from which part or all of the output data of the program is constructed in turn. Use of the term usually implies that most of the information present in the input is retained by the Intermediate representation, with further annotations or rapid lookup features.

A canonical example is found in most modern compilers, where the linear human-readable text representing a program is transformed into an intermediate graph data structure that allows flow analysis and re-arrangements before starting to create the list of actual CPU instructions that will do the work. Use of an Intermediate representation allows compiler systems like GNU GCC and LLVM to be targeted by many different source languages, and support generation for many different target architectures.


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), Haskell (Glasgow Haskell Compiler), Squeak's Smalltalk-subset Slang, Cython, Seed7, SystemTap, Vala, 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 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 a high level that targets the IBM System i platform.

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

The LLVM compiler framework is based on the LLVM IR intermediate language, which has been productized by Apple as "bitcode".[1][2]

The ILOC intermediate language[3] is used in classes on compiler design as a simple target language.[4]


Other static analysis tools are using an intermediate representation.

For instance, radare2 is a toolbox for binary files analysis and reverse-engineering. It uses the intermediate languages ESIL[5] et REIL[6] to analyze binary files.

See also


  1. ^ "Bitcode (iOS, watchOS)". Hacker News. 10 June 2015. Retrieved 17 June 2015. 
  2. ^ "LLVM Bitcode File Format". Retrieved 17 June 2015. 
  3. ^ "An ILOC Simulator" by W. A. Barrett 2007, paraphrasing Keith Cooper and Linda Torczon, "Engineering a Compiler", Morgan Kaufmann, 2004. ISBN 1-55860-698-X.
  4. ^ "CISC 471 Compiler Design" by Uli Kremer
  5. ^ The radare2 contributors. "ESIL". radare2 project. Retrieved 17 June 2015. 
  6. ^ Sebastian Porst (7 March 2010). "The REIL language – Part I". Retrieved 17 June 2015. 

External links

  • The Stanford SUIF Group
This article was sourced from Creative Commons Attribution-ShareAlike License; additional terms may apply. World Heritage Encyclopedia content is assembled from numerous content providers, Open Access Publishing, and in compliance with The Fair Access to Science and Technology Research Act (FASTR), Wikimedia Foundation, Inc., Public Library of Science, The Encyclopedia of Life, Open Book Publishers (OBP), PubMed, U.S. National Library of Medicine, National Center for Biotechnology Information, U.S. National Library of Medicine, National Institutes of Health (NIH), U.S. Department of Health & Human Services, and, which sources content from all federal, state, local, tribal, and territorial government publication portals (.gov, .mil, .edu). Funding for and content contributors is made possible from the U.S. Congress, E-Government Act of 2002.
Crowd sourced content that is contributed to World Heritage Encyclopedia is peer reviewed and edited by our editorial staff to ensure quality scholarly research articles.
By using this site, you agree to the Terms of Use and Privacy Policy. World Heritage Encyclopedia™ is a registered trademark of the World Public Library Association, a non-profit organization.

Copyright © World Library Foundation. All rights reserved. eBooks from Project Gutenberg are sponsored by the World Library Foundation,
a 501c(4) Member's Support Non-Profit Organization, and is NOT affiliated with any governmental agency or department.