AI prompts
base on Platform Abstraction C++ Libraries [](https://github.com/Pagghiu/SaneCppLibraries/actions/workflows/windows.yml)
[](https://github.com/Pagghiu/SaneCppLibraries/actions/workflows/posix.yml)
[](https://pagghiu.github.io/SaneCppLibraries/coverage)
# Sane C++ Libraries
[](https://youtube.com/@Pagghiu)
[](https://x.com/pagghiu_)
[](https://discord.gg/tyBfFp33Z6)

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

[Principles](https://pagghiu.github.io/SaneCppLibraries/page_principles.html):
✅ 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)
Visit the [documentation website](https://pagghiu.github.io/SaneCppLibraries/index.html) for more information.
Take a look also at [DeepWiki/SaneCppLibraries](https://deepwiki.com/Pagghiu/SaneCppLibraries) for an AI-guided walkthrough of the project!
# Libraries
Each library:
- Depends on the smallest possible subset of the others libraries (see [Dependencies](https://pagghiu.github.io/SaneCppLibraries/page_dependencies.html)).
- Has minimal headers, preferring to keep as much code as possible code in the implementation files.
- Is available as a [Single File Library](https://pagghiu.github.io/SaneCppLibraries/page_single_file_libs.html) amalgamated locally / offline or directly in the browser!
Library | Description | LOC
:---------------------------------------------------------------------------------------------------------------|:--------------------------------------------------------------------------|---------
[Async](https://pagghiu.github.io/SaneCppLibraries/library_async.html) | 🟨 Async I/O (files, sockets, timers, processes, fs events, threads) | 5726
[Async Streams](https://pagghiu.github.io/SaneCppLibraries/library_async_streams.html) | 🟨 Concurrently read, write and transform byte streams | 1977
[Build](https://pagghiu.github.io/SaneCppLibraries/library_build.html) | 🟨 Minimal build system where builds are described in C++ | 4155
[Containers](https://pagghiu.github.io/SaneCppLibraries/library_containers.html) | 🟨 Generic containers (SC::Vector, SC::SmallVector, SC::Array etc.) | 874
[File](https://pagghiu.github.io/SaneCppLibraries/library_file.html) | 🟩 Synchronous Disk File I/O | 736
[File System](https://pagghiu.github.io/SaneCppLibraries/library_file_system.html) | 🟩 File System operations (like copy / delete) for files / directories | 1332
[File System Iterator](https://pagghiu.github.io/SaneCppLibraries/library_file_system_iterator.html) | 🟩 Enumerates files and directories inside a given path | 428
[File System Watcher](https://pagghiu.github.io/SaneCppLibraries/library_file_system_watcher.html) | 🟩 Notifications {add, remove, rename, modified} for files / directories | 1299
[File System Watcher Async](https://pagghiu.github.io/SaneCppLibraries/library_file_system_watcher_async.html) | 🟩 Async backend for FileSystemWatcher | 106
[Foundation](https://pagghiu.github.io/SaneCppLibraries/library_foundation.html) | 🟩 Primitive types, asserts, compiler macros, Function, Span, Result | 1173
[Hashing](https://pagghiu.github.io/SaneCppLibraries/library_hashing.html) | 🟩 Compute `MD5`, `SHA1` or `SHA256` hashes for a stream of bytes | 353
[Http](https://pagghiu.github.io/SaneCppLibraries/library_http.html) | 🟥 HTTP parser, client and server | 1257
[Memory](https://pagghiu.github.io/SaneCppLibraries/library_memory.html) | 🟩 Custom allocators, Virtual Memory, Buffer, Segment | 1219
[Plugin](https://pagghiu.github.io/SaneCppLibraries/library_plugin.html) | 🟨 Minimal dependency based plugin system with hot-reload | 1434
[Process](https://pagghiu.github.io/SaneCppLibraries/library_process.html) | 🟩 Create child processes and redirect their input / output | 1324
[Reflection](https://pagghiu.github.io/SaneCppLibraries/library_reflection.html) | 🟩 Describe C++ types at compile time for serialization | 684
[Serialization Binary](https://pagghiu.github.io/SaneCppLibraries/library_serialization_binary.html) | 🟨 Serialize to and from a binary format using Reflection | 572
[Serialization Text](https://pagghiu.github.io/SaneCppLibraries/library_serialization_text.html) | 🟨 Serialize to / from text formats (JSON) using Reflection | 645
[Socket](https://pagghiu.github.io/SaneCppLibraries/library_socket.html) | 🟨 Synchronous socket networking and DNS lookup | 855
[Strings](https://pagghiu.github.io/SaneCppLibraries/library_strings.html) | 🟩 String formatting / conversion / manipulation (UTF8 / UTF16) | 3362
[Testing](https://pagghiu.github.io/SaneCppLibraries/library_testing.html) | 🟨 Simple testing framework used by all of the other libraries | 337
[Threading](https://pagghiu.github.io/SaneCppLibraries/library_threading.html) | 🟩 Atomic, thread (+pool), mutex, semaphore, barrier, rw-lock, condition | 1324
[Time](https://pagghiu.github.io/SaneCppLibraries/library_time.html) | 🟨 Time handling (relative, absolute, high resolution) | 346
LOC | Count
:-----------------|:-----------------
Header | 8421
Implementation | 23097
Comments | 11009
*Total* | 42527
Each library is color-coded to signal its status:
🟥 Draft (incomplete, WIP, works on basic case)
🟨 MVP (minimum set of features have been implemented)
🟩 Usable (a reasonable set of useful features has been implemented)
🟦 Complete (all planned features have been implemented)
# C Bindings
Some Libraries have C bindings
Binding | Description
:---------------------------------------------------------------------------------------|:----------------------------------------------------------------------------------------------------
[sc_hashing](https://pagghiu.github.io/SaneCppLibraries/group__group__sc__hashing.html) | Bindings for the [Hashing](https://pagghiu.github.io/SaneCppLibraries/library_hashing.html) Library
# Building
Libraries can be used as is, adding a single file to your project and without needing any build system.
See [Building (user)](https://pagghiu.github.io/SaneCppLibraries/page_building_user.html) to just use the library
Shortly:
- Add [SC.cpp](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`)
## Windows
- If using MSVC required libraries are already implicitly linked through `#pragma comment(lib, ...)`
## macOS / iOS
- Link `CoreFoundation.framework`
- Link `CoreServices.framework`
## Linux
- Link `libdl` (`-ldl`)
- Link `libpthread` (`-lpthread`)
# Examples
SCExample showcases integration of Sane C++ Libraries together with [Dear ImGui](https://github.com/ocornut/imgui) and [sokol](https://github.com/floooh/sokol) libraries (see [Examples](https://pagghiu.github.io/SaneCppLibraries/page_examples.html) page).
## macOS
https://github.com/user-attachments/assets/2a38310c-6a28-4f86-a0f3-665dc15b126d
## iOS
https://github.com/Pagghiu/SaneCppLibraries/assets/5406873/5c7d4036-6e0c-4262-ad57-9ef84c214717
# Tests
Tests are built with the self-hosted [SC::Build](https://pagghiu.github.io/SaneCppLibraries/library_build.html) project generator, describing the builds in C++.
Check [Building (contributor)](https://pagghiu.github.io/SaneCppLibraries/page_building_contributor.html) to run the tests.
# Getting in touch
- [Sane Coding Discord](https://discord.gg/tyBfFp33Z6)

- [Bluesky](https://pagghiu.bsky.social) `@pagghiu.bsky.social`
- [X](https://x.com/pagghiu_) `@pagghiu_`
- [Mastodon](https://mastodon.gamedev.place/@pagghiu) `@pagghiu`
- [Github Discussion](https://github.com/Pagghiu/SaneCppLibraries/discussions)
Alternatively I am also reading the following discords too:
- [Italian C++ Discord](https://discord.gg/GPATr8QxfS) (`@Pagghiu` from any appropriate channel or just a DM, english and italian are both fine)
- [Handmade Network discord](https://discord.gg/hmn) (`@Pagghiu` from any appropriate channel or just a DM)
# Contributing
Please take some time to read the [Principles](https://pagghiu.github.io/SaneCppLibraries/page_principles.html) and [Coding Style](https://pagghiu.github.io/SaneCppLibraries/page_coding_style.html).
After that you can read the [CONTRIBUTING.md](CONTRIBUTING.md) guide.
# License
Sane C++ Libraries are licensed under the MIT License, see [LICENSE.txt](LICENSE.txt) for more information.
# Videos
On this [YouTube Channel](https://www.youtube.com/@Pagghiu) there are some videos showing bits of the development process.
# Blog posts
On [Sane Coding Blog](https://pagghiu.github.io) there is a series of posts about this project.
Relevant yearly posts:
- [Blog Post - Sane C++ Libraries (Open Sourcing)](https://pagghiu.github.io/site/blog/2023-12-23-SaneCppLibrariesRelease.html)
- [Blog Post - 1st Year of Sane C++ Libraries](https://pagghiu.github.io/site/blog/2024-12-23-SaneCpp1Year.html)
", Assign "at most 3 tags" to the expected json: {"id":"6351","tags":[]} "only from the tags list I provide: [{"id":77,"name":"3d"},{"id":89,"name":"agent"},{"id":17,"name":"ai"},{"id":54,"name":"algorithm"},{"id":24,"name":"api"},{"id":44,"name":"authentication"},{"id":3,"name":"aws"},{"id":27,"name":"backend"},{"id":60,"name":"benchmark"},{"id":72,"name":"best-practices"},{"id":39,"name":"bitcoin"},{"id":37,"name":"blockchain"},{"id":1,"name":"blog"},{"id":45,"name":"bundler"},{"id":58,"name":"cache"},{"id":21,"name":"chat"},{"id":49,"name":"cicd"},{"id":4,"name":"cli"},{"id":64,"name":"cloud-native"},{"id":48,"name":"cms"},{"id":61,"name":"compiler"},{"id":68,"name":"containerization"},{"id":92,"name":"crm"},{"id":34,"name":"data"},{"id":47,"name":"database"},{"id":8,"name":"declarative-gui "},{"id":9,"name":"deploy-tool"},{"id":53,"name":"desktop-app"},{"id":6,"name":"dev-exp-lib"},{"id":59,"name":"dev-tool"},{"id":13,"name":"ecommerce"},{"id":26,"name":"editor"},{"id":66,"name":"emulator"},{"id":62,"name":"filesystem"},{"id":80,"name":"finance"},{"id":15,"name":"firmware"},{"id":73,"name":"for-fun"},{"id":2,"name":"framework"},{"id":11,"name":"frontend"},{"id":22,"name":"game"},{"id":81,"name":"game-engine "},{"id":23,"name":"graphql"},{"id":84,"name":"gui"},{"id":91,"name":"http"},{"id":5,"name":"http-client"},{"id":51,"name":"iac"},{"id":30,"name":"ide"},{"id":78,"name":"iot"},{"id":40,"name":"json"},{"id":83,"name":"julian"},{"id":38,"name":"k8s"},{"id":31,"name":"language"},{"id":10,"name":"learning-resource"},{"id":33,"name":"lib"},{"id":41,"name":"linter"},{"id":28,"name":"lms"},{"id":16,"name":"logging"},{"id":76,"name":"low-code"},{"id":90,"name":"message-queue"},{"id":42,"name":"mobile-app"},{"id":18,"name":"monitoring"},{"id":36,"name":"networking"},{"id":7,"name":"node-version"},{"id":55,"name":"nosql"},{"id":57,"name":"observability"},{"id":46,"name":"orm"},{"id":52,"name":"os"},{"id":14,"name":"parser"},{"id":74,"name":"react"},{"id":82,"name":"real-time"},{"id":56,"name":"robot"},{"id":65,"name":"runtime"},{"id":32,"name":"sdk"},{"id":71,"name":"search"},{"id":63,"name":"secrets"},{"id":25,"name":"security"},{"id":85,"name":"server"},{"id":86,"name":"serverless"},{"id":70,"name":"storage"},{"id":75,"name":"system-design"},{"id":79,"name":"terminal"},{"id":29,"name":"testing"},{"id":12,"name":"ui"},{"id":50,"name":"ux"},{"id":88,"name":"video"},{"id":20,"name":"web-app"},{"id":35,"name":"web-server"},{"id":43,"name":"webassembly"},{"id":69,"name":"workflow"},{"id":87,"name":"yaml"}]" returns me the "expected json"