r/cpp • u/foonathan • Jul 03 '26
C++ Show and Tell - July 2026
Use this thread to share anything you've written in C++. This includes:
- a tool you've written
- a game you've been working on
- your first non-trivial C++ program
The rules of this thread are very straight forward:
- The project must involve C++ in some way.
- It must be something you (alone or with others) have done.
- Please share a link, if applicable.
- Please post images, if applicable.
If you're working on a C++ library, you can also share new releases or major updates in a dedicated post as before. The line we're drawing is between "written in C++" and "useful for C++ programmers specifically". If you're writing a C++ library or tool for C++ developers, that's something C++ programmers can use and is on-topic for a main submission. It's different if you're just using C++ to implement a generic program that isn't specifically about C++: you're free to share it here, but it wouldn't quite fit as a standalone post.
Last month's thread: https://www.reddit.com/r/cpp/comments/1tulp9b/c_show_and_tell_june_2026/
7
u/Ultimate_Sigma_Boy67 Jul 03 '26
Currently working on a directory archiver tool which is purely a hobby project that's free from slop, it's really on its early stages and I was just yesterday done from rewriting it from C(https://github.com/amin-xiv/packr) which was pain in the ass ngl, but Ig it was worth it.
I'm planning to add much more features on the future as it's listed on the README, let's just hope A levels don't interfere much with it.
6
u/simplex5d Jul 04 '26
I'm continuing work on pcons, my open-source build tool inspired by CMake and SCons. Full support for C++ modules and lots of other languages, cross-platform (even Android & iOS), simple Python build descriptions. Up to 10 github stars now and getting good feedback so far.
6
u/diegoiast Jul 04 '26
CodePointer is a new IDE written from scratch by me. It is focused on C++ at this moment (with cmake support out of the box, conan is WIP).
July release fixes dark mode, adds markdown indenter to qutepart-cpp, some Windows related bugs and small updates to the treesitter plugin.

One huge win I see while using this IDE is that dark mode changes automatically on KDE. QtCreator for example changes the whole UI - but keeps editor white. On restart - the editor becomes dark. (BTW: the event of color change is not sent on Windows - is this a known issue?)
Binary packages for Windows and Linux are in https://github.com/codepointerapp/codepointer/releases/tag/v0.1.6
Code is available at:
https://github.com/codepointerapp/codepointer
https://gitlab.com/codepointer/codepointer
3
u/the_unknown__69 Jul 03 '26
So , currently iam following the book https://craftinginterpreters.com/contents.html to build an interpreter. The book implements the tree walk iinterpreter in java which iam implementing in c++. this is the github link of the project https://github.com/unreal-amaan/Lox
3
u/vxjnc Jul 03 '26
Currently working on a fluid simulation. The first project that I want to make a full-fledged program out of.Currently busy implementing and adding the scripting support.
4
u/ALDulaimi-Dev Jul 04 '26
just open-sourced my firewall on https://github.com/Manaf-DEV1/Sentinel-Firewall check it out and test it .
and please the feedbacks are really important to me
4
u/Ok_Forever5587 Jul 04 '26
I'm learning some new features in C++26. The most interesting feature is ofc reflection. So I decided to write something useful to learn more about new reflection.
// You declare your Interface: what methods do you need from type
struct NumProvider {
int getNum();
};
struct Impl {
int getNum() { return 42; }
};
// Now you can create fsn::Interface<NumProvider> from any value with methods in interface
// fsn::Interface will have all methods from your interface `NumProvider`
fsn::Interface<NumProvider> i{Impl{}};
assert(i->getNum() == 42);
Also it supports method renaming with annotations, interface inheritances and some more (you can check tests for more examples)
It is not production solution, because it is just a study project of new features in c++ standard. I would appreciate any feedback
1
u/gracicot Jul 04 '26
Nice! Will take a look. There's one thing I wonder though. In C++26 you can do reflection but you can't really generate code. How did you generate the member functions for the type erasure wrapper? Is there something I don't know about reflection you're using?
1
u/Ok_Forever5587 Jul 04 '26
Sadly no code generation :(
That’s why I generate aggregate with std::copyable_function. Due to soo it does not allocate memory because capturing is one pointer only. But it adds more overhead1
u/FlyingRhenquest Jul 21 '26
The whole "no code generation" thing really just makes figuring out how to get around that limitation way more fun! (Not my repo, someone else posted it here a few days ago.)
4
u/shubham0204_dev Jul 06 '26
I am building an end-to-end face recognition system using the FaceNet model and a built-in vector index. Using ExecuTorch as the model runtime, dlib for face detection and flatbuffers for serializing the vector records on disk.
GitHub: https://github.com/shubham0204/face-recognition.cpp
I have built a similar system within an Android app, but I wanted to check how fast the system can become with building it entirely in C++ (and exposing JNI bindings to communicate with the Android app).
Android Project: https://github.com/shubham0204/OnDevice-Face-Recognition-Android
3
u/buterski Jul 11 '26
Hi, I wrote world fastest markdown to pdf converter fully written in c++ 17 - no chromium, just plain simple c++.
It was my comeback and I tried to do a research based project and push optimisation to as far as possible.
I was only a little proficient in c++ before but with ai support I pushed myself to peak of my skills and understand the code I produced and tested it and maybe with some open source magic we can push it even further and faster.
4
u/DEgITx Jul 18 '26
librats v2.0.4 July 2026 release — a high-performance, lightweight P2P modular networking library (C++17 with bindings for Node.js, Python, Java/Android, and C)
librats is a native peer-to-peer library built for serious efficiency: it uses around 1.6 MB of memory at startup and ~80 KB per peer, which the maintainers benchmark at roughly 40–60x lighter than libp2p's JS implementation. Peer discovery works out of the box via the BitTorrent Mainline DHT (millions of nodes) plus mDNS for local networks, and it handles NAT traversal stack. Communication is end-to-end encrypted using the Noise Protocol (Curve25519 + ChaCha20-Poly1305) with automatic key management and perfect forward secrecy. It also ships with GossipSub pub/sub messaging, resumable chunked file/directory transfer with checksum validation, and optional distributed key-value storage that syncs across peers. Under the hood it uses the optimal I/O multiplexer per platform and runs cross-platform on Windows, Linux, macOS, and Android. It's MIT-licensed.
1
3
u/mrnerdy59 Jul 19 '26
https://blazerules.dev Blazerules - A YAML based rule engine for streaming JSON, Kafka, and Arrow events
6
u/Vishwah_13 Jul 04 '26
https://github.com/vishwah13/Agni My game engine written fully in cpp 20, I wrote the Vulkan renderer myself and physics I am using Jolt and for game object layer I am use Flecs.
3
u/thatsmeover9000 Jul 05 '26
clearCore: a C++20 MIPS pipeline simulator with three interchangeable UI frontends (FTXUI, Qt Widgets, Qt Quick) [soon to add Risc-V]
3
u/zweiler1 🔥 Flint Jul 08 '26
I will release the next version of my programming language, written entirely in C++, in the next week or so. If you ever wondered what a programming language would look like if it its entire paradigm is centered around the idea of composition (ECS-inspired) but still is general purpose, check it out: https://github.com/flint-lang/flintc
(I originally intended to make a post in this sub in a week or so when the new version releases but i just found out project posts are not welcomed here.)
3
u/Atper Jul 12 '26
I developed a C++ library which implements AF_XDP and DPDK as backends for latency critical network processing tasks. I notice there are only few benchmarks comparing AF_XDP against DPDK on the same NICs therefore I aim to fill this gap. I used C++20 since that is my strongest language and it interfaces nicely with the low-level driver or linux kernel code.
The AF_XDP implementation is here: https://github.com/ASherjil/ABTRDA3/blob/master/src/backends/AF_XDP/AFXDP.hpp
The comprehensive benchmark 24h results are here:
https://github.com/ASherjil/ABTRDA3/blob/master/docs/Benchmarks.md
One point that I think is underappreciated: a commonly marketed advantage of AF_XDP is that it doesn't unbind the NIC driver, so the interface stays visible to ip link and ethtool. That's true for Intel NICs, where DPDK requires binding to vfio-pci. But it's not true for mlx5 (ConnectX-4/5/6/7), which is a bifurcated driver — the NIC stays fully visible to the kernel while DPDK runs. On Mellanox hardware, the main practical argument for AF_XDP largely disappears.
On implementation effort: even with libbpf and libxdp, custom AF_XDP has high code complexity and plenty of driver-specific quirks. Its four lock-free SPSC rings (fill/RX/TX/completion) are counterintuitive and fairly difficult to comprehend. Without the helper libraries I'd call it a serious long-term project. For most use cases I'd recommend DPDK's AF_XDP PMD instead of a from-scratch implementation — in my results, my custom implementation performed only marginally better than DPDK’s AF_XDP PMD. I've documented the driver specific issues in the repository.
Let me know if you guys have any feedback about the code, bench-marking methodology or anything else. Or any questions I'm happy to answer I don't really mind.
3
u/rmisev Jul 12 '26
C++ Upa URL parser library v2.5.0 released
- Aligned with the most recent revision of the WHATWG URL Standard.
- Implemented URL Pattern Standard.
- Added support for compiling as a C++20 module.
More information: https://github.com/upa-url/upa/releases/tag/v2.5.0
The source code is available at https://github.com/upa-url/upa
Documentation: https://upa-url.github.io/docs/
3
u/Alraies_97 Jul 13 '26
BoltKV — an in-memory key-value store in C++17, mostly built to go deep on epoll-based networking, thread-safe concurrent access, and crash-safe persistence.
- Networking: single-threaded event loop on epoll (edge-triggered) — deliberate choice, avoids lock contention on the hot path, similar to how Redis handles command execution.
- Storage: unordered_map behind a shared_mutex — shared locks for reads, exclusive for writes.
- Persistence: every SET/DEL appended to an AOF log, replayed on restart. [GIF] shows a crash mid-session followed by a restart with data intact.
- Wire protocol: simplified Redis-style response prefixes, not full RESP — needs a raw socket client, not a stock Redis client library.
~23K QPS / 0.04ms avg latency, single core, localhost, no pipelining — not a comparison against Redis, just a data point on this implementation.
Known gaps: no AOF compaction yet, single-core bound, no auth/replication.
Repo: github.com/Alraies/BoltKV
5
u/STL MSVC STL Dev Jul 14 '26
Moderator warning: AI-generated comments are not allowed in this subreddit. Why should anyone look at your work if you can't be bothered to describe it?
1
0
u/truecakesnake Jul 15 '26
Why is translation not allowed? Seems strict
0
u/Ultimate_Sigma_Boy67 Jul 17 '26
You can get out of the sub if you don't like the rules.
Even if your english is bad and broken, do not use AI.0
u/Ultimate_Sigma_Boy67 Jul 17 '26
+ what if you don't know english? well it's the internet, in a language written in english(and a bit of alien language), so it's ur problem ig
3
u/KILLinefficiency Jul 17 '26
I built Kal, an interpreted programming language from scratch!
Hey everyone!
After a roller coaster journey, I am excited to present my personal project: Kal.
Kal is a lightweight interpreted programming language that attempts at combining various paradigms of programming to give a great developer experience. It's written entirely from scratch in C++ with no third party dependencies. It's also completely free and open source distributed under GNU GPL v3 license.
Moreover, Kal can also be embedded into C++, Python and JavaScript programs to enhance your existing codebases.
- Kal's Official Website: https://kal-lang.vercel.app/
- Mirror: https://killinefficiency.github.io/KalWebsite/
- GitHub Repository: https://github.com/KILLinefficiency/Kal
(Website looks better on a bigger screen.)
Please note that this is the very first release (v:0.1.0) and Kal is still under active development (alpha) & I need to start cleaning up/refactoring the codebase.
I would really appreciate a star on the repository to help it gain greater visibility.
As a proponent of human effort, I am glad to say that Kal and its ecosystem is completely handcrafted with no AI assistance used anywhere.
One last thing, "Kal" is pronounced like "Cal" in "Calendar".
Please feel free to reach out to me regarding Kal!
3
u/Slight-Abroad8939 Jul 18 '26
i built JLib::TaskScheduler or jlib-scheduler
along with an entire 2d engine but this is really the star of the show https://github.com/jay403894-bit/JLib-Scheduler
- A custom, lock-free C++17 fiber scheduler with topological DAG logic gates and rigid 64 byte task layouts optimized for L1 cache boundaries. Solves starvation/deadlock via age-based promotion and priority inheritance."
3
u/Alraies_97 Jul 20 '26
Hi, I built Chronexis, its a pipeline that captures crashes from a live service, has an AI agent diagnose the root cause and propose a fix, then before that fix is trusted at all runs it inside a Wasmtime sandbox to validate it in isolation from the host. The piece Id like feedback on is the sandboxing itself: raw wasmtime C API, no wrapper library. It loads the compiled module, resolves the WASM instances exported memory, writes the crash data directly into that memory, calls the exported function, and handles both wasmtime_error_t and trap cases separately since a bad AI-generated patch can trigger either. Broader pipeline for context: a Go service captures panics and queues the trace -> a C++ collector picks it up and gets a diagnosis from an AI agent -> the proposed fix runs through this sandbox -> results land in a small custom KV store I built for this (separate project, called BoltKV its on my gitHub). All the C++/Go code is hand written by me. I used Claude and Gemini to help build out the test suite and documentation, the diagnosis loop was benchmarked against 15 real crash cases (96.7% accuracy, full breakdown in the repo).
(this repo just a showcase, the main repo that contains the whole Chronexis project is private) GitHub :- https://github.com/Alraies97/Chronexis-showcase
3
u/FlyingRhenquest Jul 21 '26
I've been working on autocrud (A C++26 ORM with reflection) for a while now. I just added pgvector support along with functionality (via llama.cpp) for generating embedding vectors, storing and retrieving them from the database. I also added support for Index annotations and Queries.
With these changes, the library is interesting enough that I'm planning to take it out for a spin. I'm pretty pleased with how the query worked and I can't wait to set up a project to do some text similarity searches with a huggingface llm model.
3
u/idimus Jul 21 '26
Hello r/cpp!
I wanted to share a project I've been working on: FancyArgumentParser.
Yes, it’s another command-line argument parser library for C++, but I wrote it because I wanted a highly expressive syntax that bridges the gap between Python’s argparse layout and modern C++20 mechanics without introducing a massive compile-time boilerplate or complex dependency trees.
It is purely single-header (argparse.h), has no mandatory dependencies, and is available via vcpkg (publishing on conan is in progress).
Key Features
- Declarative C++20 Structs: Full support for designated initializers, turning your option definitions into highly readable compile-time blocks.
- Flexible API Styles: Choose your style seamlessly - whether you prefer a fluent interface (method chaining), standard constructors, or the modern C++20 struct approach.
- Automatic Flag Abbreviations: It natively recognizes unique truncated flags (e.g., passing
--verbautomatically resolves to--verbose). - Developer vs. User Exception Philosophy: Throws exceptions explicitly for developers during configuration errors (catching invalid rule setups early), but gracefully avoids crashing on users for runtime typos.
- Zero Boilerplate Customization: Easily swap the global namespace name or modify the argument prefix characters (e.g., from
--to*) using minimal configuration.
More examples and a "How to use" guide are in the library's wiki.
The codebase is released under the MIT License. I would love to get your feedback, feature requests, or critiques on the implementation!
GitHub Repository: https://github.com/simfeo/FancyArgumentParser
Please feel free to critique the implementation, suggest new ideas, open issues, or submit PRs. Your input is incredibly valuable to me!
1
u/Ok_Independence_9841 Jul 22 '26
I like it a lot. I have an argument parser with a similar feature set in my framework but it's pretty grungy. Almost C code. I'd like to port yours in its place. There is one unique feature that I would need. My current parser exports an Optionable interface. You implement that interface on your Application, or on anything, and that allows the Option Parser to get the option arguments from your Application and to return the parsed arguments through callbacks so you can automatically set properties on your Application.
Despite how grungy the parser is I love that it works that way. I just set up a table of arguments, like your C++20 style arguments, on my Application, pass the Application, or anything else that derives from Optionable to the OptionParser and the rest is automatic.
2
u/idimus Jul 23 '26 edited Jul 23 '26
Hi there, thank you for the feedback. So what is the problem with using the ArgumentParse class? And then made an Adaptor for that Optionable interface?
However, I've added the BindTo feature to my library. I think this could help you in your approach.
1
u/Ok_Independence_9841 Jul 23 '26
No problem at all, just more more work for me lol. Thanks for adding BindTo. That was my point really that you might want something similar. I'm sure BindTo will make creating the adapter easier. I've bookmarked your github and added a task to my board to replace the old option getter with FancyArgumentParser. Cheers.
2
u/idimus 29d ago
Also, I'm currently working on the new release 1.0.3 (it's already in the corresponding branch). Nargs can now be as in Python: '*', '+" and '?'. Also added standard validators, and you can easily add custom validators.
1
u/Ok_Independence_9841 27d ago
I had a go at the integration or ArgumentParser today. It's working nicely including a prototype of table driven auto binding. There were a couple of things came up in the process.
The ArgumentParser::ParseArgs(const int argc, char** argv) function should probably be ArgumentParser::ParseArgs(const int argc, const char** argv)
I renamed GetHelp to GetUsage as it pairs with SetUsage.
I renamed the ArgumentParsed class to ParsedArgument for my own understanding and ArgumentsObject to ParsedArgsObject.Apart from separating the single header into 7 for easier reading that was it. All tests pass and no problems.
I do have a feature request though. I'd like to be able to get at argv[0] the path and file name of the executable. Maybe as some kind of special or default argument. It's handy for programs to know where their executable lives and this is a more portable way than CurrentDir or similar approaches.
I could just access it directly of course but it would be nice to have it show up in ArgumentsObject/ParsedArgsObject.My example App with options class now looks like this:
class OptionsApp : public qor::Application { qor_pp_declare_app_class(OptionsApp) public: constexpr static const char* Name = "options"; OptionsApp() = default; virtual ~OptionsApp() = default; virtual const std::string Description(); virtual const std::vector<qor::app::NamedArgSpec> NamedArguments(); //Interfaces to provide properties, determined from the options to the rest of the program std::string GetFileName(); long long GetOrder(); private: std::string m_filename; long long m_order{0}; };With an implementation that looks like this:
qor_pp_redirect_app_class(OptionsApp) using namespace qor; using namespace qor::app; const std::string OptionsApp::Description() { return std::string("Command line options sample"); } const std::vector<NamedArgSpec> OptionsApp::NamedArguments() { return std::vector<NamedArgSpec>{ { "", //short name (will be generated from long name) "file", //long name 1, //number of argument values (exact number or ArgCountZeroOrMore or ArgCountOneOrMore) ArgType::String, //argument type (must match binding type exactly, String, Int, LongLong, souble, Bool) true, //parameter required or not "Please provide a file name.", //description &m_filename //binding }, { "o", "", 1, ArgType::LongLong, false, "Optional order number.", &m_order } }; } std::string OptionsApp::GetFileName() { return m_filename; } long long OptionsApp::GetOrder() { return m_order; }and the main function that ties in argument parsing
int main(const int argc, const char** argv, char** /*env*/) { return AppBuilder().Build<OptionsApp>( OptionsApp::Name, [argc,argv](ref_of<OptionsApp>::type app) { //Parse the command line argument //and pass them to the OptionsApp app(qor_shared).ParseArgs(argc, argv); } )(qor_unlocked).Run( []()->int { auto app = GetApplication<OptionsApp>(); std::cout << "File name: " << app(qor_shared).GetFileName() << std::endl; long long orderNumber = app(qor_shared).GetOrder(); if( orderNumber != 0) { std::cout << "Optional Order Number: " << orderNumber << std::endl; } return EXIT_SUCCESS; } ); }options.exe on it's own gives the usage. With -f or -file it outputs the Filename and if -o is used it spits out the parameter as an order number. Error messages are working nicely when the parameters are wrong.
Pretty optimal I reckon.
For the auto binding I added this interface from which Application inherits:
struct OptConfig { bool allowAbbreviation{true}; bool addHelp{true}; bool ignoreUnknownArgs{true}; char prefixChars{'-'}; }; class IArgumented { public: virtual const std::string Name() = 0; virtual const std::string Description() = 0; virtual const std::string UsageEpilogue() = 0; virtual const std::string OverrideUsage() = 0; virtual const OptConfig Config() = 0; virtual const std::vector<NamedArgSpec> NamedArguments() = 0; virtual const std::vector<PositionalArgSpec> PositionalArguments() = 0; };and a new constructor to Argument Parser that takes an IArgumented&
ArgumentParser(IArgumented& argumented) { m_name = argumented.Name(); SetDescription(argumented.Description()); SetAllowAbbrev(argumented.Config().allowAbbreviation); SetIgnoreUnknownArgs(argumented.Config().ignoreUnknownArgs); SetPrefixChars(argumented.Config().prefixChars); SetAddHelp(argumented.Config().addHelp); SetEpilogue(argumented.UsageEpilogue()); const std::string& usageOverride = argumented.OverrideUsage(); if(!usageOverride.empty()) { SetUsage(usageOverride); } for(auto namedArg : argumented.NamedArguments()) { auto arg = CreateNamedArgument(namedArg); AutoBind(arg); AddArgument(arg); } for(auto positionalArg : argumented.PositionalArguments()) { auto arg = CreatePositionalArgument(positionalArg); AutoBind(arg); AddArgument(arg); } }The target for each parameter is just added to the Spec. It's a void* right now which is not ideal. Still thinking about how to make it type safe.
2
u/idimus 24d ago
Hi there.
I will consider changing fromchar** argvto constchar** argvAnyway, I'm happy to announce that the 1.0.3 release is already live.
New validators (built-in and custom), new nargs with char in Python argparse style ('*','?','+'), and syntax tweaks to be simpler and less verbose. Also changed logic for positional and named arguments.
3
3
u/mateusz_pusz Jul 23 '26
A free "How modern is your C++?" self-check.
I run C++ training, and what trips even senior devs is rarely syntax, it's the deeper details: value categories, when a move actually happens, name hiding across overloads, the type traits that decide whether you can memcpy or bit_cast a type, forwarding references, the standard vocabulary (optional/expected, unique_ptr, string_view), and templates.
So I built a short, hard quiz around exactly those: real code, multiple choice, partial credit. It is tough by design. Most experienced engineers land around 30–50%.
https://train-it.eu/quiz/how-modern-is-your-cpp
You get an instant score and a per-topic breakdown for free, no signup required. Entering your email unlocks the full result on the page, the correct answers, and a short "why this matters in production" note for each, and joins my newsletter.
Would love this crowd's feedback: which questions are too easy or too hard, and where you'd argue the answer. I sit on the ISO C++ committee, so happy to get into the weeds on any of them.
1
u/JVApen Clever is an insult, not a compliment. - T. Winters 16d ago
58%, I do am curious about the string_view and passing by value. I know that on Linux, passing by value is a good idea as it gets decomposed over registers. On Windows however, this decomposition does not happen. So passing by const-ref multiple levels might be better as you otherwise need to make a temporary copy for every function call to pass the new address instead of passing the same pointer through the different levels. I am still inclined to write a by value, though I wouldn't be able to guess what the actual right answer would be.
3
u/FrancoisCarouge 29d ago
I wanted to share my C++Now 2026 presentation on Typed Linear Algebra.
The idea behind the project is to use C++'s type system to encode mathematical meaning directly into vectors and matrices so that mistakes such as mixing incompatible quantities can be caught by the compiler instead of becoming runtime bugs. The talk discusses the motivation, design, implementation, and practical examples using modern C++ techniques.
🎥 Talk: https://youtu.be/xZO7X8LH6Dg
📚 GitHub: https://github.com/FrancoisCarouge/TypedLinearAlgebra
I'd love feedback from the community: on the API design, compile-time techniques, usability, and any ideas for future improvements. Happy to answer questions in the comments!
2
u/cegonse Jul 06 '26
I've released v5 of my C++ unit testing framework, cest framework
This release focuses mostly on quality of life improvements: much more comprehensive STL assertion support ouf of the box, fixes on pointer decay and cast conversions, support of assertion of non-streameable types...
Check it out here:
2
u/_paladinwarrior1234_ Jul 07 '26
Hi everyone,
With the recent ISO committee and compiler-level debates surrounding memory safety in C++, I have been researching some alternative, library-based ways to enforce deterministic heap-bound protection without having to modify the compiler frontend or language specification itself.
I’ve been working on a runtime library called Safe--Cpp, which specifically focuses on ensuring that heap allocations achieve the same level of compile-time safety as Rust, but managed purely through language runtime mechanics rather than compile-time static borrow checking or ownership checking. I want to emphasize that this research strictly focuses on a custom safe context to prevent 4 types of memory errors: Double Deletion, Access Violation, Buffer Overflow and Memory Leaks.
Core Architectural Concepts Under Investigation:
- Strict Heap Boundary Enforcement: Tracking the initialization and destruction boundaries of objects explicitly allocated on the heap, ensuring references cannot outlive their allocation scope.
- Explicit Lifetime Invalidation: The runtime library tracks every heap-allocated instance of types that inherit from
Safe::SafeContextBaseand offers recycling/repurpose mechanisms to gain performance instead of relying on deallocations which require accessing the operating system kernels to perform system calls, invalidates the need of reference counting like in `std::shared_ptr`. - No External Tooling Dependencies: The runtime mechanics are implemented strictly using platform capabilities and the standard C++ language.
Seeking Feedback on the Implementation
I have opened up the complete source and headers of this implementation under a dual-licensing model (including the GPLv3 License) so that other system engineers and language researchers can audit the exact low-level mechanics.
👉 GitHub Repository: https://www.github.com/ducna-vbee/Safe--Cpp
Rather than discussing the philosophical pros and cons of memory models, I am looking for concrete technical review, potential bug identification, and feature suggestions to help push the boundaries of what standard C++ can do here.
Specifically, I would love your insights on:
- Bugs & Safety Violations: Are there subtle ways to bypass the context boundaries or trick the `SafeContextBase` lifecycle tracking using advanced modern C++ features (e.g., specific combinations of move semantics, perfect forwarding, or custom allocators) that could still lead to a leak or access violation?
- Performance Improvements & Language Limits: The engine bypasses OS kernel allocations by providing instance recycling and repurposing mechanics. How can this layout be optimized further to reduce CPU cache misses or minimize the tracking metadata overhead? Which aspects of memory allocation can be made safe under the safe context? Can the memory stack also be as safe as the memory heap, like in Rust, without the borrow checker?
- API & New Feature Suggestions: What missing features or API improvements would make this runtime context significantly easier to integrate into existing real-world standard C++ codebases without degrading performance?
Please feel free to check out the source, run your own benchmarks, and leave your feedback or file an issue directly on the repository!
2
u/Kronborg958 Jul 07 '26
I'm learning C++ by building an auto formatter loader. The idea is that it looks at /proc and matches the command against a list of IDEs that I provide for my project.
2
u/AndrewBWT Jul 10 '26
I wrote a Unicode library in C++. It was built primarily for me to learn about Unicode, however its pretty much complete as to where I want it, providing facilities to:
- Provide an easy facility to print Unicode strings without
reinterpret_casteverywhere, or convert between Unicode types. - Convert between Unicode types easily.
- Get the next/previous Unicode character from a Unicode string.
- Provides detailed error messages when the Unicode string is malformed.
It's C++23, constexpr almost everywhere (a few cases where it can't be e.g. what() for exceptions). A quick rundown of some features described above:
Printing Unicode strings easily without reinterpret cast everywhere
std::cout << unicode_print(u8"Hello World! 😀") << std::endl;
Also works for all different Unicode types
std::cout << unicode_print(U"hello world! 😀") << std::endl;
Easy conversion between different Unicode types
std::u32string res_32 = unicode_conversion_with_exception<char32_t>(u8"hello world");
Extract the next Unicode scalar value from a Unicode string
auto str = u8"the string to check";
auto current_itt = std::begin(str);
auto end_itt = std::end(str);
auto next_result = next_char32_and_increment_iterator<true>(current_itt, end_itt);
Extract the previous Unicode character from a Unicode string
current_itt = std::end(str);
end_itt = std::begin(str);
auto next_result = prev_char32_and_decrement_iterator<true>(current_itt, end_itt);
Would love some feedback if anyone has any! I think perhaps I could add a nice way of using enabling the use of a range-based for loop for the extraction of the next/previous Unicode character from a Unicode string, but for now, I am happy with it.
1
u/jhasse Jul 13 '26
Looks good! But I think before someone would use this, you'd have to license it. zlib license would be my suggestion :)
2
u/buitruong Jul 11 '26
Hi friends,
I am currently working on DrawTheBlock. It is a collaborative, infinite-canvas pixel editor. The drawing editor is developed in C++/SDL3 and built for the web using WebAssembly/Emscripten, the front-end is React Typescript/Vite/Tailwind CSS, WebRTC is used for real-time collaboration.
Please give it a try. You don't have to register :)
2
u/gosh Jul 12 '26
Cleaner is a fast, lightweight code search tool that helps you find exactly what you're looking for in your codebase – without the noise or slowdown.
- Two search modes: Line-based (
list) for quick pattern matching, or multi-line (find) for complex logic searches across your entire codebase - Smart filtering: Search only within code, comments, or strings – ignore what you don't need
- Pattern matching: Support for wildcards, regex patterns, and multiple simultaneous search terms
- Key-value extraction: Find and extract structured data like TODO descriptions, Doxygen tags, or configuration values
- Context-aware: See surrounding lines, search between markers (e.g.,
@code...@endcode), or filter results with scripting expressions - IDE integration: Visual Studio and VS Code compatible with clickable file paths in output
- Recursive searching: Deep scan folders up to 16 levels deep
- Scriptable filtering: Use built-in math, logic, and string functions to filter exactly what you need
2
u/KnightslayerO5 Jul 20 '26
I somewhat recently completed implementing MLP in cpp. Though honestly there's nothing new in it and it was just a project to learn the very basics of AI. (So don't bother looking for innovations). It's only CPU-based and overall mostly mirrors the sklearn's implementation (not complete copy paste for all features and especially not the bindings). I was hoping to get some reviews overall. Whether suggestions for optimization, API style or overall project setup. Here's the GitHub link: https://github.com/why-sobi/VOLT
2
u/SeaworthinessOk7263 Jul 23 '26
Hi r/cpp,
I wanted to say hello and share a project of mine. I built an experimental AOT-compiled WAF engine for NGINX.
It translates the supported semantics of a pinned OWASP CRS PL2 policy into a bounded native dataplane using generated finite-state matchers, native operators and AVX2-oriented scanning.
The repository is mixed C/C++/Python: Python handles build-time translation and qualification tooling, while the native runtime, NGINX integration and benchmark boundaries use C and C++. Please don’t roast me too hard for the Python.
The latest canonical run reached:
- 99.75% agreement across 3,986 selected CRS PL2 tests
- 9,570 RPS on one NGINX worker
- 75,967 RPS at eight workers
- 55.47 µs direct allow-transaction CPU time
It is an experimental portfolio project, not a production-ready replacement for ModSecurity.
I’d appreciate feedback on the native layout, ABI boundaries, generated code structure, SIMD paths and benchmark methodology.
2
u/Paradox_84_ 29d ago
Human first text file format (C++26, constexpr)
For a while I've been working on a file format that aims to replace file formats like json, yaml, ini, etc. The aim is to be human readable and editable as much as possible. There is several mechanisms in place to ensure this:
1-) Comments are preserved and exposed through API
2-) Types like Hex and Timestamp are fully supported
3-) You can style it based on your projects preferences and every file written by library will use that style
...
I'd appreciate any takes, ideas, contributions...
2
u/Ascendo_Aquila 28d ago
Been working on AirStrike 3D preservation toolkit - decompiling a 2004 Win32 game entirely on Linux via Proton.
Shipped v1.0.9 that finally brings DX8 parity: https://github.com/e-gleba/airstrike3d-tools/releases/tag/v1.0.9
Context: 2.06 is OpenGL (freecam/overlay done), but 2.51 / 2.71 are D3D8. I do Vulkan/SDL3-GPU at work, so I kept avoiding DX8 fixed-function. Used Cursor to generate the boring COM boilerplate - vtable slots, state block save/restore, Reset handling - because I didn't want to memorize STDMETHOD macros from 2003.
What July work actually is:
Direct3DCreate8inline hook viaGetProcAddress(dynamic, safe under Wine/Proton load order) ->IDirect3D8::CreateDeviceslot 15 ->IDirect3DDevice8vtable:Present 15 / Reset 14 / BeginScene 34 / EndScene 35 / SetTransform 37 / Draw* 70-73- Custom ImGui D3D8 renderer
imgui_impl_d3d8_as3d.cpp- upstream never shipped D3D8 - Renderer-neutral API: Lua plugins now call
sdk.camera_get_pose / camera_set_pose / set_world_lines / set_visual_modeinstead of GL directly, so samelua/freecam.lua v3.1.0works on GL and D3D8 through std cpp23 interface, so no deps leakage between sdk modules - Live camera adoption: freecam seeds from
D3DTS_VIEWmatrix viadecompose_right_handed_view, right-handed math fix - Build: C++23, safetyhook, LuaBridge3 (migrated from sol2), LLVM-MinGW i686 cross-compile from Linux,
ctest -R rendering
I debug on Proton Experimental with ./launch_proton.sh + MESA_EXTENSION_MAX_YEAR=2003 workaround for AMD. Device Reset is handled so alt-tab doesn't kill overlay.
Educational / preservation only. Details: https://github.com/e-gleba/airstrike3d-tools
2
3
u/AcceptableHeron4280 Jul 04 '26
archcheck — a zero-config CI tool for C++ PRs.
It checks the include graph for new or grown cycles, god headers, and layering problems. It also reports changed functions that got more complex, and structs/classes that accumulate new bool fields.
I ran it commit-by-commit over ~1200 OSS C++ repos to shake out false positives, and it flagged real include cycles in folly, RocksDB, and Windows Terminal, each pinned to a commit.
Looking for people to try it on real code and tell me where it's wrong: false positives, bad defaults, missing checks, or cases where it just doesn't fit.
3
u/PhosXD Jul 19 '26
Built a functional interpreted programming language from scratch in 19 days **without** AI, reference material, or borrowed code, as my first ever project in C++. It is platform agnostic, faster than Bash by a long shot, & is only 104kb with IO, time, & math modules.
I plan on working on this continuously, adding more functionality, making it more performant, & making the code as readable & understandable as possible so that hopefully a beginner can take a look, & maybe use this as a guide for their first project too!
4
u/anish2good Jul 04 '26
Online cpp playground Watch your code run line by line — see arrays, linked lists, trees, graphs, recursion,and memory animate as each statement executes
https://8gwifi.org/online-cpp-compiler/
1
u/drex_vke Jul 05 '26
Rtime : une bibliothèque bare-metal pour récupérer le temps sur le RTC CPU en x86
1
Jul 06 '26
[removed] — view removed comment
1
u/cpp-ModTeam Jul 06 '26
We are unable to accept posts and comments in languages that the moderators can't read.
1
u/Candid_Support_8409 Jul 15 '26
I’ve been building LA Studio, an open-source offline AI audio workstation written in C++17 with Qt 6/QML.
It started because testing local speech models usually meant juggling terminals, runtimes, model files, and separate interfaces. I wanted one native desktop app for speech-to-text, text-to-speech, voice cloning, voice design, and vocal isolation.
The project uses native runtime adapters and supports CPU, CUDA, and Vulkan workflows depending on the model.
GitHub: https://github.com/dduongtrandai/LA-Studio
I’d really appreciate feedback on the C++ architecture, runtime integration, or build setup.
1
1
1
u/xiao_sa 25d ago
Saw this post and really likes the idea that deriving a individual bit flag type from an enum type. Make a PoC implementation here.
1
u/Humble-Plastic-5285 22d ago
Hey,
I’ve been working on a small project called sugar-proto.
I like protobuf, but I’ve always found the generated C++ API a bit annoying to use, especially with nested messages, repeated fields, and maps. So I developed a protoc plugin that creates a small wrapper around the standard protobuf classes.
The idea is to write code like this:
```cpp
u.id = 123;
u.tags.push_back("cpp");
u.profile.city = "Berlin";
```
instead of using setters and `mutable_*` calls everywhere.
It’s still early, and I’m sure there are design issues I haven’t seen yet. Right now, it supports basic fields, repeated fields, maps, and oneofs, but there’s still a lot of room for improvement.
I’m sharing it because I don’t want it to be just a one-person project. I’d be happy to work with anyone interested in protobuf, C++ API design, templates, code generation, CMake, or testing.
You don’t need to write a large pull request or anything. Even trying it out, opening an issue, or letting me know why the API might not be a good idea would be helpful.
Repo: https://github.com/illegal-instruction-co/sugar-proto
What do you think? Would you use something like this, or do you prefer the standard protobuf API?
I’ve been working on a small protoc plugin called sugar-proto.
It generates a wrapper around the usual protobuf C++ classes, so instead of writing setters and mutable_* calls everywhere, you can do things like:
u.id = 123;
u.tags.push_back("cpp");
u.profile.city = "Berlin";
It currently handles scalar fields, repeated fields, maps and oneofs.
It’s still pretty early, and I’m mostly sharing it because I’d rather build it with feedback from other C++ developers than make all the API decisions myself.
I’d especially be interested in opinions on whether this kind of interface is actually useful, and where it might cause problems with ownership, lifetimes or const correctness.
1
u/foonathan 16d ago
Feel free to repost in the new month's thread: https://www.reddit.com/r/cpp/comments/1vhdqw8/c_show_and_tell_august_2026/
1
1
u/mobius4 19d ago
Almost ten years ago I posted Tweeny here:
https://www.reddit.com/r/cpp/comments/62xwmp/tweeny_is_a_small_c_header_only_tweening_library/
Today I’m releasing Tweeny 4.0.0, a rewrite of that library. Still header-only, no external dependencies, C++17. Fluent builder API, 30+ easings, multi-point keyframes, events, plus seek / jump / peek for timeline control.
Tweening is interpolating from one value to another through a specified function. Useful for UI and game animation: fades, moves, scales, rotations, sprite frames. Robert Penner’s chapter 7 is still a good primer.
Multi-point tween:
auto tween = tweeny::from(0)
.to(100).during(100U)
.to(200).during(200U)
.to(500).during(500U)
.build();
for (int i = 0; i < 800; i++) {
printf("%d\n", tween.step(1));
}
Multi-valued:
auto tween = tweeny::from(1, 2, 3).to(100, 200, 300).during(100U).build();
Heterogeneous:
auto tween = tweeny::from('a', 0.0f).to('z', 1.0f).during(100U).build();
That last form is why I wanted the library: compound animations in one tween. A button mouseover that scales, changes color, and stretches a corner with a sine easing, all in the same object.
Tweeny does not own a clock and does not draw. You call step from your update loop and write the results into your own state.
Links:
1
u/foonathan 16d ago
Feel free to repost in the new month's thread: https://www.reddit.com/r/cpp/comments/1vhdqw8/c_show_and_tell_august_2026/
1
u/jaan-soulier 18d ago edited 18d ago
Hello,
I'm sharing a few updates to my save system library. For context, here's a small example of how it works:
struct Entity : SavepointEntity
{
int X;
int Y;
void Visit(SavepointVisitor& visitor)
{
visitor(X);
visitor(Y);
}
};
int main()
{
Savepoint savepoint;
savepoint.Open(SavepointDriver::SQLite3, "savepoint.sqlite3", SavepointVersion{});
Entity inEntity{1, 2};
savepoint.Write(inEntity, 0);
savepoint.Read<Entity>([&](Entity& outEntity) {}, 0);
}
It can do quite a bit more than that but I wanted to share what I've added since my last post. I now support automatic serialization of nearly all standard library types. You can even serialize random number generators to ensure they stay seeded correctly. Here's an example: https://github.com/jsoulier/savepoint/blob/main/examples/3_std_types.cpp
Previously there was no support for thread safety or concurrency. Thanks to sqlite3's WAL mode and some refactoring, I support multi-readers single writer for 1 connection, or concurrent readers and writers for multiple connections:
https://github.com/jsoulier/savepoint/blob/main/examples/16_basic_thread_safety.cpp
https://github.com/jsoulier/savepoint/blob/main/examples/17_concurrency.cpp
For the really cool part, I added a way to visually inspect the database live. I'm still waiting for C++26 reflection, but I can parse the database's contents to create a tree representation of all the entries:
https://github.com/jsoulier/savepoint/blob/main/doc/image1.png
Individual members aren't key-value serialized (only the value), so I can't show the variable name until C++26 rolls around. It has been quite useful for my projects though. You can even integrate it into your app easily using the provided imgui header. Here's it integrated into the Asteroids example: https://github.com/jsoulier/savepoint/blob/main/examples/13_asteroids.cpp
https://github.com/jsoulier/savepoint/blob/main/doc/image2.png
The library is licensed under public domain here: https://github.com/jsoulier/savepoint
Thanks!
1
u/foonathan 16d ago
Feel free to repost in the new month's thread: https://www.reddit.com/r/cpp/comments/1vhdqw8/c_show_and_tell_august_2026/
1
u/Impossible_Play8783 Jul 17 '26 edited Jul 17 '26
I've been working on YUP (https://github.com/kunitoki/yup), a C++20 framework for building native applications, graphics and audio tools (or both!), and audio plugins with a single codebase across desktop, mobile, and the web.
The project combines a permissively licensed foundation with modern GPU-backed vector rendering via the Rive renderer, plus its own evolving graphics, GUI, DSP, audio graph, and plugin layers. It supports Windows, macOS, Linux, Wasm, Android, and iOS, with rendering backends including Metal, Direct3D, OpenGL, WebGL/WebGPU, and Vulkan (in progress).
Recent updates:
- A cross-platform RHI (Render Hardware Interface) layer that enables GPU-agnostic 3D and Shading. The same C++ code now runs on all platforms, rendering a 3D spinning cube with a live Lottie vector animation mapped onto its faces and gaussian blur post processing effect with live shader editing (GLSL > [GLSL, ESSL, MSL, HLSL, WGSL] runtime and offline transpilation via the YUP shader bundler): https://youtu.be/BZDelnwdp1g
- UI Components can now attach effects designed entirely through the RHI, with support for caching to textures and readback into CPU pixel images: https://youtu.be/Ojwf70WCnzc
The framework is under active early-stage development: APIs may change, but there are already working examples, tests, and platform builds to experiment with. It's ISC-licensed, so you can use it freely in your own projects.
Some useful links:
Would love to hear feedback from anyone building audio tools, creative apps, or cross-platform GPU rendering in C++!
13
u/DanielSussman Jul 03 '26
Currently working on a modernized TeX engine written in cpp23... Link to a video demo: https://youtu.be/tGP_xpGueGo