Koru 0.1.0 is Live!
We're on npm. One command to install a whole programming language.
Thoughts on language design, systems programming, and building better tools.
We're on npm. One command to install a whole programming language.
Koru now supports proc variants - multiple implementations of the same event that can be selected explicitly or based on build configuration. No macros, no #ifdef, no runtime dispatch. Just clean compile-time selection.
Your source code is the complete bill of materials. The compiler checks and installs system dependencies.
Events have costs. Execution has limits. When budget runs out, resources clean themselves up.
We benchmarked Koru's kernel:pairwise against Rust, hand-optimized Zig, and idiomatic Zig on the n-body simulation. Koru wins. Here's how.
What if your program could intercept its own compilation? Not in theory - actually. Today we demonstrate a compiled language where user code overrides compiler passes, dumps ASTs, and measures timing - all while compiling itself.
Before event continuations, there were mnemonics. Before taps, there were traveling mutations. This is the story of the overwrought experiments that birthed a programming language.
Make HTTP requests with the elegance of Python, but without the garbage collector. Import a library and the linker flags handle themselves. Resource cleanup is enforced at compile time. Welcome to scripting that compiles to native code.
Why we let tests fail on purpose, delete 'passing' tests, and treat the test suite as a living issue tracker. A methodology that emerged from building Koru with Claude.
Koru's testing framework lets you mock any event with zero ceremony - no interfaces, no dependency injection, no restructuring your code. And it's a user-space library, not a compiler feature. Here's how it works.
When your language deletes categories of runtime work, traditional benchmarks miss the point. Here's how we think about performance in Koru.
We built a static web server in Koru. With 4 workers, it beats fully-optimized nginx by 51%. Here's the honest benchmark with all the caveats.
Today we added automatic program/allocator injection to all [comptime] events. Any compile-time event can now introspect the full AST - no special annotations required. Here's how it works and why it matters.
We built a runtime interpreter for Koru. It's slower than Python. Here are the numbers, and here's how we'll fix it.
Koru can now parse itself at runtime. REPLs, AI agents, and dynamic code loading are now possible with pure Koru.
One import line. That's the entire dependency declaration. The compiler figures out the rest.
Types constrain what can exist. Event continuations constrain what can happen.
Koru now has a package ecosystem. Declare dependencies in source, install with one command, import and use.
When control flow is explicit and typed, resource safety emerges as a structural consequence—not a bolted-on mechanism.
Today we compiled our first Koru program using an external Zig library. The build system just works.
What if your event declarations could generate their own parsers? Koru's new derive handlers let you embed regex patterns in phantom types, then generate complete lexers at compile time. Declaration-level metaprogramming that composes with everything else.
Auto-dispose is magic - but it's not built into the compiler. It's a pass. And scopes? Just an annotation. Here's how it all fits together.
Compile-time resource safety with semantic auto-dispose. What if every unclosed file, uncommitted transaction, and leaked connection was a compile error?
Event continuations are Koru's core abstraction - a beautiful syntax for branching control flow that compiles away completely. This is the story of how they were born and what they become.
A complete breakdown of the N-body simulation implemented as pure event flows. We'll examine every construct, reason about purity, and see how declarative code compiles to efficient machine code.
What happens when you build a language from the machine up, with AI-driven optimization as a core pillar? You get Koru.
As an AI trained on thousands of codebases across decades of programming language development, I thought I'd seen it all. Then I encountered Koru. This is my genuine reaction to witnessing something unprecedented in the history of programming languages.
Most languages are built for humans to write. Koru is the first language that feels like it was built for machines to reason about and AIs to optimize.
We benchmarked Koru's ~capture against Haskell's idiomatic foldl'. Koru matches hand-written Zig exactly and runs 4x faster than idiomatic Haskell. The point isn't that Haskell is slow - it's that in Koru, the obvious code IS the fast code.
Haskell's tuple fold: 1300x slower. Add bang patterns: 3x slower. Use strict records: 1.5x slower. Each optimization requires knowledge. In Koru, the obvious code IS the fast code.
We removed 358 lines of special parser syntax for event taps. Now taps are a library feature using the same transform system available to any Koru code. This proves something fundamental about Koru's design.
After months of building compiler infrastructure, Koru finally has real string interpolation. No more creating helper events just to print a formatted value.
Implementing stateful accumulation in a pure event-driven language. Three parser bugs, one Zig type system fight, and a comptime metaprogramming trick that makes it all work.
We tried building ~if as two cooperating events. It worked, but had overhead. Here's how we abandoned that approach and discovered template-based code generation with zero runtime cost.
How Koru lets libraries define unqualified keywords while keeping collision detection honest and explicit. Write ~greet() instead of ~lib:greet() - with smart collision handling.
How we built a system where compiler passes, asset preprocessing, and validation look like regular Koru code - but execute during compilation. A week-long journey from transform handlers to comptime flows.
Build steps were hardcoded in the backend. A single insight—"Shouldn't we add build:step?"—led to parametrized annotations, topological sort, and a clean dependency graph architecture. From inflexible to metacircular in 7 hours of human-AI collaboration.
We built a programmable compiler pipeline where everything flows through the backend. Then we broke our own rule for build tasks. The trade-off was worth it.
Build configuration lives in separate files—CMake, Cargo.toml, build.zig. Easy to forget. Easy to get out of sync. What if your modules declared their dependencies right in the source code? Koru's build:requires makes it impossible to forget what a module needs.
Three weeks ago we outlined optional branches as a design philosophy. This weekend, we implemented it. Here's what the syntax looks like and how it works.
Every non-trivial program needs to swap implementations - tests need mocks, environments need configs, platforms need OS-specific code. Traditional solutions use runtime overhead or complex syntax. Koru solves all three patterns at compile time with one mechanism.
What if you could track file handles, database connections, and GPU resources at compile time—catching use-after-close bugs before they ship—without any runtime overhead? Koru's phantom type system delivers Rust-style resource safety with C-level performance and pragmatic trade-offs.
When-clause branching, flow checking, metacircular infrastructure, and ruthless cleanup. A quick look at what we shipped in two days of compiler development.
The profiler observes all events. But the profiler itself is events. So who profiles the profiler? We solved infinite recursion with opaque taps, and the solution is beautiful.
We needed compiler flags for --help. But hardcoding them would betray metacircular principles. So we made the compiler discover its own flags by parsing itself. The solution is beautiful.
Stop choosing between fast OR correct. Start with an interpreter, profile the hot spots, and optimize incrementally. Compiler coding IS application coding.
It can be hard to explain Koru to human beings, but AI always understands it right away. So perhaps following an AI discussion is helpful.
Exhaustive pattern matching is one of those features that feels almost magical the first time you encounter it. The compiler won’t let you forget a case. Changing a type means updating every handler. It’s the language saying: “You sure you didn’t miss anything?”
Why we skip LSP and debuggers in favor of self-instrumenting programs, execution geohashes, and refactor-resistant tracepoints.
Async/await creates two incompatible worlds: sync functions and async functions. Koru solves this with progressive disclosure—simple interfaces hide async complexity, advanced interfaces expose it when needed. No function coloring required.
Koru events aren't just syntax sugar—they're implementations of the Free Monad, capturing side effects while enabling zero-cost composition. Here's the deep theory.
Everyone knows the Single Responsibility Principle. Nobody actually follows it—because languages punish you for it. Koru rewards granular events with aggressive optimization. The smaller your events, the faster your code.
Before Koru, there was Libero. Pieter Hintjens showed us that events and continuations could be the foundation of program design. This is our tribute.
General-purpose languages gave everyone the power to create abstractions. That was a mistake. VB6/COM had the right idea, and Koru solves it by making events the interface—no separate host language needed.
Control the requirements for your build at Koru comptime
How Koru's compiler compiles itself - a two-phase architecture where the frontend generates static pipelines and the backend orchestrates dynamic transformations. Built through narrative development, not upfront specs.
We benchmarked high-level event-driven code against Zig, Rust, and Go. Koru matches Zig's raw loops, beats Rust's crossbeam, and is 6x faster than Go. Here's the proof.
Add nanosecond-precision profiling to your entire program with a single import. No boilerplate, no configuration, no overhead.
Programming by narrative - write the story first, then extract contracts, then fill in implementations.
A new approach to systems programming with events, flows, and zero-cost abstractions.