• Stars
    star
    415
  • Rank 100,519 (Top 3 %)
  • Language
    C++
  • License
    MIT License
  • Created 5 months ago
  • Updated 2 months ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

Sane C++ Libraries

Windows macOS x64 Linux

Sane C++ Libraries

YouTube X (formerly Twitter) Follow Discord GitHub Repo stars

Sane C++ Libraries is a set of C++ platform abstraction libraries for macOS, Windows and Linux.

Sane Cpp

Principles:

βœ… 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:

Libraries

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)

Building

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)

macOS

  • Link CoreFoundation.framework
  • Link CoreFoundation.framework

Linux

  • Link libdl (-ldl)
  • Link libpthread (-lpthread)

Windows

  • Nothing else to link (in addition to default libs)

Examples

Check the Examples page.

Tests

Tests are built with the self-hosted SC::Build project generator, describing the builds in C++.
Check Building (contributor) to run the tests.

Getting in touch

Alternatively I am also reading the following discords too:

Contributing

Please take some time to read the Principles and Coding Style.

After that you can read the CONTRIBUTING.md guide.

License

Sane C++ Libraries are licensed under the MIT License, see LICENSE.txt for more information.