Welcome to The Koru Book
This isn't like traditional programming tutorials. Instead of static examples, you're looking at living documentation — every page is backed by a real test that actually runs.
When you see a ✓, that means the code actually compiles and runs correctly. When you see ✗, you're looking at something we're still working on. This is documentation that can never drift from reality because it IS reality.
That said, tests can go cold. A ✓ means the test passed when last run — not that every example is perfectly idiomatic or complete. Koru is under active development.
The Zen of Koru
The atom is the event. Functions are just events that forgot how to branch.
Branches are how decisions actually work. Flows are how things actually happen.
What you don't write can't break. What you don't hide can't surprise.
What you don't promise can't fail. Fail loudly, fix honestly.
Model reality, not abstractions. Let patterns emerge from events.
Complex behavior from simple rules. The AST is the program.
Zero cost at runtime. All magic at compile time. The boundary dissolves.
We built this together. Human vision, AI capability.
Working Features
Green tests (✓) are ready to learn from today
In Progress
Red tests (✗) are features we're currently building
Coming Soon
Blue tests (○) are planned features on the horizon
Suggested Learning Path
1. Start with Core Language — Learn the fundamentals of events and procs
2. Move to Control Flow — Understand how Koru programs flow with labels and continuations
3. Explore Advanced Topics — Event taps, phantom types, metacircular compilation
The Koru Book
Learn Koru through working examples. Every lesson is a real test from the compiler's regression suite.
core language / basic syntax
22/22core language / events flows
18/18core language / literals
7/7core language / type system
0/19core language / control flow
28/30module system / imports
16/16module system / namespaces
2/2module system / packages
1/1module system / file layout
13/15parser
8/8compiler features / parser
81/86compiler features / compilation
14/14compiler features / flow checker
5/6compiler features / codegen
1/1compiler features / emitter
5/5compiler features / std library
3/3compiler features / template engine
7/7compiler features / subflow
1/1syntax / struct constructors
2/2advanced features / comptime
52/60advanced features / stdlib
45/54advanced features / keyword
5/5advanced features / phantom types
65/76advanced features / obligation stress
8/17advanced features / obligation matrix
5/6The permutation matrix of Koru's phantom-obligation discharge system — the
advanced features / type system
0/5advanced features / auto proc
3/3advanced features / pattern branches
3/4advanced features / subflows
9/13advanced features / optional branches
9/10advanced features / taps observers
5/7advanced features / interceptors
0/4advanced features / phantom types
1/1advanced features / variants
8/13advanced features / templating
2/4advanced features / kernel
20/24advanced features / testing
10/10control flow
5/6runtime features
43/45runtime features / budgeted interpreter
6/7runtime features / purity checking
8/9runtime features / performance
0/20runtime features / coordination
6/11runtime features / runtime
31/36runtime features / resource bridge
2/2integration testing / negative tests
34/36integration testing / negative tests / 020 parse errors
1/1integration testing / negative tests / 034 type errors
1/1integration testing / bug reproduction
4/4integration testing / validation
7/7stdlib / string
13/14stdlib / fmt
2/2stdlib / io
3/4stdlib / regex
10/10stdlib / switch
4/4stdlib / fs
6/6stdlib / collections
14/16nesting sweep
24/30event globbing
4/10challenges
1/1aoc 2015
10/44examples showcase
1/1examples showcase / language shootout
21/22How This Works
Every page in this book is backed by a real test in the Koru compiler's regression suite. When you see a ✓, that means the code actually compiles and runs correctly. When you see ✗, you're looking at something we're still working on.
This is living documentation — it can never drift from reality because it IS reality. The tests run on every commit.