Sane C++ Libraries is a set of C++ platform abstraction libraries for macOS, Windows and Linux. Platforms.
Project Principles:
✅ Fast compile times
✅ Bloat free
✅ Simple and readable code
✅ Easy to integrate
⛔️ No C++ Standard Library / Exceptions / RTTI
⛔️ No third party build dependencies (prefer OS API)
You can take a look at the introductory blog post if you like.
I've also started a Youtube Channel with some videos on the project.
Many libraries are in draft state, while others are slightly more usable.
Click on specific page each library to know about its status.
It is a deliberate decision to prototype single libraries and make them public Draft or MVP state.
This is done so that they can be matured in parallel with all other libraries and evolve their API more naturally.
This is the list of all libraries, whose internal dependencies are documented at Dependencies:
| Library | Description | Header LOC | Source LOC | Standalone LOC |
|---|---|---|---|---|
| Async | 🟨 Cross-platform completion-based asynchronous I/O | 1926 | 5842 | 19469 |
| Async Streams | 🟨 Bounded byte-stream pipelines with explicit backpressure | 924 | 1798 | 3755 |
| Await | 🟨 C++20 coroutine layer over Async | 1199 | 3231 | 24431 |
| Containers | 🟨 Generic containers (SC::Vector, SC::SmallVector, SC::Array etc.) | 1007 | 3 | 4428 |
| Containers Reflection | 🟨 Opt-in reflection and serialization adapters for SC containers and owning memory types. | 231 | 0 | 5609 |
| Fibers | 🟥 Stackful cooperative task runtime | 0 | 0 | 0 |
| FibersAsync | 🟥 Stackful fiber I/O bridge over Async | 0 | 0 | 0 |
| File | 🟩 Synchronous Disk File I/O | 200 | 1364 | 3018 |
| File System | 🟩 Synchronous, path-based file and directory operations | 188 | 1858 | 3403 |
| File System Iterator | 🟩 Allocation-free, pull-based directory traversal | 92 | 402 | 2098 |
| File System Watcher | 🟩 Portable, recursive directory-change notifications for files and directories | 511 | 1122 | 3145 |
| Foundation | 🟩 Primitive types, asserts, compiler macros, Function, Span, Result | 27 | 64 | 1813 |
| Hashing | 🟩 Incremental MD5, SHA-1 and SHA-256 hashing over byte spans | 95 | 292 | 776 |
| Http | 🟥 Allocation-free HTTP/1.1 client, server, parser, and WebSocket building blocks | 1861 | 7587 | 33872 |
| Http Client | 🟥 Allocation-free HTTP client over the operating system's native transport | 1188 | 4754 | 6876 |
| Memory | 🟩 Explicit allocation policy, owning byte and string storage, and virtual memory | 554 | 1053 | 2749 |
| Plugin | 🟨 Compile source-delivered C++ extensions and reload them inside a running process | 865 | 1322 | 9892 |
| Process | 🟩 Launch child processes, redirect their standard streams, and build pipelines | 408 | 1103 | 6227 |
| Reflection | 🟩 Describe C++ object structure at compile time, primarily for serialization. | 616 | 0 | 930 |
| SerialPort | 🟨 Synchronous serial-port configuration and byte I/O | 55 | 599 | 4532 |
| Serialization Binary | 🟨 Reflection-driven binary persistence with exact and schema-aware reads | 593 | 0 | 1943 |
| Serialization Text | 🟨 Map reflected C++ data to and from JSON in caller-controlled storage | 632 | 471 | 2783 |
| Socket | 🟨 Synchronous TCP, connected UDP, multicast configuration and DNS lookup | 185 | 894 | 2238 |
| Strings | 🟩 Non-owning encoded text, formatting, conversion, parsing, and path manipulation | 1056 | 3143 | 5475 |
| Testing | A small, explicit test runner for SC-style result checking and sectioned tests. | 155 | 791 | 2560 |
| Threading | 🟩 Native threads, synchronization primitives, and a caller-owned task pool | 433 | 926 | 2190 |
| Time | 🟨 Wall-clock timestamps, monotonic time, durations, and high-resolution measurement | 133 | 208 | 541 |
| Common source fragments | Shared source fragments, not a library | 1676 | 582 | - |
| LOC metric | Header | Source | Sum |
|---|---|---|---|
| Library source | 15134 | 38827 | 53961 |
| Common source fragments | 1676 | 582 | 2258 |
All LOC counts in the tables above exclude comments.
Some libraries have C Bindings:
| Library | Description |
|---|---|
| sc_hashing |