Duality: The Hidden Structure of Opposites
Many structures come in pairs: forward/reverse AD, push/pull iteration, encode/decode. Recognizing duality lets you transfer theorems and insights between domains.
Browse posts by tag
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—how algorithms arise from algebraic structure.
18-part lecture series on efficient programming. Covers the intellectual foundations behind STL.
Rigorous foundations of generic programming. Connects algebra and algorithms. Stepanov’s magnum opus.
Classic talk on recognizing algorithmic patterns. ‘No raw loops’ - shows how rotate solves many problems elegantly.
A mathematically elegant C++20 library for algebraic text processing and compositional parsing with fuzzy matching capabilities.
A C++17 header-only library implementing Computational Basis Transforms - a unified framework for understanding how FFT, logarithmic arithmetic, and Bayesian inference are all instances of the same pattern.
A modern C++ header-only library implementing disjoint interval sets as first-class mathematical objects with rigorous Boolean algebra operations.
ZeroIPC transforms shared memory from passive storage into an active computational substrate, enabling functional and reactive programming paradigms across process boundaries with zero-copy performance.
Three approaches to computing derivatives—forward-mode AD, reverse-mode AD, and finite differences—each with different trade-offs. Understanding when to use each is essential for numerical computing and machine learning.
A high-performance key-value storage system achieving sub-microsecond latency through memory-mapped I/O, approximate perfect hashing, and lock-free atomic operations. 10M ops/sec single-threaded, 98M ops/sec with 16 threads—12× faster than Redis, 87× …
A header-only C++20 library that achieves 3-10× compression with zero marshaling overhead. PFC makes compression an intrinsic type property through prefix-free codes (Elias Gamma/Delta, Fibonacci, Rice), algebraic types, and Stepanov's generic …
A modern C++20 library for compositional online data reductions with numerically stable algorithms and algebraic composition.
Sean Parent's type erasure technique provides value-semantic polymorphism without inheritance. Combined with Stepanov's algebraic thinking, we can type-erase entire algebraic structures.
Numerical integration demonstrates both classical numerical analysis and Stepanov's philosophy: by identifying the minimal algebraic requirements, our quadrature routines work with dual numbers for automatic differentiation under the integral.
Reverse-mode automatic differentiation powers modern machine learning. Understanding how it works demystifies PyTorch, JAX, and TensorFlow—it's just the chain rule applied systematically.
Most hash libraries treat hash functions as black boxes. Algebraic Hashing exposes their mathematical structure, letting you compose hash functions like algebraic expressions—with zero runtime overhead.
Hash functions form an abelian …
The art of numerical differentiation lies in choosing step size h wisely—small enough that the approximation is good, but not so small that floating-point errors dominate.
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.
elementa is a pedagogical linear algebra library where every design decision prioritizes clarity over cleverness—code that reads like a textbook that happens to compile.
The same GCD algorithm works for integers and polynomials because both are Euclidean domains. This profound insight shows how algebraic structure determines algorithmic applicability.
Rational numbers give us exact arithmetic where floating-point fails. The implementation reveals deep connections to GCD, the Stern-Brocot tree, and the algebraic structure of fields.
The problem is combinatorial. You have N algorithms (sort, search, find, copy) and M containers (array, list, tree, hash table). The naive approach: implement each algorithm for each container. That’s N×M implementations.
The insight is to …
The Miller-Rabin primality test demonstrates how probabilistic algorithms can 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 teaches us that one algorithm can compute products, powers, Fibonacci numbers, and more—once we see the underlying algebraic structure.