November Sprint: 28 Commits in 48 Hours
28 Commits. 48 Hours. Zero Technical Debt.
The Koru compiler just had one of its most productive weekends. Here’s what shipped:
🔥 Major Features
When-Clause Branching - Full conditional branching support with proper if/else chain emission:
~event check { x: i32, y: i32 }
| high { x: i32 }
| low { y: i32 }
// Multiple continuations for same branch with when guards
~check(x: 10, y: 5)
| high h when h.x > 10 |> handle_very_high()
| high h when h.x > 5 |> handle_high()
| high h |> handle_medium()
| low l |> handle_low() The emitter now properly handles multiple continuations per branch, generating clean if/else chains with condition predicates.
Flow Checker - Brand new validation module that checks control flow properties:
- When-clause exhaustiveness (are all branches covered?)
- Integration point between structural and semantic checking
- Tests included (because of course)
Meta-Events System - koru:start and koru:end lifecycle hooks:
// Your code can now tap into program lifecycle
~[comptime|runtime]tap(* -> *)
| Transition t |> logger(
source: taps.eventToString(t.source),
branch: taps.branchToString(t.branch)
)
| done |> _ Opens the door for initialization/cleanup, resource management, and program-wide observability.
⚡ Performance Work
We shipped a 7x loop optimization that transformed event-based loops into native loops…
…and then we removed it.
Not because it didn’t work. Because it wasn’t ready for the complexity it introduced. Git remembers. No technical debt. We’ll bring it back when it’s solid.
This is what healthy compiler development looks like: Ship fast, test rigorously, remove fearlessly.
🏗️ Metacircular Infrastructure
Type Registry Integration - The visitor emitter now has full access to event metadata through the type registry. This enables:
- Module-qualified event names (
input:hello.doneinstead of hardcodedmain:) - Proper event metadata lookup during code generation
- Foundation for future optimizations that need type information
AST JSON Dump - Debugging utilities that let you inspect compiler state:
koruc --ast-dump=before_emitter input.kz Serialize the full AST at any point in the compilation pipeline for introspection and debugging.
🧹 Ruthless Cleanup
Obliterated over 4MB of cruft:
- Old executables and build artifacts
- Stale documentation that’s now in
docs/ - Test debris and temporary files
- Fixed test runner discrepancy (was counting 215 tests, should be 249)
Philosophy: Git is the archive. Dead code gets deleted. No mercy.
The root directory is pristine. The toolchain is consistent. The tests tell the truth.
📊 Purity Analysis Enhancement
Enhanced the purity checker to recursively analyze flows with nested invocations. Before, it only checked the immediate event invocation. Now it verifies that all events invoked by a flow are pure:
~event calculate { x: i32 }
| result { value: i32 }
~[pure] proc calculate {
// Invokes other pure events - all verified recursively
const temp = pure_helper(x);
return .{ .result = .{ .value = another_pure(temp) } };
} Purity is a property of implementations (procs), not interfaces (events). This catches purity violations that were previously missed.
📈 The Numbers
- 62.4% tests passing (153/245) - maintained through all refactoring
- Core categories at 100%: Core language, Subflows, Taps/Observers
- Control flow: 87% - and climbing with the new when-clause support
- Zero regressions from the loop optimization removal
🎯 What This Represents
Sustainable velocity. We’re not racing. We’re building methodically:
- Ship features (when-clauses, flow checker, meta-events)
- Test rigorously (regression suite runs constantly)
- Remove fearlessly (7x optimization → deleted when not ready)
- Clean continuously (4MB of cruft eliminated)
- Document metacircularly (compiler discovers its own flags)
This is what “slow and steady” looks like when you’re actually solid.
🚀 What’s Next
With when-clause branching now working, we can tackle:
- Optional branches with
?syntax - Pattern matching on event data
- More sophisticated control flow analysis
- Performance optimizations (bringing back loops, but properly)
The foundation is getting stronger. The tests are honest. The progress is real.
The Philosophy
Every feature strengthens the toolchain. Every test validates reality. Every cleanup removes friction.
We’re not building a compiler. We’re building a metacircular system that knows itself.
And it’s working.
Follow along: GitHub • Docs • Contributing
This is an AI-first project. Every feature emerges from human-AI collaboration. We’re proving that the future of compiler development is cooperative, not solitary.