{"id":45278327,"url":"https://github.com/bosley/ak24","last_synced_at":"2026-02-21T02:04:24.463Z","repository":{"id":329957992,"uuid":"1119606046","full_name":"bosley/ak24","owner":"bosley","description":"Lightweight C application kernel providing core data structures (lists, maps, buffers), memory management, and optional Boehm GC integration for building robust applications.","archived":false,"fork":false,"pushed_at":"2026-01-01T18:19:15.000Z","size":527,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2026-01-02T14:59:59.417Z","etag":null,"topics":["application-framework","boehm-gc","c","closures","concurrency","data-structures","garbage-collection","memory-management","string-intern"],"latest_commit_sha":null,"homepage":"","language":"C","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/bosley.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2025-12-19T14:43:19.000Z","updated_at":"2025-12-26T21:09:27.000Z","dependencies_parsed_at":null,"dependency_job_id":null,"html_url":"https://github.com/bosley/ak24","commit_stats":null,"previous_names":["bosley/ak24"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/bosley/ak24","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bosley%2Fak24","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bosley%2Fak24/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bosley%2Fak24/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bosley%2Fak24/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/bosley","download_url":"https://codeload.github.com/bosley/ak24/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bosley%2Fak24/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":29671513,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-02-21T00:11:43.526Z","status":"online","status_checked_at":"2026-02-21T02:00:07.432Z","response_time":107,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["application-framework","boehm-gc","c","closures","concurrency","data-structures","garbage-collection","memory-management","string-intern"],"created_at":"2026-02-21T02:04:22.663Z","updated_at":"2026-02-21T02:04:24.451Z","avatar_url":"https://github.com/bosley.png","language":"C","funding_links":[],"categories":[],"sub_categories":[],"readme":"\u003cdiv align=\"center\"\u003e\n  \u003cimg src=\"assets/ak24-logo.svg\" alt=\"AK24 Logo\" width=\"300\"/\u003e\n\u003c/div\u003e\n\n# AK24\n\nAK24 (Application Kernel 24) is a C library that provides data structures, memory management primitives, and utilities for building applications. The kernel (K) is the foundation, offering containers, lambda abstractions, context management, and optional Boehm GC integration. All components are tested at compile-time. The library can be embedded as a base layer in larger systems.\n\n## Platform Support\n\nThe AK24 kernel currently targets nix (Unix-like) systems. Windows support is planned and actively targeted; several compatibility hurdles are in progress. The final major hurdle is the `modules` subsystem, which is POSIX-only right now. This work is backburnered until the broader system stabilizes.\n\nThe `kernel` core already routes all thread functions correctly. Once the kernel supports Windows, AK24 applications will be able to run on Windows without changes.\n\n## Kernel\n\nThe kernel is the core of AK24. It provides memory management abstractions, garbage collection integration, initialization/shutdown, and thread creation utilities. Supports both GC and non-GC builds with optional memory tracking for debugging.\n\n### Kernel Modules\n\n| Module | Description |\n|--------|-------------|\n| [arbuff](#arbuff) | Lock-free atomic ring buffer for concurrent MPMC queue operations |\n| [atoms](#atoms) | Thread-safe N-dimensional data structures with atomic value updates |\n| [buffer](#buffer) | Dynamic byte array with automatic growth and file I/O |\n| [context](#context) | Hierarchical scoped key-value store with parent-child relationships |\n| [forms](#forms) | Structural type system for compiler construction |\n| [lambda](#lambda) | Closure-like structure for function pointers with captured context |\n| [list](#list) | Generic dynamic array with type-safe macros |\n| [log](#log) | Thread-safe logging system with multiple outputs and severity levels |\n| [map](#map) | Generic hash table with type-safe macros and multiple key types |\n| [scanner](#scanner) | Lexical scanner for parsing basic types from buffers |\n\n### Building\n\nBuild the library:\n```bash\nmake\n```\n\nInstall the library:\n```bash\nmake install\n```\n\nRun tests:\n```bash\n./ak24.sh test\n```\n\nRun complete CI test suite (all configurations):\n```bash\n./ak24.sh ci\n```\n\nBuild with GC disabled:\n```bash\nAK24_GC=OFF make\n```\n\n### Using AK24 in Your Projects\n\nAfter installation, link against AK24 using one of these methods:\n\n**Using pkg-config:**\n```bash\ngcc myprogram.c $(pkg-config --cflags --libs ak24) -o myprogram\n```\n\n**Using ak24-config:**\n```bash\ngcc myprogram.c $(ak24-config --cflags --libs) -o myprogram\n```\n\n**Manual linking:**\n```bash\ngcc myprogram.c -I$AK24_HOME/include/ak24 -L$AK24_HOME/lib -lak24_kernel -lpthread -lssl -lcrypto -o myprogram\n```\n\nThe static library bundles TCC and Boehm GC internally, so you only need to link system libraries (pthread, OpenSSL). For shared library builds, all dependencies are embedded.\n\n### Documentation\n\nGenerate API documentation with Doxygen:\n```bash\nmake docs\n```\n\nView the generated documentation at `docs/api/html/index.html`. The Doxygen documentation is the source of truth and will be the most up to date reference for the API.\n\n---\n\n\u003cdetails\u003e\n\u003csummary\u003e\u003ch3\u003earbuff\u003c/h3\u003e\u003c/summary\u003e\n\nThread-safe lock-free MPMC circular buffer for `void*` pointers. Uses sequence-based algorithm with C11 atomics for safe concurrent access. Capacity is automatically rounded to next power of 2. Returns errors when full rather than overwriting data.\n\n**Documentation**: [kernel/arbuff/docs/arbuff.md](kernel/arbuff/docs/arbuff.md)\n\n\u003c/details\u003e\n\n\n\u003cdetails\u003e\n\u003csummary\u003e\u003ch3\u003eatoms\u003c/h3\u003e\u003c/summary\u003e\n\nThread-safe atomically mutable building blocks for N-dimensional data structures. Atoms store typed primitive values and can bond with multiple neighbors to form 1D chains, 2D grids, 3D cubes, or N-D lattices. Uses C11 atomics for lock-free concurrent value updates.\n\n**Documentation**: [kernel/atoms/docs/atoms.md](kernel/atoms/docs/atoms.md)\n\n\u003c/details\u003e\n\n\u003cdetails\u003e\n\u003csummary\u003e\u003ch3\u003ebuffer\u003c/h3\u003e\u003c/summary\u003e\n\nDynamic byte array for storing `uint8_t` data. Automatically resizes when capacity is exceeded (doubles capacity). Minimum capacity of 16 bytes. Supports rotation, trimming, splitting, sub-buffer operations, and file loading.\n\n**Documentation**: [kernel/buffer/docs/buffer.md](kernel/buffer/docs/buffer.md)\n\n\u003c/details\u003e\n\n\u003cdetails\u003e\n\u003csummary\u003e\u003ch3\u003econtext\u003c/h3\u003e\u003c/summary\u003e\n\nHierarchical scoped key-value store with parent-child relationships. Supports variable shadowing where child values override parent values. Can hoist values to parent scope on pop. Uses map for storage and list for hoist queue.\n\n**Documentation**: [kernel/context/docs/context.md](kernel/context/docs/context.md)\n\n\u003c/details\u003e\n\n\u003cdetails\u003e\n\u003csummary\u003e\u003ch3\u003eforms\u003c/h3\u003e\u003c/summary\u003e\n\nStructural type system infrastructure for compiler construction. Provides structural types (data layout without nominal identity), affordances (operations available on types), affects (method definitions with composition), and pattern matching for structural compatibility checking.\n\n**Documentation**: [kernel/forms/docs/forms.md](kernel/forms/docs/forms.md)\n\n\u003c/details\u003e\n\n\u003cdetails\u003e\n\u003csummary\u003e\u003ch3\u003elambda\u003c/h3\u003e\u003c/summary\u003e\n\nClosure-like structure for storing function pointers with captured context. Supports optional context cleanup function and cloning (shallow copy). Context can be replaced or retrieved at runtime.\n\n**Documentation**: [kernel/lambda/docs/lambda.md](kernel/lambda/docs/lambda.md)\n\n\u003c/details\u003e\n\n\u003cdetails\u003e\n\u003csummary\u003e\u003ch3\u003elist\u003c/h3\u003e\u003c/summary\u003e\n\nGeneric dynamic array with type-safe macros. Automatically resizes when capacity is exceeded (doubles capacity). Initial capacity of 8 items. Supports push, pop, insert, remove, rotation, and iterator pattern. Items are heap-allocated copies.\n\n**Documentation**: [kernel/list/docs/list.md](kernel/list/docs/list.md)\n\n\u003c/details\u003e\n\n\u003cdetails\u003e\n\u003csummary\u003e\u003ch3\u003elog\u003c/h3\u003e\u003c/summary\u003e\n\nThread-safe logging system with six severity levels (TRACE to FATAL). Supports multiple simultaneous output targets, custom callbacks, file output, and optional color output for terminals. Thread safety requires user-provided lock function. Based on rxi's log.c library.\n\n**Documentation**: See [kernel/log/include/log.h](kernel/log/include/log.h)\n\n\u003c/details\u003e\n\n\u003cdetails\u003e\n\u003csummary\u003e\u003ch3\u003emap\u003c/h3\u003e\u003c/summary\u003e\n\nGeneric hash table with type-safe macros. Supports multiple key types (string, int, float, etc) with custom hash and comparison functions. Automatic resizing doubles buckets when load factor exceeds 1.0. Uses chaining for collision resolution.\n\n**Documentation**: [kernel/map/docs/map.md](kernel/map/docs/map.md)\n\n\u003c/details\u003e\n\n\u003cdetails\u003e\n\u003csummary\u003e\u003ch3\u003escanner\u003c/h3\u003e\u003c/summary\u003e\n\nLexical scanner for parsing integers, reals, and symbols from byte buffers. State-machine-based with configurable stop symbols and whitespace handling. Supports delimited group extraction with escape sequences. Non-owning buffer references for zero-copy parsing with position tracking.\n\n**Documentation**: See [kernel/scanner/include/scanner.h](kernel/scanner/include/scanner.h)\n\n\u003c/details\u003e\n\n---\n\n## Development\n\nFor developers looking to contribute to or extend AK24, please refer to the following documentation:\n\n- **[docs/kernel.md](docs/kernel.md)** - Kernel initialization, memory management, threading abstractions, and application framework\n- **[docs/platform.md](docs/platform.md)** - Platform abstraction layer architecture showing how AK24 maps to POSIX/Windows implementations\n- **[docs/testing.md](docs/testing.md)** - Testing strategy for GC, ASAN, and manual memory configurations\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbosley%2Fak24","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fbosley%2Fak24","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbosley%2Fak24/lists"}