r/cpp • • Feb 24 '26

So, is C++ doomed?

0 Upvotes

I've been watching closely all the news related to C++ rewrites recently. I must admit the Rust has got a real traction.

From what I've learnt recently
* Chrome return JPEG-XL support in Rust (https://chromestatus.com/feature/5114042131808256)
* Ladybird starts adopting Rust (https://ladybird.org/posts/adopting-rust/)

With the adoption of LLM agentic tools the rewrites will be much easier which was proven by the LadyBird and its LibJs engine.

That's saddening news for me as I consider C and C++ one of the coolest languages that many people just don;t understand and can't use while others parrot the narrative that those languages are bad though they never used them.

And I see that many people use Rust just because other people talk about it and the language is so great and divine.

And Google and MS and other big tech bros try to reduce the C/C++ codebase.

So is C++ doomed?


r/cpp • • Feb 22 '26

C++26 Reflection + PyBind11 for algo trading

Thumbnail github.com
43 Upvotes

r/cpp • • Feb 22 '26

Libraries and tools for a lightweight task manager for GPU in a simulated environment.

5 Upvotes

TLDR: I am trying to create what I could refer to as a lightweight task manager for GPU cloud systems but in a simulated environment.

I need to be able to create and decide scheduling policies for the workloads I will assign to the system. I also need to be able to monitor GPU processes as well as VRAM usage for each of the given workloads, and the software needs to be able to act as admission control so I can prevent Out-of-memory errors by throttling workloads which are intensive.

Essentially, I am trying to make something that simulates NVIDIA MIG and uses NVIDIA SMI or any other process to monitor these in a simulated environment. ( I do not possess a graphics card with NVIDIA MIG capabilities, but it has NVIDIA SMI )

So far the resources I have to put something like this together is

  • CUDA
  • I need a library for simulation of the GPU at code level.
  • Need something like tensor flow but with C++
  • Need a lightweight GUI library that isn't QT.

Considering this is a lightweight application and only meant to demonstrate the elements that go into consideration when making GPU-accelerated systems are there any librarie,s articles or books that would be helpful in making this feasible?

Also considering I am not so experienced in C++ is this a feasible project or is it better to stick with python? I am fully open to learning what is needed but I am on a time constraint of about 3 months give or take.

P.S I have gone through the theoretical aspect and about 30+ articles and papers on the theory issues and problems. I just need practical pointers to libraries, tools and code that would help in the actual building.


r/cpp • • Feb 21 '26

Implementing your own asynchronous runtime for C++ coroutines

42 Upvotes

Hi all! Last time I wrote a blog post about writing your own C++ coroutines. Now, I wanted to highlight how to write your own C++ asynchronous runtime for your coroutines.

https://rhidian-server.com/how-to-create-your-own-asynchronous-runtime-in-c/

Thanks for reading, and let me know if you have any comments!


r/cpp • • Feb 21 '26

C++26: std::is_within_lifetime

Thumbnail sandordargo.com
95 Upvotes

r/cpp • • Feb 20 '26

BitFields API: Type-Safe Bit Packing for Lock-Free Data Structures

Thumbnail rocksdb.org
21 Upvotes

r/cpp • • Feb 20 '26

Parallel C++ for Scientific Applications: Tasks & Concurrency (2nd Part)

Thumbnail youtube.com
8 Upvotes

In this week’s lecture of Parallel C++ for Scientific Applications, Dr. Hartmut Kaiser continues the discussion on task-based parallelism in C++, specifically focusing on the nuances of asynchronous parallelism. The lecture addresses specific scalability issues inherent in fork-join parallelism and presents unique methods to mitigate them effectively.
A core discussion introduces extensions to standard futures implemented in HPX, a C++ Standard Library for Concurrency and Parallelism. Finally, the lecture demonstrates how these advanced tools can extend standard C++ capabilities, offering practical solutions for building more scalable and responsive high-performance applications.
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


r/cpp • • Feb 19 '26

Problems with a weak tryLock operation in C and C++ standards

Thumbnail forums.swift.org
24 Upvotes

r/cpp • • Feb 19 '26

MSVC Build Tools 14.51 Preview released

Thumbnail devblogs.microsoft.com
84 Upvotes

r/cpp • • Feb 19 '26

Learn C++ by Example • Frances Buontempo & Matt Godbolt

Thumbnail youtu.be
28 Upvotes

r/cpp • • Feb 19 '26

Experimental adaptive sort - matches std::sort on random input, 2-8x faster on structured data

34 Upvotes

Hi all,

I’ve been developing an adaptive sorting algorithm, tentatively called JesseSort, which aims to exploit partial order in input data while still being competitive with standard library sorts on random input. I’m looking for feedback on design and potential adoption strategies.

What it does

  • Detects natural runs in the input (ascending, descending, or random) with a tiny lookahead.
  • Maintains two sets of piles for ascending and descending runs, essentially a dual-patience sort.
  • Falls back to tiny 8-value bitonic sort networks on detected random regions.
  • When this random-input block is run too many times, it falls back to std::sort.
  • Currently merges adjacent runs in a naive/bottom-up way.

Current numbers

Median runtime ratios vs std::sort over 100 trials:

Input Type1k Values10k100k1M
Random0.9841.0321.0421.088
Sorted1.0220.6790.5831.448?
Reverse1.6361.0760.9002.101?
Sorted+Noise(5%)1.0481.0411.0791.201
Random+Repeats(50%)1.0371.0321.0311.089
Jitter1.0120.6740.5861.443?
Alternating0.8291.0110.9741.018
Sawtooth1.1210.9600.9781.072
BlockSorted1.0460.9500.9281.153
OrganPipe0.4460.2320.1380.268
Rotated0.5960.5220.3960.716
Signal1.4020.8280.6590.582

Notes:

  • Ratios are JesseSort / std::sort. Values <1 indicate JesseSort is faster. 0.5 means JesseSort takes half the time (2x faster). 2.0 means JesseSort takes twice as much time (2x slower).
  • Large input blow-ups (?) appear to be outliers on my machine, but would be curious to see if others see the same pattern.

Current issues / questions

  1. Handoff threshold: Detecting random input too early loses semi-structured gains; too late slows random input. How should this balance be tuned?
  2. Fallback vs. std::sort: Could JesseSort itself (dual patience games) serve as a better fallback than heap sort in standard introsort implementations?
  3. Merge optimizations: Current merge is bottom-up adjacent. I’ve prototyped a TimSort-style merge that merges smaller runs first. Minor speedups in most cases but I haven't tested it enough.
  4. Memory layout & cache: Some sensitivity to variable placement and data alignment is noticeable. Any advice for robust layout-sensitive optimizations?
  5. Real-world adoption: Even if slightly slower on purely random input (~5%), the structured input gains are often >50%. Would such an algorithm be worth promoting or considered niche? If the hit to random input is too significant, maybe this would find a better home as an alternative like std::structured_sort?

I’m looking for input on:

  • Algorithmic improvements, especially for the random vs structured handoff
  • Practical concerns for integration into standard libraries
  • Benchmark methodology for mixed input distributions
  • Real-world test datasets that might showcase advantages

Code and full details are available here: https://github.com/lewj85/jessesort

Thanks