Sane C++ Libraries is a set of C++ platform abstraction libraries for macOS, Windows and Linux.
β
Fast compile times
β
Bloat free
β
Simple readable code
β
Easy to integrate
βοΈ No C++ Standard Library / Exceptions / RTTI
βοΈ No third party dependencies (prefer OS API)
Visit the documentation website for more information.
Blog posts:
On the Youtube Channel you can find some videos showing some bits of the development process:
- Creating a Makefile
- Add Makefile backend to SC::Build
- Start Linux Porting
- Build Everything on Linux
- Posix fork
- SC::Async Linux epoll 1/2
- SC::Async Linux epoll 2/2
- SC::FileSystemWatcher Linux inotify implementation
- A Tour of SC::Async
- Linux Async I/O using io_uring (1 of 2)
- Linux Async I/O using io_uring (2 of 2)
- Simple ThreadPool
- Async file read and writes using Thread Pool
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)
Library | Description |
---|---|
Algorithms | π₯ Placeholder library templated algorithms will be placed |
Async | π¨ Async I/O (files, sockets, timers, processes, fs events, threads wake-up) |
Build | π₯ Minimal build system where builds are described in C++ |
Containers | π¨ Generic containers (SC::Vector, SC::SmallVector, SC::Array etc.) |
File | π© Synchronous Disk File I/O |
File System | π© File System operations { exists |
File System Iterator | π© Enumerates files and directories inside a given path |
File System Watcher | π© Notifications {add, remove, rename, modified} for files and directories |
Foundation | π© Primitive types, asserts, limits, Function, Span, Result, Tagged Union |
Hashing | π© Compute MD5 , SHA1 or SHA256 hashes for a stream of bytes |
Http | π₯ HTTP parser, client and server |
Plugin | π₯ Minimal dependency based plugin system with hot-reload |
Process | π© Create child processes and chain them (also usable with Async library) |
Reflection | π© Describe C++ types at compile time for serialization |
Serialization Binary | π¨ Serialize to and from a binary format using Reflection |
Serialization Text | π¨ Serialize to / from text formats (JSON) using Reflection |
Socket | π¨ Synchronous socket networking and DNS lookup |
Strings | π© String formatting / conversion / manipulation (ASCII / UTF8 / UTF16) |
Testing | π¨ Simple testing framework used by all of the other libraries |
Threading | π₯ Atomic, thread, thread pool, mutex, condition variable |
Time | π¨ Time handling (relative, absolute, high resolution) |
Libraries can be used as is, adding a single file to your project and without needing any build system.
See Building (user) to just use the library
Shortly:
- Add SC.cpp to your build system of choice
- Define
SC_COMPILER_ENABLE_STD_CPP=1
if you plan to use the Standard C++ library - Include any public header (
Libraries/[Library]/*.h
)
- Link
CoreFoundation.framework
- Link
CoreFoundation.framework
- Link
libdl
(-ldl
) - Link
libpthread
(-lpthread
)
- Nothing else to link (in addition to default libs)
Check the Examples page.
Tests are built with the self-hosted SC::Build project generator, describing the builds in C++.
Check Building (contributor) to run the tests.
- Sane Coding Discord
- Twitter
@pagghiu_
- Mastodon
@pagghiu
- Github Discussion
Alternatively I am also reading the following discords too:
- Italian C++ Discord (
@Pagghiu
from any appropriate channel or just a DM, english and italian are both fine) - Handmade Network discord (
@Pagghiu
from any appropriate channel or just a DM)
Please take some time to read the Principles and Coding Style.
After that you can read the CONTRIBUTING.md guide.
Sane C++ Libraries are licensed under the MIT License, see LICENSE.txt for more information.