— Peter K Joseph
Articles
Writing on compiler design, computer science, and software engineering.
Basics of Compiler Design
6-part seriesFrom Code to Program: Unveiling the Hidden Stages of Compiler Design
A compiler is far more than a translator. It's a six-stage pipeline that breaks your source code apart, checks its meaning, and rebuilds it as machine instructions your CPU can actually run.
Breaking Down Words: The Art of Lexical Analysis in Compiler Design
Before a compiler can understand your code, it must first learn to read it. Lexical analysis is how raw characters become structured tokens — the vocabulary every subsequent stage depends on.
Parsing the Structure: How Syntax Analysis Turns Tokens into Trees
Tokens alone tell the compiler what words exist. Syntax analysis tells it how those words fit together — using grammar rules to build the hierarchical structure every subsequent stage depends on.
Making Sense of Code: What Semantic Analysis Actually Checks
A programme can be perfectly grammatical and completely nonsensical. Semantic analysis is where the compiler goes beyond structure and starts asking whether the code actually means something valid.
The Middle Layer: Why Compilers Generate Intermediate Code
Going straight from source code to machine code would be both impractical and fragile. Intermediate representation is the bridge that lets the same front end target any machine, and the same back end compile any language.
Doing More With Less: How Compilers Optimise Your Code
Code optimisation transforms intermediate code to run faster and take up less space — without changing what the programme does. It's one of the most intellectually rich parts of compiler design.
No articles match your search.