# Ritz Framework TODO ## ✅ COMPLETED: Phase 1 & 2 - Working Reactive Framework! ### Phase 1: Hello World (Static Content) ✅ - [x] Set up project structure (pyproject.toml, ruff, black, pytest) - [x] Write AST parser tests using Python's `ast` module - [x] Implement AST parser (HelloWorld, props, nesting, augassign) - [x] All parser tests passing (4/4) - [x] Write LLVM IR codegen tests - [x] **Implement LLVM IR code generator** (NOT C - direct LLVM!) - [x] All codegen tests passing (4/4) - [x] Create JavaScript DOM bridge/runtime (ritz-runtime.js) - [x] Create build script (Python → AST → IR → LLVM → clang → WASM) - [x] Write HelloWorld.py component - [x] **✅ MILESTONE: HelloWorld.wasm renders in browser!** ### Phase 2: Reactive Signals ✅ - [x] Parse signal declarations and augmented assignment (+=) - [x] Parse event handlers (onclick) - [x] Parse f-strings with signal references - [x] **Implement signals in WASM memory** (`@signal_name = global i32`) - [x] Generate signal getter/setter functions - [x] Generate exported event handler functions - [x] Bind events in JS runtime to WASM functions - [x] Update DOM when signals change - [x] Write HighFive.py counter component - [x] **✅ MILESTONE: Reactive counter working!** ### Phase 3: Developer Experience ✅ - [x] Clean runtime architecture (RitzRuntime + RitzLoader classes) - [x] Debug bar with Ctrl+` toggle - [x] Clean HTML examples with minimal boilerplate - [x] Dev server with port reuse - [x] Run black and ruff formatters - [x] `from ritz.syntax import *` for clean component syntax --- ## 🚀 Current State **WORKING:** - Python → AST → Ritz IR → LLVM IR → WASM pipeline - Reactive signals stored in WASM memory - Event handlers exported from WASM - Clean runtime with debug tools - Two working examples (HelloWorld, HighFive) **Architecture:** ``` Python Component ↓ ast.parse() Ritz IR ↓ LLVM IR Generator (llvm_codegen_signals.py) LLVM IR (.ll file) ↓ clang --target=wasm32 WebAssembly ↓ RitzRuntime (JavaScript) Live Reactive UI ``` --- ## Phase 4: Next Steps ### In-Browser Compilation (THE BIG ONE) - [ ] Research: Compile Ritz compiler to WASM (Pyodide vs Rust rewrite) - [ ] Implement `