Compiler and interpreter lexicon

Last Update: 2023-04-16

This is a collection of terms used for compilers and interpreters.

Compiler

Transforms source code into another format like machine code (assembler) or bytecode, which can be executed/interpreted later on. Examples: gcc, clang, javac.

A compiler can partially be an interpreter when using features such as constant evaluation or during optimization.

Examples for outputs: x86_64 binary, WASM or minified ECMAScript code.

Interpreter

Executes the source code. Examples: CPython, V8.

An interpreter can partially be an compiler when using methods such as JIT compilation.

Frontend

The part of the compiler/interpreter which intreprets your code and represents it in an internal format.

Backend

The part of the compiler/interpreter which executes/transforms the internal format generated by the frontend. A popular backend is LLVM.

JIT

Just-in-time compilation is a method to compile code and immediatly execute it. Examples: ECMAScript engines, JVM.

Compile-time

Operations done during compile-time are performed by the compiler. These are compile steps like parsing the code, optimizations or executing const expressions in C++.

Runtime

Operations done while the program is executed. Programming languages also have a runtime environment, which are things like multi-threading, a virtual machine (like the JVM or WASM), reflection or garbage collection.

GC

GC - Garbage collection - is responsible for freeing unused memory.

Lexer

Transforms code (text) into a token stream. Examples for tokens: identifier, integer, strings, keywords, operators. Lexers can be generated by projects such as flex or logos.

Parser

Transform token stream of the lexer into an (abstract) syntax tree.

AST

The abstract syntax tree (AST) is an representation of syntactic structure of the code (text).

Operator-precedence parser

A parser method for parsing expressions with operators which have precendence (like '+' and '*').