Sane C++ Libraries
C++ Platform Abstraction Libraries
Loading...
Searching...
No Matches
Sane C++ Libraries

Table of Contents

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)

Motivation

  • Having fun building from scratch a cohesive ecosystem of libraries sharing the same core principles
  • Fight bloat measured in cognitive and build complexity, compile time, binary size and debug performance
  • Providing out-of-the-box functionalities typically given for granted in every respectable modern language
  • Re-invent the wheel hoping it will be more round this time

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.

Status

Many libraries are in draft state, while others are slightly more usable.
Click on specific page each library to know about its status.

  • 🟥 Draft (incomplete, work in progress, proof of concept, works on basic case)
  • 🟨 MVP (minimum set of features have been implemented)
  • 🟩 Usable (a reasonable set of features has been implemented to make library useful)
  • 🟦 Complete (all planned features have been implemented)

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 2129 6219 23345
AsyncFibers 🟥 Stackful fiber I/O bridge over Async 208 775 36900
Async Streams 🟨 Bounded byte-stream pipelines with explicit backpressure 1219 1849 4226
Await 🟨 C++20 coroutine layer over Async 1316 3265 28752
Containers 🟨 Generic containers (SC::Vector, SC::SmallVector, SC::Array etc.) 1007 3 4514
Containers Reflection 🟨 Opt-in reflection and serialization adapters for SC containers and owning memory types. 231 0 5695
Cryptography 🟥 Fixed-storage wrappers over native and optional OpenSSL symmetric cryptography APIs 1048 2888 4230
Fibers 🟥 Stackful cooperative task runtime 1664 8960 11741
File 🟩 Synchronous Disk File I/O 496 1680 3839
File System 🟩 Synchronous, path-based file and directory operations 494 2080 4139
File System Iterator 🟩 Allocation-free, pull-based directory traversal 247 488 2549
File System Watcher 🟩 Portable, recursive directory-change notifications for files and directories 751 1224 3635
Foundation 🟩 Primitive types, asserts, compiler macros, Function, Span, Result 27 66 1868
Hashing 🟩 Incremental MD5, SHA-1 and SHA-256 hashing over byte spans 95 295 779
Http 🟥 Build HTTP/1.1 clients and servers with caller-owned storage 2550 8499 39968
Http Client 🟥 Allocation-free HTTP client over the operating system's native transport 1717 5086 7884
Memory 🟩 Explicit allocation policy, owning byte and string storage, and virtual memory 554 1053 2802
Plugin 🟨 Compile source-delivered C++ extensions and reload them inside a running process 1303 1530 11986
Process 🟩 Launch child processes, redirect their standard streams, and build pipelines 585 1199 7530
Reflection 🟩 Describe C++ object structure at compile time, primarily for serialization. 616 0 930
SerialPort 🟨 Synchronous serial-port configuration and byte I/O 230 634 5710
Serialization Binary 🟨 Reflection-driven binary persistence with exact and schema-aware reads 593 0 1975
Serialization Text 🟨 Map reflected C++ data to and from JSON in caller-controlled storage 632 471 2835
Socket 🟨 Synchronous IP and Unix-domain streams and datagrams, multicast configuration and DNS lookup 549 1405 3262
Strings 🟩 Non-owning encoded text, formatting, conversion, parsing, and path manipulation 1093 3131 5648
Testing A small, explicit test runner for SC-style result checking and sectioned tests. 173 796 2697
Threading 🟩 Native threads, synchronization primitives, and a caller-owned task pool 566 967 2626
Time 🟨 Wall-clock timestamps, monotonic time, durations, and high-resolution measurement 133 208 627
Common source fragments Shared source fragments, not a library 1871 644 -
LOC metric Header Source Sum
Library source 22226 54771 76997
Common source fragments 1871 644 2515

All LOC counts in the tables above exclude comments.

Dependency Graph

Some libraries have C Bindings:

Library Description
sc_hashing