Fri 31 October 2025

🌧️ Sane C++ October 25

SC

Welcome to the October 2025 update!
This month internal dependencies have been further removed.

Reducing Internal Dependencies

The first part of the month month has been focused on continuing breaking internal dependencies between libraries.

The goal is for Sane C++ Libraries to be a collection of libraries that work well together, rather than a monolithic framework. Users should be able to use a single library in isolation without being forced to adopt the entire ecosystem.

Plugin, FileSystemWatcher, Async and Http libraries have seen their dependencies reduced, and the resulting dependencies graph is now starting to look a lot nicer!

Detailed list of commits:

Bring Your Own Containers

A new example called InteropSTL has been added to show how to use std::string and std::vector<char> with some Sane C++ Libraries. You don't need to use the STL containers, this is only showing that you can absolutely Bring Your Own Containers (including strings) if for whatever reason one is not interested in using String and Vector<> variations already included in the project.

Some details about how how this works: as a consequence of the dependencies reduction, in the past months a new virtual interface has been introduced (named IGrowableBuffer) abstracting strings and writable byte buffers, allowing for all libraries not to depend on the Strings or Memory libraries.
This month one more step has been done, by further optimizing it so that the only virtual function call is done when physically requiring an allocation if the available growable buffer capacity is insufficient.
Callers can always avoid this indirect function call by properly sizing the buffer before using some library.
Previously a second virtual call was always done in the IGrowableBuffer destructor, but now this has been optimized. As the number of potential virtual methods has become just one, the interface has been changed from a virtual one into a regular plain struct with a function pointer, reducing the additional indirection required by the C++ vtable dereferencing!

So now it's up to you to bring your own containers!!

Detailed list of commits:

Tools new bootstrap

SC::Tools are self contained single C++ source files that are (automatically) compiled on the fly and linked to Sane C++ to be immediately executed.
The mechanism used to compile them was historically involving both Make on Posix and NMake on Windows to rebuild SC.cpp library and the SC-${TOOL_NAME}.cpp script separately, link them and also to rebuild them only when some of their dependencies change.
Both Make and NMake have now been replaced by a native ToolsBootstrap.cpp that doesn't use any of the project's libraries.
The new bootstrap does the same work as Make but hardcoded on compiling the SC.cpp plus the SC-${TOOL_NAME}.cpp on Posix/Windows.

Detailed list of commits:

Build

The SC::Build is a tool implementing a build system generator where builds are imperatively described in C++.

This month it gets:

./SC.sh build run SCTest Debug -- --arg1 --arg2

The above invokes the SCTest executable, as built by the SCTest project with the --arg1 and --arg2 arguments.

Detailed list of commits:

Test Coverage

Test coverage has been going down a little bit over the course of the past months, so a few commits have been done with the specific target of bringing it back in the ~85% range.

Detailed list of commits:

CI

CI was suffering from some flakiness on FileSystemWatcher macOS tests.
I suspect this has to do with how github is handling macOS VM as tests never fail locally but anyway, they are less flaky now.
Also the new InteropSTL is now compiled on all supported platforms to make sure it doesn't regress.

Detailed list of commits:

Miscellaneous

And as always a bunch of fixes and minor additions throughout all libraries that are not sizable enough to have their own section in the blog post! One thing to note is that the ContainersSerialization library has been renamed to ContainersReflection as it was depending on Containers and Reflection libraries.
I want to thank Francesco (cozis) Cozzuto for reporting on Discord a couple of issues he has been finding with Valgrind!

Detailed list of commits: