Compiler Architecture

The AodhML compiler follows a traditional multi-pass design optimized for fast compilation and excellent error messages.

Pipeline Overview

Source Code
    |
    v
+-----------+
|   Lexer   |  → Tokens
+-----------+
    |
    v
+-----------+
|  Parser   |  → AST
+-----------+
    |
    v
+-----------+
| Semantic  |  → Annotated AST
|  Analysis |
+-----------+
    |
    v
+-----------+
|  Type     |  → Typed AST
| Checker   |
+-----------+
    |
    v
+-----------+
|    IR     |  → Intermediate Representation
|  Generator|
+-----------+
    |
    v
+-----------+
|  Runtime  |  → Execution
|  / Backend|
+-----------+

Design Principles

Project Structure

aodhml/
├── compiler/
│   ├── lexer/          # Tokenizer
│   ├── parser/         # Recursive descent parser
│   ├── ast/            # AST definitions
│   ├── semantic/       # Name resolution, scope analysis
│   ├── types/          # Type checker
│   ├── ir/             # Intermediate representation
│   └── diagnostics/    # Error reporting
├── runtime/
│   ├── vm/             # Bytecode interpreter
│   ├── memory/         # Memory management
│   └── stdlib/         # Standard library runtime
├── cli/                # Command-line interface
└── docs/               # Documentation