I originally wrote this set of libraries as a teaching tool, and over time it has expanded into a collection of libraries that allows me to explore various aspects of systems engineering.
Because C lacks a modern standard library and package manager, the entire bedrock of this ecosystem—memory pooling, macro-generics, JSON parsers, and execution engines—was built from the ground up under a strict Apache-2.0 license.
To avoid the viral license contamination common in C/C++ ecosystems, I established a hard boundary: I wrote the core primitives from scratch, and where I integrated external systems (like cryptography, HTTP servers, or LZ4 compression), I strictly curated only permissive (MIT/BSD/Apache) or commercially-safe (MPL) dependencies.
To enforce this at scale, I built scaffold-repo to automatically maintain a perfect legal trail. The orchestrator dynamically injects localized SPDX license headers into every source file and aggregates third-party attribution into unified NOTICE files, guaranteeing a foundation that can pass any compliance audit with zero GPL copyleft anxiety.
These four libraries form the bedrock of the ecosystem. They replace the standard C library constraints with modern, high-performance paradigms.
the-macro-libraryProvides type-safe, inline generic data structures in pure C. Implements Red-Black trees (macro_map), Skiplists, Min/Max Heaps, Introsort (macro_sort), K-way merge loops, intrusive LRU lists, and binary search using C macros. It achieves C++ template-like type safety withoutvoid*overhead.a-memory-libraryArena-based memory pooling to replacemalloc/free. Providesaml_pool_tfor bump-allocation andaml_buffer_tfor auto-resizing binary strings. You allocate a pool per task and clear it instantly when done, virtually eliminating memory fragmentation and leak tracking.the-io-libraryAdvanced data stream processing and bounded-RAM file I/O. Streams delimited, prefix, CSV, or fixed-length records. Supports transparent gzip and LZ4 decompression. Features built-in parallel file sorting, partitioned writing, on-the-fly deduplication, and crash-safe rotating log writers (io_log).the-lz4-libraryHigh-speed LZ4 block compression/decompression. Includes streaming APIs, block checksum validation, and embedsxxhashfor blazingly fast non-cryptographic hashing.
Managing dependencies and CMake lists for dozens of C libraries is notoriously difficult. This tool solves the "Cargo/NPM" problem for the ecosystem.
scaffold-repoA declarative polyglot build orchestrator and Git fleet manager. Driven by a minimalscaffold.yamlmanifest. It auto-discovers C/C++ source files, topologically sorts and clones Git dependencies, generates complete CMake configurations, and strictly enforces organizational OSS compliance by dynamically injecting SPDX Apache-2.0 license headers into your code.
A family of zero-copy, destructive parsers designed for absolute maximum throughput.
a-json-library: A destructive in-place JSON DOM parser. It modifies the source buffer directly (inserting null terminators) to avoid allocating new string memory.a-json-sax-library: A zero-allocation SAX (event-driven) JSON parser for safely streaming massive JSON payloads.a-bson-library: A zero-copy BSON DOM parser. Unlike JSON, it provides strict, native memory layouts forint32,int64, anddoubleextraction.a-bson-sax-library: A zero-allocation SAX parser for binary BSON payloads.a-json-bson-library: An ultra-fast, O(1) memory streaming converter that translates JSON directly to binary BSON (and vice versa), handling MongoDB Extended JSON types natively.a-json-schema-builder-library: A programmatic C API for generating valid JSON schemas ($ref,anyOf, type constraints).
ACID-compliant, crash-safe storage primitives designed for NVMe/SSD architectures.
an-lsm-treeA Log-Structured Merge-tree (LSM) database. Features a background thread-pool for compaction, Bloom filters, block caching, MVCC snapshots for concurrent reads, and a pluggable router for cloud storage tiering.a-write-ahead-logPluggable, crash-safe WAL implementations. Includes strictly sequential and pooled rotating log engines (fixed_ring_wal,pool_wal). Provides O(1) random-access indexing to support rapid leader catch-up in distributed clusters.
Libraries for building highly available, replicated state machines and REST APIs.
a-raft-core,a-raft-node,a-raft-transport,a-raft-storageWIP: A highly modular implementation of the Raft consensus algorithm. Features joint-consensus membership changes, asynchronous I/O mailboxes, log compaction, and snapshot streaming.a-paxos-core&a-paxos-net-libraryWIP: Multi-Paxos implementation optimized for disk-safe state machines.h2o-c-libraryAn object-oriented wrapper around the high-performance H2O HTTP server.a-curl-libraryEvent-loop-driven asynchronous cURL wrapper. Features token-bucket rate limiting, automatic exponential backoff, request dependency graphs, and plugins for OpenAI and Google Cloud APIs.an-oauth-libraryOAuth 2.0 implementation with localhost capture flows (GitHub, Google, Slack).
Engines for orchestrating massive data transformations and query evaluation.
sql-parser-libraryWIP: A fully compiled SQL Virtual Machine. Features an AST parser, a query optimizer capable of index pushdown and EXISTS decorrelation, Window functions (OVER), and prepared statements bound directly to the LSM-Tree.a-map-reduce-libraryA single-node, partitioned DAG execution engine. Orchestrates out-of-core sorting, hashing, shuffling, and reducing pipelines across bounded RAM and multiple CPU threads.a-mdm-libraryWIP: Master Data Management (MDM) engine. Features Union-Find clustering, CSV schema alignment, fuzzy matching graphs, and "Golden Record" survival pipelines.
Components for building full-text search engines and vector databases.
embedding-libraryHardware-accelerated vector math. Leverages AVX-512, AVX2, and ARM NEON intrinsics for massive cosine similarity computations andfloat-to-int8quantization.search-index-libraryWIP: Full-text inverted index builder. Supports BM25 scoring, density-based snippet generation, and memory-mapped document images.a-tokenizer-libraryWIP: Query parser and token stream cursor API. Evaluates complex boolean logic (AND,OR,NOT,PHRASE) against underlying inverted indices.a-sentence-chunker-library&stemmer-libraryWIP: Text normalization. Chunks text for vector embedding pipelines and stems words (backed by an LRU cache) for text indexing.an-encryption-libraryZero-allocation, in-place AES-256-GCM encryption and decryption.



