Skip to content

USL Architecture

Overview of the USL compiler architecture.

Components

USL Compiler
├── Lexer        - Tokenization
├── Parser       - AST construction
├── Semantic     - Symbol resolution
├── Type Checker - Type inference
├── Verifier     - Formal verification
├── IR Generator - Intermediate representation
└── Codegen      - Target code generation

Compilation Pipeline

graph LR
    A[Source] --> B[Lexer]
    B --> C[Parser]
    C --> D[AST]
    D --> E[Semantic]
    E --> F[Type Checker]
    F --> G[Verifier]
    G --> H[IR]
    H --> I[Codegen]
    I --> J[Target Code]

Key Design Decisions

  • Layered architecture enforced at compile time
  • Effect system tracks side effects
  • SMT solver for formal verification
  • Multi-target code generation

Modules

  • lexer/ - Lexical analysis
  • parser/ - Syntax analysis
  • semantic/ - Semantic analysis
  • types/ - Type system
  • proof/ - Verification
  • ir/ - Intermediate representation
  • codegen/ - Code generation

Back to Contributing