{
  "schema_version": "1.0",
  "codex": "thecodex.expert/coding",
  "type": "concept",
  "slug": "how-languages-work/compilation",
  "name": "Compilation",
  "section": "How Languages Work",
  "canonical_definition": "Compilation is the process by which a compiler translates source code written in a high-level programming language into a lower-level representation — typically machine code or an intermediate representation — by performing lexical analysis, syntactic parsing, semantic analysis, optimisation, and code generation as a series of sequential transformation passes over the source text.",
  "confidence": "high",
  "last_verified": "2026-06-01",
  "source_count": 5,
  "url": "https://thecodex.expert/coding/how-languages-work/compilation/",
  "pipeline_stages": ["lexical analysis", "syntactic parsing", "semantic analysis", "IR generation", "optimisation", "code generation", "linking"],
  "concept_relationship": {
    "requires_first": ["foundations/how-computers-work", "foundations/binary-and-number-systems"],
    "enables": ["languages/c", "languages/cpp", "languages/rust", "languages/go", "how-languages-work/type-systems"],
    "commonly_confused_with": ["interpretation (not a binary distinction — many languages use both)"]
  },
  "sources": [
    {"num": 1, "citation": "Aho, A. V., Lam, M. S., Sethi, R. & Ullman, J. D. (2006). Compilers: Principles, Techniques, and Tools (2nd ed.). Pearson.", "tier": 1},
    {"num": 2, "citation": "Lattner, C. & Adve, V. (2004). LLVM: A compilation framework. CGO 2004. IEEE.", "tier": 1},
    {"num": 3, "citation": "Backus, J. W. et al. (1957). The FORTRAN automatic coding system. WJCC. ACM.", "tier": 1},
    {"num": 4, "citation": "Chaitin, G. J. et al. (1981). Register allocation via coloring. Computer Languages 6(1).", "tier": 1},
    {"num": 5, "citation": "LLVM Project. LLVM Language Reference Manual. llvm.org/docs/LangRef.html.", "tier": 1}
  ]
}
