Developer & Data Platforms

Compiler

Also known as: code compiler, compilers

A compiler is a program that translates source code written in a programming language, such as C, C++, Rust, or Go, into machine code or another lower-level form that a computer can execute.

It usually translates the whole program before it runs and catches many errors in the process. Interpreted languages, by contrast, are translated as they run. While compilers are invisible to most people, they make it possible for humans to write software in readable languages.

Compiler, explained at three levels

At home

A compiler is like a translator who converts an entire book from English into another language before anyone reads it. The computer then reads the translated version.

At work

Compilers turn developers' code into the apps and systems a business runs, and catch some bugs early.

Real-world examples

At home

Thomas wrote his first C program. The compiler flagged a missing semicolon before turning it into a program he could run.

At work

Aisha leads a Vancouver game studio's engine team. Upgrading their compiler and enabling optimizations improved game performance by about 10 percent.

How it compares

featureCompilerInterpreter
TranslatesWhole program before runningLine by line while running
SpeedUsually faster programsUsually slower
Error checkingBefore runningWhen reached
ExamplesC, C++, Rust, GoPython, JavaScript (traditionally)

Compilers translate in advance. Interpreters translate on the fly.

For analysts

In software supply-chain discussions, I'd include build tools and compilers. Attacks such as SolarWinds showed that the build process itself can be compromised.

History & origin

Grace Hopper developed the A-0 system in 1952, often called the first compiler, and championed the idea that programs could be written in English-like languages. John Backus's team at IBM delivered the first FORTRAN compiler in 1957, showing compiled code could be nearly as fast as hand-written machine code. The C language and its compilers in the 1970s made Unix portable across computers. Richard Stallman's GNU Compiler Collection (GCC) appeared in 1987, and Chris Lattner began the LLVM project in 2000 at the University of Illinois, which later underpinned Apple's Swift and Rust. In my view, compilers are among the most important and least celebrated inventions in computing.