Compiler
ELI5 — The Vibe Check
A compiler is like a translator that reads your entire code book, converts it all into a language the CPU understands, and hands you the finished translated book. This happens before you run the program. Languages like C, Go, and Rust use compilers.
Real Talk
A compiler is a program that translates source code written in a high-level language into machine code (or an intermediate representation) before execution. The compilation process includes lexical analysis, parsing, semantic analysis, optimization, and code generation. Compiled programs generally run faster than interpreted ones because translation happens ahead of time.
Show Me The Code
# Go compiler:
go build main.go # produces ./main binary
./main # run it
# TypeScript compiler:
tsc index.ts # produces index.js
# C compiler:
gcc hello.c -o hello && ./hello
When You'll Hear This
"The compiler caught a type error before I even ran it." / "Go's compiler is famously fast."
Related Terms
Binary
A binary is a file your computer can run directly — it has already been translated from human-readable code into the 1s and 0s the CPU speaks.
Interpreter
An interpreter reads your code and runs it line by line in real time, like a live translator at a conference.
Runtime
Runtime is the environment where your code actually runs.
Static Typing
Static typing means you have to tell the computer what type each variable is when you write the code, and it checks everything is correct BEFORE running.
Syntax Error
A syntax error is when you write code that the computer cannot even understand — like handing someone a sentence with no verbs.