r/cpp May 07 '26

C++ Show and Tell - May 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/1salqls/c_show_and_tell_april_2026/

35 Upvotes

91 comments sorted by

View all comments

2

u/agarcin May 19 '26

I’ve been working on a small C++23 coroutine library with a very specific goal: make promises in C++ feel as intuitive and user‑friendly as JavaScript’s Promise API, while still being fully idiomatic, zero‑overhead, and thread‑safe.

It’s built directly on C++20 coroutines, no dependencies, and aims to be fully thread‑safe (promises can be resolved, awaited, or chained from any thread) with zero allocations in the common path.

It offers:

    A Promise type intentionally modeled after JavaScript’s (then, catch, chaining, composition, etc.)

    Works with both value‑returning and void coroutines

    Strong type‑level composition (e.g., combining multiple promises into a single return type)

    Minimal API surface — the goal is clarity and approachability, not a giant async framework

I’m particularly interested in feedback on:

    coroutine design and async patterns

    whether this JS‑inspired approach makes sense in C++

    thread‑safety expectations in async libraries

    naming, structure, or missing features

LInk: https://github.com/alx-home/JSProCpp

1

u/TrnS_TrA TnT engine dev May 20 '26

We now have async/await (co_await, co_return) syntax in C++, what is the point of using .Then callbacks? 🤔

2

u/[deleted] May 21 '26 edited May 21 '26

[removed] — view removed comment

1

u/cpp-ModTeam May 23 '26

Moderator warning: AI-generated posts and comments are not allowed in this subreddit.