r/cpp • u/Otherwise-Sir7359 • Apr 13 '26
Amidst the LLM craze, does anyone still care about old machine learning algorithms?
I've built my own framework that allows embedding, quantization, and self-retraining on microcontrollers using C++ from scratch, currently mainly for tree-based model families (like Random Forest, xgboost...). It can compress and train the entire MNIST dataset of 70,000 images on ESP32 with only 3MB of RAM while still achieving an accuracy of up to ~94% across 10 classes (models size about 600 KB of RAM). This is intended to help the model adapt without having to reload the code into the microcontroller.
Everything is here, including source code, demo, and documentation: https://github.com/viettran-edgeAI/MCU
Although it's designed to handle tabular data, I chose to demo it with a simple computer vision application for visualization.
I spent a lot of time on this project, it didn't rely heavily on AI, and I can explain every line of code. I'm open to discussing anything. I hope everyone can provide some feedback or suggestions. In my country, it seems like now they only care about LLMs; every paper tries to cram LLMs in and they don’t care about these older algorithms anymore—they just brush them aside.
std::pmr::generator, a generator without heap allocation
a4z.noexcept.devA short intro/tutorial about how to use std::pmr::generator
r/cpp • u/ProgrammingArchive • Apr 13 '26
New C++ Conference Videos Released This Month - April 2026 (Updated To Include Videos Released 2026-04-06 - 2026-04-12)
CppCon
2026-04-06 - 2026-04-12
- Rust/C++ Interop Challenges - Victor Ciura - https://youtu.be/8xqhSy539Pc
- groov: Asynchronous Handling of Special Function Registers - Michael Caisse - https://youtu.be/TjSL-XCyUJY
- Clean code! Horrible Performance? - Sandor Dargo - https://youtu.be/nLts4S8xSd4
- Beyond the Big Green Button: Demystifying the Embedded Build Process - Morten Winkler Jørgensen - https://youtu.be/UekVdzMCAa0
- C++: Some Assembly Required - Matt Godbolt - https://youtu.be/zoYT7R94S3c
2026-03-30 - 2026-04-05
- How to Build Type Traits in C++ Without Compiler Intrinsics Using Static Reflection - Andrei Zissu - https://youtu.be/EcqiwhxKZ4g
- Beyond Sequential Consistency: Unlocking Hidden Performance Gains - Christopher Fretz - CppCon 2025 - https://youtu.be/6AnHbZbLr2o
- Dynamic Asynchronous Tasking with Dependencies - Tsung-Wei (TW) Huang - CppCon 2025 - https://youtu.be/6Jd9Zyl9SDc
- Work Contracts in Action: Advancing High-performance, Low-latency Concurrency in C++ - Michael Maniscalco - CppCon 2025 - https://youtu.be/5ghAa7B5bF0
- Constexpr STL Containers: Why C++20 Still Falls Short - Sergey Dobychin - CppCon 2025 - https://youtu.be/Py4GJaCHwkA
C++Online
2026-04-06 - 2026-04-12
Mastering C++ Clocks: A Deep Dive into std::chrono - Sandor DARGO - https://youtu.be/ytI6pzT1Opk
2026-03-30 - 2026-04-05
- Is AI Destroying Software Development? - David Sankel - C++Online 2026 - https://youtu.be/Ek32ZH3AI3k
- From Hello World to Real World - A Hands-On C++ Journey from Beginner to Advanced - Workshop Preview - Amir Kirsh - https://youtu.be/2zhW-tL2UXs
- Workshop Preview: C++ Software Design - Klaus Iglberger - https://youtu.be/VVQN-fkwqlA
- Workshop Preview: Essential GDB and Linux System Tools - Mike Shah - https://youtu.be/ocaceZWKm_k
- Workshop Preview: Concurrency Tools in the C++ Standard Library - A Hands-On Workshop - Mateusz Pusz - https://youtube.com/live/Kx9Ir1HBbwY
- Workshop Preview: Mastering std::execution (Senders/Receivers) - A Hands-On Workshop - Mateusz Pusz - https://youtube.com/live/bsyqh_bjyE4
- Workshop Preview: How C++ Actually Works - Hands-On With Compilation, Memory, and Runtime - Assaf Tzur-El - https://youtube.com/live/L0SSRRnbJnU
- Workshop Preview: Jumpstart to C++ in Audio - Learn Audio Programming & Create Your Own Music Plugin/App with the JUCE C++ Framework - Jan Wilczek - https://youtube.com/live/M3wJN0x8cJw
- Workshop Preview: AI++ 101 - Build an AI Coding Assistant in C++ & AI++ 201 - Build a Matching Engine with Claude Code - Jody Hagins - https://youtube.com/live/Vx7UA9wT7Qc
- Workshop Preview: Stop Thinking Like a Junior - The Soft Skills That Make You Senior - Sandor DARGO - https://youtube.com/live/nvlU5ETuVSY
- Workshop Preview: Splice & Dice - A Field Guide to C++26 Static Reflection - Koen Samyn - https://youtube.com/live/9bSsekhoYho
ADC
2026-04-06 - 2026-04-12
- Hacking Handhelds for Creative Audio - Building Music Applications for the New Nintendo 3DS - Leonardo Foletto - https://youtu.be/x-9lDvfAKd0
- Helicopter View of Audio ML - Martin Swanholm - https://youtu.be/TxQ4htrS2Po
- PhilTorch: Accelerating Automatic Differentiation of Digital Filters In PyTorch - How to evaluate differentiable filters 1000 times faster in PyTorch. - Chin-Yun Yu - https://youtu.be/Br5QhU_08Po
2026-03-30 - 2026-04-05
- Creating from Legacy Code - A Case Study of Porting Legacy Code from Exponential Audio - Harriet Drury - https://youtu.be/rjafXQwCz4w
- Designing an Audio Live Coding Environment - Corné Driesprong - https://youtu.be/Jw8x2uMgFnc
- How To Successfully Develop Software Products - Olivier Petit & Alistair Barker - https://youtu.be/vymlQFopbp0
Meeting C++
2026-04-06 - 2026-04-12
- The Misra C++:2023 Guidelines - Richard Kaiser - https://www.youtube.com/watch?v=TRz-WXgADuI
- Applied modern C++: efficient expression evaluator with type erasure - Olivia Quinet - https://www.youtube.com/watch?v=66WtE_7wE1c
2026-03-30 - 2026-04-05
- Building C++: It Doesn't Have to be Painful! - Nicole Mazzuca - Meeting C++ 2025 - https://www.youtube.com/watch?v=ExSlx0vBMXo
- int != safe && int != ℤ - Peter Sommerlad - Meeting C++ 2025 - https://www.youtube.com/watch?v=YyNE6Y2mv1o&pp=0gcJCdkKAYcqIYzv
using std::cpp
2026-03-30 - 2026-04-05
- Learning C++ as a newcomer - Berill Farkas - https://www.youtube.com/watch?v=nsMl54Dvm24
- C++29 Library Preview : A Practitioners Guide - Jeff Garland - https://www.youtube.com/watch?v=NqpLxkatkt4
- High frequency trading optimizations at Pinely - Mikhail Matrosov - https://www.youtube.com/watch?v=qDhVrxqb40c
- Don’t be negative! - Fran Buontempo - https://www.youtube.com/watch?v=jqLEFPDXZ-o
- Cross-Platform C++ AI Development with Conan, CMake, and CUDA - Luis Caro - https://www.youtube.com/watch?v=jnKeUE2C8_I
- Building a C++23 tool-chain for embedded systems - José Gómez López - https://www.youtube.com/watch?v=AlNnd0QARS8
- Space Invaders: The Spaceship Operator is upon us - Lieven de Cock - https://www.youtube.com/watch?v=9niOq1kr61Y
- Same C++, but quicker to the finish line - Daniela Engert - https://www.youtube.com/watch?v=9ijIocn_xzo
- Having Fun With C++ Coroutines - Michael Hava - https://www.youtube.com/watch?v=F9ffx7HvyrM
- The road to 'import boost': a library developer's journey into C++20 modules - Rubén Pérez Hidalgo - https://www.youtube.com/watch?v=hD9JHkt7e2Y
- C++20 and beyond: improving embedded systems performance - Alfredo Muela - https://www.youtube.com/watch?v=SxrC-9g6G_o
- Supercharge Your C++ Project: 10 Tips to Elevate from Repo to Professional Product - Mateusz Pusz - https://www.youtube.com/watch?v=DWXlyOd_z88
- Compiler as a Service: C++ Goes Live - Aaron Jomy, Vipul Cariappa - https://www.youtube.com/watch?v=jMO5Usa26cg
- The CUDA C++ Developer's Toolbox - Bernhard Manfred Gruber - https://www.youtube.com/watch?v=MNwGvqX4KH0
- C++ Committee Q&A at using std::cpp 2026 - https://www.youtube.com/watch?v=iD5Bj7UyAQI
- The Mathematical Mind of a C++ Programmer - Joaquín M López - https://www.youtube.com/watch?v=9g4K-oNw1SE
- C++ Profiles: What, Why, and How - Gabriel Dos Reis - https://www.youtube.com/watch?v=Z6Nkb1sCogI
- Nanoseconds, Nine Nines and Structured Concurrency - Juan Alday - https://www.youtube.com/watch?v=zyhWzoE3Y2c
- Fantastic continuations and how to find them - Gonzalo Juarez - https://www.youtube.com/watch?v=_0xRMXA83z0
- You 'throw'; I'll 'try' to 'catch' it - Javier López Gómez - https://www.youtube.com/watch?v=VwloPRtTGkU
- Squaring the Circle: value-oriented design in an object-oriented system -Juanpe Bolívar - https://www.youtube.com/watch?v=DWthcNoRVew
- Concept-based Generic Programming - Bjarne Stroustrup - https://www.youtube.com/watch?v=V0_Q0H-PQYs
r/cpp • u/Mondash18 • Apr 14 '26
The programming iceberg...
I always look for new resources to learn programming. However, every programming language created there will be a huge documentation that is born with it.
And they are very deep shit.
When you get an error from a compiler, there are these many cryptic messages pooping your entire screen and sometimes it just makes me wonder what they are..
Does anyone even read these for fun?
r/cpp • u/tartaruga232 • Apr 13 '26
Let's bite the Bullet: Module Units shouldn't implicitly import anything
github.comThe correct fix ... is to attack the root cause and stop implicitly importing the interface of module implementation units.
Adding yet another kind of partition is the wrong way to solve it.
r/cpp • u/Live-Manner2725 • Apr 12 '26
[ Removed by moderator ]
Hi all,
How do you people decide which opensource 3rd party library to include in a production environment, e.g for logging I can use either spdlog, Quill, Log4cplus, etc
Not every system is a HFT, in a general production system, how would you usually decide a library, practically speaking, I can get the logs through all of them but which one you would choose, I just took example of logger libs, it can be anything, I would like to understand how you all come to conclusion! do you usually study the whole library before using it?
r/cpp • u/_Noreturn • Apr 11 '26
I implemented UFCS in clang. Why it is cool, and why it will never come to C++.
github.comI spent the last week hacking a Clang fork to implement a restricted more conservative version of Uniform Function Call Syntax (UFCS) based on Herb Sutter’s P3021.
Curious about your thoughts.
r/cpp • u/Express-Act3158 • Apr 11 '26
Building a Deep learning framework in C++ (from scratch) - training MNIST as a milestone
i am building a deep learning framework called "Forge" completely from scratch in C++, its nowhere near complete yet, training MNIST Classifier shows a functional core on CPU (i'll add a CUDA backend too). My end goal is to train a modern transformer on Forge.
YT video of MNIST training :- www.youtube.com/watch?v=CalrXYYmpfc
this video shows:
-> training an MLP on MNIST
-> loss decreasing over epochs
-> predictions vs ground truth
this stable training proves that the following components are working correctly:-
--> Tensor system (it uses Eigen as math backend, but i'll handcraft the math backend/kernels for CUDA later) and CPU memory allocator.
--> autodiff engine (computation graph is being built and traversed correctly)
-->primitives -- linear layer, relu activation (Forge has sigmoid, softmax, gelu, tanh and leakyrelu too), CrossEntropy loss function (it fuses log softmax and CE. Forge has MSE and BinaryCrossEntropy too, the BCE fuses sigmoid and BCE) and SGD optimizer (i am planning to add momentum in SGD, Adam and AdamW)
[the Forge repo on GitHub is currently private as its WAP]
My GitHub: github.com/muchlakshay
r/cpp • u/SteveGerbino • Apr 10 '26
We benchmarked sender-based I/O against coroutine-based I/O. Here's what we found.
When I/O operations return senders, they incur an unnecessary per-operation allocation. This explains why.
| Stream Type | capy::task | bex::task | sender pipeline |
|---|---|---|---|
| Native | 0 | 0 | 0 |
| Abstract | 0 | 1 | 1 |
| Type-erased | 0 | 1 | 1 |
When an I/O stream is type-erased, sender/receiver's connect() produces an operation state whose type depends on both the sender and the receiver. The size is unknown at construction time. It must be heap-allocated per operation. Under awaitables, await_suspend takes a coroutine_handle<> — the consumer type is already erased — so the awaitable can be preallocated once and reused. The allocation cannot be eliminated. It follows from connect producing a type that depends on both the sender and the receiver.
We measured this. The benchmark executes 20,000,000 read_some calls per configuration on a single thread using a stream that isolates the execution model overhead from I/O latency. Five independent runs plus warmup; values are mean ± standard deviation. The benchmark source is public:
https://github.com/cppalliance/capy/tree/develop/bench/beman
Anyone is invited to inspect the code, suggest improvements, and help make it better. The architects of P2300 are especially welcome — their expertise would strengthen the comparison.
Two papers address the cost asymmetry. P4003R0 "Coroutines for I/O" defines the IoAwaitable protocol for standard I/O operations. P4126R0 "A Universal Continuation Model" is purely additive — it gives sender/receiver pipelines zero-allocation access to every awaitable ever written. Together they make coroutines and senders both first-class citizens of the I/O stack.
Benchmark Results
All values are mean ± stddev over 5 runs (warmup pass discarded). Each table measures one execution model consuming two I/O return types (awaitable and sender). The native column is the model's own I/O type; the other column goes through a bridge.
Table 1: sender/receiver pipeline
| Stream Type | sender (native) | awaitable (bridge) |
|---|---|---|
| Native | 34.3 ± 0.1 ns/op, 0 al/op | 46.3 ± 0.0 ns/op, 1 al/op |
| Abstract | 47.1 ± 0.2 ns/op, 1 al/op | 46.4 ± 0.0 ns/op, 1 al/op |
| Type-erased | 57.5 ± 0.0 ns/op, 1 al/op | 54.1 ± 0.1 ns/op, 1 al/op |
| Synchronous | 2.6 ± 0.3 ns/op, 0 al/op | 5.1 ± 0.1 ns/op, 0 al/op |
Table 2: capy::task
| Stream Type | awaitable (native) | sender (bridge) |
|---|---|---|
| Native | 31.4 ± 0.2 ns/op, 0 al/op | 48.1 ± 0.3 ns/op, 0 al/op |
| Abstract | 32.3 ± 0.2 ns/op, 0 al/op | 72.2 ± 0.2 ns/op, 1 al/op |
| Type-erased | 36.4 ± 0.1 ns/op, 0 al/op | 72.1 ± 0.0 ns/op, 1 al/op |
| Synchronous | 1.0 ± 0.2 ns/op, 0 al/op | 19.0 ± 0.0 ns/op, 0 al/op |
Table 3: beman::execution::task
Note: bex::task's await_transform calls the sender's as_awaitable member directly when available, bypassing connect and start. Table 3's native sender column measures the as_awaitable path, not the full sender protocol.
| Stream Type | sender (native) | awaitable (bridge) |
|---|---|---|
| Native | 31.9 ± 0.0 ns/op, 0 al/op | 43.5 ± 0.1 ns/op, 1 al/op |
| Abstract | 55.2 ± 0.0 ns/op, 1 al/op | 43.4 ± 0.0 ns/op, 1 al/op |
| Type-erased | 55.2 ± 0.0 ns/op, 1 al/op | 48.7 ± 0.1 ns/op, 1 al/op |
| Synchronous | 1.0 ± 0.2 ns/op, 0 al/op | 2.9 ± 0.2 ns/op, 0 al/op |
The full formatted report with detailed analysis is here: https://gist.github.com/sgerbino/2a64990fb221f6706197325c03e29a5e
Analysis
Native performance is equivalent. Both models achieve ~31–34 ns/op with zero allocations when consuming their native I/O type on a concrete stream. There is no inherent speed advantage to either model at the baseline.
Type erasure costs diverge. capy::any_read_stream adds ~5 ns/op and zero allocations. The awaitable is preallocated at stream construction and reused across every read_some call. This is possible because await_suspend takes a type-erased coroutine_handle<> — the consumer type is already erased, so the awaitable's size is known at construction time. The sender equivalents add ~21–23 ns/op and one allocation per operation. The sender's connect(receiver) produces an op_state whose type depends on both the sender and the receiver. Since either may be erased, the operation state must be heap-allocated.
Bridges are competitive. Both bridges add 11–17 ns for native streams with zero bridge allocations. The allocations visible in the bridged columns come from the target model's own machinery (type-erased connect, executor adapter posting), not from the bridges themselves.
std::execution provides compile-time sender composition, structured concurrency guarantees, and a customization point model that enables heterogeneous dispatch. These are real achievements for real domains — GPU dispatch, work-graph pipelines, heterogeneous execution. Coroutines serve a different domain. They cannot express compile-time work graphs or target heterogeneous dispatch. What they do is serial byte-oriented I/O — reads, writes, timers, DNS lookups, TLS handshakes — the work that networked applications spend most of their time on.
Trade-off Summary
| Feature | IoAwaitable | sender/receiver |
|---|---|---|
| Native concrete performance | ~31 ns/op, 0 al/op | ~32–34 ns/op, 0 al/op |
| Type erasure cost | +5 ns/op, 0 al/op | +21–23 ns/op, 1 al/op |
| Type erasure mechanism | preallocated awaitable | heap-allocated op_state |
| Why erasure allocates | it does not | op_state depends on sender AND receiver types |
| Synchronous completion | ~1 ns/op via symmetric transfer | ~2.6 ns/op via trampoline |
| Looping | native for loop | requires repeat_until + trampoline |
| Bridge to other model (native) | ~17 ns/op, 0 al/op | ~12 ns/op, 1 al/op |
| Bridge to other model (erased) | ~36 ns/op, 1 al/op | ~12 ns/op, 1 al/op |
r/cpp • u/emilios_tassios • Apr 10 '26
HPX Tutorials: Performance analysis with VTune
youtube.comHPX is a general-purpose parallel C++ runtime system for applications of any scale. It implements all of the related facilities as defined by the C++23 Standard. As of this writing, HPX provides the only widely available open-source implementation of the new C++17, C++20, and C++23 parallel algorithms, including a full set of parallel range-based algorithms. Additionally, HPX implements functionalities proposed as part of the ongoing C++ standardization process, such as large parts of the features related parallelism and concurrency as specified by the C++23 Standard, the C++ Concurrency TS, Parallelism TS V2, data-parallel algorithms, executors, and many more. It also extends the existing C++ Standard APIs to the distributed case (e.g., compute clusters) and for heterogeneous systems (e.g., GPUs).
HPX seamlessly enables a new Asynchronous C++ Standard Programming Model that tends to improve the parallel efficiency of our applications and helps reducing complexities usually associated with parallelism and concurrency.
In this video, we explore how to perform rigorous performance analysis on HPX applications using Intel VTune Profiler, detailing how this tool can be used to identify true bottlenecks down to the source line where standard software profilers often fall short. We focus on the configuration of CMake for VTune compatibility and the execution of the Hotspots collector, demonstrating the interpretation of profiling data through a practical analysis of a parallel sorting algorithm. The tutorial details the process of diagnosing common concurrency issues, utilizing VTune's GUI to uncover over-decomposition, microscopic task granularity, and idle threads, ensuring that applications are executing efficiently rather than thrashing the system. This provides a clear introduction to evaluating HPX's lightweight tasking system, culminating in actionable insights, where we illustrate how to seamlessly resolve performance flaws while harnessing the full potential of modern parallel hardware.
If you want to keep up with more news from the Stellar group and watch the lectures of Parallel C++ for Scientific Applications and these tutorials a week earlier please follow our page on LinkedIn https://www.linkedin.com/company/ste-ar-group/ .
Also, you can find our GitHub page below:
https://github.com/STEllAR-GROUP/hpx
https://github.com/STEllAR-GROUP/HPX_Tutorials_Code
r/cpp • u/_bijan_ • Apr 10 '26
Interesting point of view from Daniel Lemire
If you’re not already familiar with Daniel Lemire, he is a well-known performance-focused researcher and the author of widely used libraries such as simdjson.
He recently published a concise overview of the evolution of the C and C++ programming languages:
https://lemire.me/blog/2026/04/09/a-brief-history-of-c-c-programming-languages/
It’s a worthwhile read for anyone interested in the historical context and development of systems programming languages.
r/cpp • u/According_Leopard_80 • Apr 09 '26
Writing only decoupled code
middleraster.github.ior/cpp • u/claimred • Apr 09 '26
0xd34df00d/you-dont-know-cpp: and neither do I
github.comSome non trivial cpp quiz style questions
r/cpp • u/LegalizeAdulthood • Apr 09 '26
Managing Versions Programmatically with LibGit2
youtube.comUtah C++ Programmers has released a new video Managing Versions Programmatically with LibGit2 with sample code.
Lots of applications have configuration files and even user data files where it would be useful to track changes to those files with a version control system that was integrated into the application.
The git version control system is available for integration into applications as a library.
This month, Richard Thomson will guide us through a simple application that integrates git to track changes to an edited text file.
r/cpp • u/claimred • Apr 09 '26
beast2 networking & std::execution
I was looking for a new networking layer foundation for a few of my projects, stumbled on beast2 library which looks brand new, based on C++20 coroutines. I used boost.beast in the past which was great. Here's the link https://github.com/cppalliance/beast2. I also considered std::execution since it seems to be the way to go forward, accepted in C++26.
Now, what got me wondering is this paragraph
The C++26 std::execution API offers a different model, designed to support heterogenous computing. Our research indicates it optimizes for the wrong constraints: TCP servers don't run on GPUs. Networking demands zero-allocation steady-state, type erasure without indirection, and ABI stability across (e.g.) SSL implementations. C++26 delivers things that networking doesn't need, and none of the things that networking does need.
Now I'm lost a bit, does that mean std::execution is not the way to go for networking? Does anyone have any insights on cppalliance research on the matter?
r/cpp • u/TheRavagerSw • Apr 09 '26
Why committee doesn't decide on a package format?
Why pkgconf or cmake package or CPS isn't officially endorsed by the committee?
Can't cmake or meson guys, who go to meetings and conferences pressure the higher ups to get something accepted?
Multiple build systems are ok, multiple package formats are not. Why no one solves this issue?
r/cpp • u/JanWilczek • Apr 09 '26
Jumpstart to C++ in Audio C++ Online 2026 Workshop
cpponline.ukOfficial JUCE C++ framework course and DSP Pro course creator here 👋 On April 14 and 28, I am running an audio-focused workshop as part of the C++ Online 2026 conference.
In the workshop, you will learn:
- how sound is represented on a computer
- how to interact with sound (record, play back, modify) from C++
- how to use the PortAudio library for playback
- how to research, design & implement audio effects
- how to implement audio effects in C++
- how to wrap audio effects in audio plugins using the JUCE C++ framework
- how to create a GUI for the audio plugin in JUCE
You can sign up here: https://cpponline.uk/workshop/jumpstart-to-cpp-in-audio/
If you're unsure if it's for you, I've given an introductory talk on the workshop material during the conference, which you can check out for free: https://youtu.be/IBLRv55qChw?si=hYDzZGdpTi4gz5dP
I'd also be happy to answer your questions regarding the workshop in this post 🙂
r/cpp • u/pavel_v • Apr 08 '26
std::core_dump - The Newsletter of Boost and the C++ Alliance - April 2026
dl.cpp.alr/cpp • u/Krystian-Piekos • Apr 08 '26
Hashing in C++26
blog.infotraining.plHow to implement hash for custom classes in C++26.