Building Languages to Solve Problems
When a problem is complex enough, the right move is to build a language for that problem. SICP's most powerful idea.
Browse posts by category
When a problem is complex enough, the right move is to build a language for that problem. SICP's most powerful idea.
Many structures come in pairs: forward/reverse AD, push/pull iteration, encode/decode. Recognizing duality lets you transfer theorems and insights between domains.
A reflection on eleven explorations in generic programming, and how algorithms arise from algebraic structure.
A conceptual introduction to entropy maps, implementing functions with hash functions and prefix-free codes.
A C++20 header-only library for algebraic text processing and compositional parsing with fuzzy matching.
AlgoGraph is an immutable graph library for Python with pipe-based transformers, declarative selectors, and lazy views.
A C++17 header-only library that formalizes a pattern behind FFT, logarithmic arithmetic, and Bayesian inference: transform to a domain where your target operation is cheap.
A framework for querying structured JSON documents using fuzzy logic, producing degree-of-membership scores instead of binary relevance.
A C++ header-only library that treats disjoint interval sets as proper mathematical objects with Boolean algebra operations.
A Python library for rule-based term rewriting with pattern matching, multiple input formats, and an interactive REPL.
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.
A unified type-theoretic foundation for probabilistic data structures, approximate computing, and oblivious computation with information-theoretic privacy guarantees.
Formalizing oblivious computing through cipher maps and algebraic cipher types, using category theory for functorial composition of privacy-preserving transformations.
Oblivious types give encrypted search information-theoretic privacy against access pattern leakage. No ORAM, no computational hardness assumptions. Here's how.
A virtual POSIX-compliant filesystem using content-addressable DAG storage with SHA256 deduplication.
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.
27 image commands, one constraint: read JSON, write JSON. The closure property as a generative design principle.
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.
A streaming data processing system implementing boolean algebra over nested JSON structures, with lazy evaluation, S-expression queries, and memory-efficient windowed operations.
A command-line implementation of relational algebra for JSONL data with full support for nested structures, schema inference, and composable pipelines.
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.
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.
An immutable-by-default tree library for Python with composable transformations, pipe-based pipelines, and pattern-matching selectors.
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.
A header-only C++20 library that achieves 3-10x compression with zero marshaling overhead using prefix-free codes and Stepanov-style generic programming.
A C++20 library for composing online statistical accumulators with numerically stable algorithms and algebraic composition.
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.
Space bounds, entropy requirements, and cryptographic security properties of perfect hash functions.
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.
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.
A C++ library for composable hash functions using algebraic structure over XOR, with template metaprogramming.
Choosing step size h for finite differences: small enough for a good approximation, not so small that floating-point errors eat your lunch.
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.
Generalizing Peterson's mutual exclusion algorithm to N processors using a tournament tree structure, with a Java implementation.
Dual numbers extend the reals with an infinitesimal epsilon where epsilon^2 = 0. Evaluate f(x + epsilon) and you get f(x) + f'(x)*epsilon. The derivative falls out of the algebra.
elementa is a linear algebra library built to teach. Every design decision prioritizes clarity over cleverness. Code that reads like a textbook and compiles.
The same GCD algorithm works for integers and polynomials because both are Euclidean domains. One structure, many types, same algorithms.
Rational numbers give exact arithmetic where floating-point fails. The implementation connects GCD, the Stern-Brocot tree, and the algebraic structure of fields.
The Miller-Rabin primality test demonstrates how probabilistic algorithms achieve arbitrary certainty, trading absolute truth for practical efficiency.
Integers modulo N form a ring, an algebraic structure that determines which algorithms apply. Understanding this structure unlocks algorithms from cryptography to competitive programming.
The Russian peasant algorithm computes products, powers, Fibonacci numbers, and more, once you see the underlying algebraic structure.
What if containers wasted zero bits? A C++ library for packing arbitrary value types at the bit level using pluggable codecs.