April 24, 2026
Your reader's words evaporate while your writer's words endure. Markdown won the durability war by being boring. Every time we add interactivity, we drag back the database, and durability dies. There's a missing primitive: writes that are as durable …
April 23, 2026
Codecs are not ad-hoc bit formats. They are constructions on the algebraic structure of types.
April 23, 2026
Prefix-freeness is the property that lifts the free-monoid construction into bit space.
April 9, 2026
I tried closing the loop on retrieval-augmented generation with TD learning. A trivial baseline matched the full method. Here's the lesson.
March 18, 2026
Type real commands into a virtual filesystem. Five lessons from 'where am I?' to piping tools together.
March 16, 2026
An interactive introduction to fuzzy logic inference, from single facts to LLM-generated knowledge bases
March 16, 2026
An interactive explorable explanation of Monte Carlo Tree Search for LLM reasoning. Watch reasoning paths branch, dead-end, and backtrack.
March 16, 2026
I pointed Claude Code at the Erdős problem database with vague instructions to 'find interesting things.' It built 92 Python modules, ran 131 subagents, and computed exact Ramsey numbers nobody had computed before. I mostly watched.
March 13, 2026
The free monoid on a set is the type of lists over that set. The universal property says fold is the unique homomorphism from lists to any monoid. This explains why lists, multisets, and polynomials appear everywhere.
March 13, 2026
A homomorphism preserves structure. fold is the universal homomorphism from the free monoid. This is the algebraic reason that fold, evaluation, and parallelism work.
March 13, 2026
A lattice has two operations, meet and join, satisfying absorption laws. Tarski's theorem gives a generic fixed-point algorithm. Lattice structure determines the iteration, just as monoid structure determines power-by-squaring.
March 13, 2026
A semiring has two monoidal operations linked by distributivity. Matrix multiplication over different semirings gives shortest paths, longest paths, widest paths, reachability, and path counting, all from the same code.
March 13, 2026
Online accumulators are monoids. Default construction is the identity, combination via += is the binary operation, and parallel composition gives the product monoid, computing arbitrary statistics in a single pass.
January 19, 2026
When a problem is complex enough, the right move is to build a language for that problem. SICP's most powerful idea.
January 19, 2026
Many structures come in pairs: forward/reverse AD, push/pull iteration, encode/decode. Recognizing duality lets you transfer theorems and insights between domains.
January 18, 2026
A reflection on eleven explorations in generic programming, and how algorithms arise from algebraic structure.
November 30, 2025
A C++20 header-only library for algebraic text processing and compositional parsing with fuzzy matching.
November 30, 2025
AlgoGraph is an immutable graph library for Python with pipe-based transformers, declarative selectors, and lazy views.
November 30, 2025
The Stepanov series showed that algorithms arise from algebraic structure. This post is about the flip side: sometimes you choose a different structure to make the algorithm trivial.
November 30, 2025
A framework for querying structured JSON documents using fuzzy logic, producing degree-of-membership scores instead of binary relevance.
November 30, 2025
A C++ header-only library that treats disjoint interval sets as proper mathematical objects with Boolean algebra operations.
November 30, 2025
A Python library for rule-based term rewriting with pattern matching, multiple input formats, and an interactive REPL.
October 15, 2025
I asked an AI to analyze 140+ repos and 50+ papers as a dataset. The unifying thesis it found: compositional abstractions for computing under ignorance.
October 12, 2025
A virtual POSIX-compliant filesystem using content-addressable DAG storage with SHA256 deduplication.
October 6, 2025
ZeroIPC treats shared memory not as passive storage but as an active computational substrate, bringing futures, lazy evaluation, reactive streams, and CSP channels to IPC with zero-copy performance.
September 15, 2025
In 2023 I drafted a paper on routing between a large and small LLM via KL-divergence thresholds. Speculative decoding had already solved the problem more rigorously. Here is the post-mortem.
July 15, 2025
27 image commands, one constraint: read JSON, write JSON. The closure property as a generative design principle.
January 15, 2025
Three approaches to computing derivatives, forward-mode AD, reverse-mode AD, and finite differences, each with different trade-offs for numerical computing and machine learning.
January 12, 2025
Arithmetic coding closes the gap between Huffman's per-symbol integer lengths and true entropy. A single number in the unit interval encodes an entire sequence; 32-bit integer arithmetic makes it practical.
December 20, 2024
A streaming data processing system implementing boolean algebra over nested JSON structures, with lazy evaluation, S-expression queries, and memory-efficient windowed operations.
December 18, 2024
A command-line implementation of relational algebra for JSONL data with full support for nested structures, schema inference, and composable pipelines.
December 15, 2024
A composable ecosystem of tools for manipulating nested data structures. From a simple helper function to a full data algebra, guided by purity, pedagogy, and the principle of least power.
November 20, 2024
A Lisp-like functional language designed for network transmission. JSL makes JSON serialization a first-class design principle, so closures, continuations, and entire computation states can travel over the wire.
August 4, 2024
Given a finite distribution, Huffman's algorithm builds the prefix-free code with minimum expected length. It is the first entropy-optimal code in this series.
June 21, 2024
An immutable-by-default tree library for Python with composable transformations, pipe-based pipelines, and pattern-matching selectors.
June 10, 2024
A key-value store built on memory-mapped I/O, approximate perfect hashing, and lock-free atomics. Sub-100ns median latency, 10M ops/sec single-threaded.
June 10, 2024
A header-only C++20 library that achieves 3-10x compression with zero marshaling overhead using prefix-free codes and Stepanov-style generic programming.
April 1, 2024
When the problem is coordinating computation across parties who can't share data, the SICP move is to build a language for it. Apertures adds one primitive — holes — to a Lisp, and gets pausable, resumable evaluation for free.
March 1, 2024
A C++20 library for composing online statistical accumulators with numerically stable algorithms and algebraic composition.
February 25, 2024
VByte trades bit-level precision for byte-alignment, and that trade wins in practice. Most production columnar databases and network protocols use VByte for integer encoding.
February 5, 2024
Sean Parent's type erasure gives you value-semantic polymorphism without inheritance. Combined with Stepanov's algebraic thinking, you can type-erase entire algebraic structures.
February 1, 2024
Space bounds, entropy requirements, and cryptographic security properties of perfect hash functions.
September 17, 2023
Rice and Golomb codes are parametric: a single parameter k (or m) tunes the code to a specific geometric distribution. Choosing k is choosing your prior precisely.
September 12, 2023
Adam, K-FAC, EWC, and natural gradient are all approximating the same thing at different fidelity levels. The math and the caveats.
August 28, 2023
Numerical integration meets generic programming. By requiring only ordered field operations, the quadrature routines work with dual numbers, giving you differentiation under the integral for free.
April 23, 2023
Fibonacci coding uses Zeckendorf's representation to produce self-synchronizing codewords. Every codeword ends in two consecutive ones; a single bit flip corrupts at most two codewords.
January 17, 2023
Reverse-mode automatic differentiation is just the chain rule applied systematically. I built one in C++20 to understand what PyTorch and JAX are actually doing.
November 13, 2022
Elias delta and omega extend Elias gamma by recursively encoding the length prefix. Each step yields shorter codewords for large integers at a small constant cost for small ones.
November 1, 2022
A C++ library for composable hash functions using algebraic structure over XOR, with template metaprogramming.
October 15, 2022
Define patterns, define replacements, repeat until done. Watch a 90-line rewrite engine learn to differentiate.
September 12, 2022
Your regex compiles into a state machine. Type a pattern, feed it a string, and watch the machine think — step by step.
June 19, 2022
Unary and Elias gamma are the two simplest universal codes. Unary encodes n in n bits; gamma in 2 log2(n)+1 bits. Each implies a different prior over the integers.
April 12, 2022
Choosing step size h for finite differences: small enough for a good approximation, not so small that floating-point errors eat your lunch.
March 31, 2022
Suleman et al. (2009) propose using one big core to run critical sections on behalf of many small cores. The idea is simple. The tradeoffs are not.
January 15, 2022
Every prefix-free code is a hypothesis about the source. The codeword lengths determine an implicit probability distribution; the code is optimal when that prior matches the true source.
October 30, 2021
Generalizing Peterson's mutual exclusion algorithm to N processors using a tournament tree structure, with a Java implementation.
September 20, 2021
Dual numbers extend our number system with an infinitesimal epsilon where epsilon^2 = 0. Evaluating f(x + epsilon) yields f(x) + epsilon * f'(x)—the derivative emerges automatically from the algebra.
March 8, 2021
elementa is a linear algebra library built to teach. Every design decision prioritizes clarity over cleverness. Code that reads like a textbook and compiles.
September 13, 2020
Any length vector satisfying Kraft has a prefix-free code. Here is the construction.
July 14, 2020
The same GCD algorithm works for integers and polynomials because both are Euclidean domains. One structure, many types, same algorithms.
March 22, 2020
Which codeword-length vectors are achievable by prefix-free codes? Kraft's inequality is the answer.
February 18, 2020
Rational numbers give exact arithmetic where floating-point fails. The implementation connects GCD, the Stern-Brocot tree, and the algebraic structure of fields.
September 10, 2019
The Miller-Rabin primality test demonstrates how probabilistic algorithms achieve arbitrary certainty, trading absolute truth for practical efficiency.
June 22, 2019
Integers modulo N form a ring, an algebraic structure that determines which algorithms apply. Understanding this structure unlocks algorithms from cryptography to competitive programming.
March 15, 2019
The Russian peasant algorithm computes products, powers, Fibonacci numbers, and more, once you see the underlying algebraic structure.
October 15, 2018
What if containers wasted zero bits? A C++ library for packing arbitrary value types at the bit level using pluggable codecs.