spydecy-hir 0.3.0

High-level Intermediate Representation (HIR) for Spydecy transpiler
Documentation

Spydecy Unified High-Level Intermediate Representation (HIR)

This module defines the core data structures for Spydecy's Unified HIR. The HIR is the central innovation that enables cross-layer optimization by unifying Python and C representations.

Architecture

┌──────────┐       ┌──────────┐
│ Python   │       │   C      │
│  AST     │       │  AST     │
└────┬─────┘       └────┬─────┘
     │                  │
     ▼                  ▼
┌──────────┐       ┌──────────┐
│ Python   │       │   C      │
│  HIR     │       │  HIR     │
└────┬─────┘       └────┬─────┘
     │                  │
     └────────┬─────────┘
              ▼
      ┌──────────────┐
      │ Unified HIR  │ ⭐ Core Innovation
      └──────┬───────┘
             ▼
      ┌──────────────┐
      │  Optimizer   │
      └──────┬───────┘
             ▼
      ┌──────────────┐
      │   Codegen    │
      └──────┬───────┘
             ▼
        Rust Code

Sprint 0 Validation

Sprint 0 validated this architecture with a minimal implementation:

  • Python len() + C list_length() → Unified HIR → Rust Vec::len()
  • 8/8 tests passing ✅
  • Zero FFI, zero unsafe ✅

This production version extends that success to handle real code.