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 2121 6094 23222
AsyncFibers 🟥 Stackful fiber I/O bridge over Async 206 939 36572
Async Streams 🟨 Bounded byte-stream pipelines with explicit backpressure 1219 1847 4224
Await 🟨 C++20 coroutine layer over Async 1316 3265 28629
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 2778 4120
Fibers 🟥 Stackful cooperative task runtime 1637 8620 11374
File 🟩 Synchronous Disk File I/O 496 1724 3883
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 729 1200 3589
Foundation 🟩 Primitive types, asserts, compiler macros, Function, Span, Result 27 64 1866
Hashing 🟩 Incremental MD5, SHA-1 and SHA-256 hashing over byte spans 95 293 777
Http 🟥 Allocation-free HTTP/1.1 client, server, parser, and WebSocket building blocks 2500 8403 39697
Http Client 🟥 Allocation-free HTTP client over the operating system's native transport 1696 5049 7826
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 1293 1509 11996
Process 🟩 Launch child processes, redirect their standard streams, and build pipelines 585 1196 7571
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 5754
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 3145 5662
Testing A small, explicit test runner for SC-style result checking and sectioned tests. 155 796 2679
Threading 🟩 Native threads, synchronization primitives, and a caller-owned task pool 565 952 2610
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 22067 54216 76283
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