Skip to content
View contactandyc's full-sized avatar

Highlights

  • Pro

Block or report contactandyc

Block user

Prevent this user from interacting with your repositories and sending you notifications. Learn more about blocking users.

You must be logged in to block users.

Maximum 250 characters. Please don’t include any personal information such as legal names or email addresses. Markdown is supported. This note will only be visible to you.
Report abuse

Contact GitHub support about this user’s behavior. Learn more about reporting abuse.

Report abuse
contactandyc/README.md

GitHub Profile for Andy Curtis

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.

1. The Core Primitives

These four libraries form the bedrock of the ecosystem. They replace the standard C library constraints with modern, high-performance paradigms.

  • the-macro-library Provides 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 without void* overhead.
  • a-memory-library Arena-based memory pooling to replace malloc/free. Provides aml_pool_t for bump-allocation and aml_buffer_t for 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-library Advanced 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-library High-speed LZ4 block compression/decompression. Includes streaming APIs, block checksum validation, and embeds xxhash for blazingly fast non-cryptographic hashing.

2. The Build Orchestrator

Managing dependencies and CMake lists for dozens of C libraries is notoriously difficult. This tool solves the "Cargo/NPM" problem for the ecosystem.

  • scaffold-repo A declarative polyglot build orchestrator and Git fleet manager. Driven by a minimal scaffold.yaml manifest. 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.

3. The JSON & BSON Suite

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 for int32, int64, and double extraction.
  • 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).

4. Storage Engines & Write-Ahead Logs

ACID-compliant, crash-safe storage primitives designed for NVMe/SSD architectures.

  • an-lsm-tree A 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-log Pluggable, 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.

5. Distributed Consensus & Networking

Libraries for building highly available, replicated state machines and REST APIs.

  • a-raft-core, a-raft-node, a-raft-transport, a-raft-storage WIP: 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-library WIP: Multi-Paxos implementation optimized for disk-safe state machines.
  • h2o-c-library An object-oriented wrapper around the high-performance H2O HTTP server.
  • a-curl-library Event-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-library OAuth 2.0 implementation with localhost capture flows (GitHub, Google, Slack).

6. Data Processing & SQL

Engines for orchestrating massive data transformations and query evaluation.

  • sql-parser-library WIP: 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-library A 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-library WIP: Master Data Management (MDM) engine. Features Union-Find clustering, CSV schema alignment, fuzzy matching graphs, and "Golden Record" survival pipelines.

7. Search, NLP, & AI Embeddings

Components for building full-text search engines and vector databases.

  • embedding-library Hardware-accelerated vector math. Leverages AVX-512, AVX2, and ARM NEON intrinsics for massive cosine similarity computations and float-to-int8 quantization.
  • search-index-library WIP: Full-text inverted index builder. Supports BM25 scoring, density-based snippet generation, and memory-mapped document images.
  • a-tokenizer-library WIP: Query parser and token stream cursor API. Evaluates complex boolean logic (AND, OR, NOT, PHRASE) against underlying inverted indices.
  • a-sentence-chunker-library & stemmer-library WIP: Text normalization. Chunks text for vector embedding pipelines and stems words (backed by an LRU cache) for text indexing.
  • an-encryption-library Zero-allocation, in-place AES-256-GCM encryption and decryption.

Pinned Loading

  1. a-map-reduce-library a-map-reduce-library Public

    A library for orchestrating a map reduce workload on a machine

    C

  2. scaffold-repo scaffold-repo Public

    A repo to scaffold other repos (handles licenses, builds, clones, makefiles, boilerplate stuff)

    Python

  3. a-memory-library a-memory-library Public

    A library for handling allocation

    C 3

  4. a-json-library a-json-library Public

    A very fast json library

    C 3

  5. search-index-library search-index-library Public

    Forked from knode-ai-open-source/search-index-library

    A library for indexing and finding data like a search engine

    C

  6. sql-parser-library sql-parser-library Public

    Forked from knode-ai-open-source/sql-parser-library

    A library for matching data structures to SQL

    C