Compiler

A compiler is a program that translates source code written by a human into machine code (or another lower-level form) that a computer can run directly.

General Programming

Compilation happens all at once before the program runs, producing an executable file. Because the translation is done up front, compiled languages like C, Rust, and Go usually run very fast.

If the source code contains syntax errors, the compiler reports them and refuses to produce a program, so many mistakes are caught before the code ever runs.

Examples

Pseudocode

source code (hello.c)
        |
   [ compiler ]
        |
  machine code (hello.exe)  -->  runs directly on CPU

Output:

An executable file is produced before the program runs.

See also

Back to the Dictionary