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 🟨 Async I/O (files, sockets, timers, processes, fs events, threads, signals) 1926 5842 19469
Async Streams 🟨 Concurrently read, write and transform byte streams 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 🟨 Containers specializations for Reflection and Serialization. 231 0 5609
File 🟩 Synchronous Disk File I/O 200 1364 3018
File System 🟩 File System ops { exists, copy, delete } for { files, directories } 188 1858 3403
File System Iterator 🟩 Enumerates files and directories inside a given path 92 402 2098
File System Watcher 🟩 Notifications {add, remove, rename, modify} for files / directories 511 1122 3145
Foundation 🟩 Primitive types, asserts, compiler macros, Function, Span, Result 27 64 1813
Hashing 🟩 Compute MD5, SHA1 or SHA256 hashes for a stream of bytes 95 292 776
Http 🟥 HTTP parser, server and client 1861 7587 33872
Http Client 🟥 Streaming-first HTTP client with native OS backends 1188 4754 6876
Memory 🟩 Heap Allocation, Custom allocators, Virtual Memory, Buffer 554 1053 2749
Plugin 🟨 Minimal dependency based plugin system with hot-reload 865 1322 9892
Process 🟩 Launch processes and chain them (also usable with Async library) 408 1103 6227
Reflection 🟩 Describe C++ types at compile time for serialization 616 0 930
SerialPort 🟨 Synchronous serial port descriptor and configuration 55 599 4532
Serialization Binary 🟨 Serialize to and from a binary format using Reflection 593 0 1943
Serialization Text 🟨 Serialize to / from text formats (JSON) using Reflection 632 471 2783
Socket 🟨 Synchronous socket networking and DNS lookup 185 894 2238
Strings 🟩 UTF String formatting / conversion / manipulation 1056 3143 5475
Testing 🟨 Simple testing framework used by all of the other libraries 155 791 2560
Threading 🟩 Atomic, thread, pool, mutex, semaphore, barrier and more 433 926 2190
Time 🟨 Time handling (relative, absolute, high resolution) 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.

Dependency Graph

Some libraries have C Bindings:

Library Description
sc_hashing