r/cpp • • Sep 13 '26

C++20 modules support: 228 projects already available to be consumed

Hello everyone.

I checked arewemodulesyet.org, which I do from time to time.

I was very positively surprised bc a couple of months ago there were 109 projects with modules support.

Now it is 228 and some of the most popular are there: fmt, ftxui, nlohmann.json and others.

So I had to share it with the community.

119 Upvotes

39 comments sorted by

49

u/jube_dev Sep 13 '26

For the full information, here is what the site says: "228 of 2,613 projects complete • Estimated completion: 23 January 2085".

29

u/germandiago Sep 13 '26 edited Sep 13 '26

Noone ever ported 100% of projects to another system (for example Python 2 to Python 3 orJava modules, or all libraries in the world from .NET Framework to .NET Core). Some die, some get rotten, but what it is important is if there is enough critical mass.

By the way... you did not see thatgraph back then when it said something like 2250 or more 🤣🤣🤣

12

u/mapronV Sep 13 '26

Oh, wow, 21st century already. I remember when it was 23rd!

27

u/Horrih Sep 13 '26

Just to keep me updated : how good is the support for import std; on the big 3 compilers?

And support for tooling like cmake, clangd/clang-tidy, cppcheck, doxygen, vs intellisense?

I tried migrating a smallish project a couple of years back but things were not usable enough for our corporation 's workflow

7

u/GabrielDosReis Sep 13 '26

Just to keep me updated : how good is the support for import std; on the big 3 compilers?

I used the assistance of an LLM to migrate the IPR - a project started in C++03, that gradually adopted contemporary C++ - in three stages. Only the last stage exposed serious bugs in GCC; Clang and MSVC were happy.

Yes, focused LLMs can and do help with migration; you do have to know where you're going and what you're doing.

3

u/azswcowboy Sep 13 '26

> bugs in gcc

It looks like you were using gcc-15 I wonder if any of those were fixed in 16?

3

u/GabrielDosReis Sep 14 '26

It looks like you were using gcc-15 I wonder if any of those were fixed in 16?

Unfortunately, they were still present in GCC-16 when I tried about a month ago.

1

u/germandiago Sep 14 '26

What bugs?

I would like to know what I can expect if I try a migration. Code completion? Or build problems directly?

Templates? Coroutines?

2

u/GabrielDosReis Sep 14 '26

What bugs?

Replying from a phone, so excuse the short answer. If you click on the (sole) failing badge (GCC) that should take you to the failing code. Also, I search for phrase like "GCC" workaround in the implementation file.

Code completion? Or build problems directly?

Just plain build, not code completion.

Templates?

Not really.

Coroutines?

No, there is no coroutines in the IPR yet.

7

u/_Ilobilo_ Sep 13 '26

clangd has some issues with gcc and modules but it works fine with clang. it sometimes crashes with large projects but restarting is quick and easy in a proper editor. I've used import std with both gcc and clang it works well.

5

u/pjmlp Sep 14 '26

I can only speak for VC++, it mostly works, however there are possible issues when other libraries include regular headers from standard library, and Intelisense is still not there as VS depends on EDG.

This wasn't fixed since the introduction of experimental modules in VS 2017, and now with EDG retiring themselves from the compiler business, no idea if it will ever get fixed.

On VSCode side we were supposed to get an update on Intelisense roadmap end of January, and since then the ticket is mostly filled by people asking for when the update is actually going to be given.

9

u/AfroDisco Sep 13 '26

The website also take into account project with less than 10 stars so I can't say this is really useful as a number.

It might be better by keeping only the top used and still maintained repo but I'm not sure if this is done somewhere.

Still it's nice to have a big picture view of the migration.

8

u/positivcheg Sep 13 '26

I’m curious. What’s the use of fmt if STD has formatting?

39

u/marzer8789 toml++ Sep 13 '26

fmt can move much faster than the standard and has much better codegen IME

13

u/smdowney WG21, Text/Unicode SG, optional<T&> Sep 13 '26

Fmt has some capabilities that std doesn't and won't have.

Porting is just enough work, and risk, that it should be put off until you can pay attention, and not as a drive-by when you are doing something else.

Not much risk. About like any major version upgrade of a package.

But you are likely to get bit by something. If nothing else the operator<<() conversion that isn't in std and you have to write yourself is likely.

2

u/ReDr4gon5 Sep 13 '26

The main one that really surprised me is that format only supports char and wchar. So fmt is already way better in that regard.

1

u/smdowney WG21, Text/Unicode SG, optional<T&> Sep 15 '26

Which others does fmt support? The char{8,16,32}_t output is a nightmare of edge, corner, and really pointy end of the stick cases. That unfortunately look like they work just fine for a sensible already UTF system.

1

u/ReDr4gon5 Sep 15 '26

I think everything except char8_t where they say to just use char? I might be wrong though.

10

u/sweetno Sep 13 '26

It works with C++11.

9

u/_Noreturn Sep 13 '26 edited Sep 13 '26

it compiles much faster than the std version and has better error messages and runtime performance. also it had more features, and works in lower versions. if anything the std version sucks and should not be used

2

u/frankist Sep 13 '26

Why couldn't the compiler providers just copy/paste the fmt implementation?

2

u/TSP-FriendlyFire Sep 13 '26

fmt doesn't have to hold to the standard, its internal implementation and public API are allowed to change as needed. The standard, by contrast, needs to follow a pretty strict definition and all implementations also care about ABI stability which further reduces flexibility.

2

u/frankist Sep 13 '26

yes, but they could have just copied the existing pre-C++20 fmt implementation and not change it, maintaining ABI stability that way. After all, the std format was based on fmt.

4

u/TSP-FriendlyFire Sep 13 '26

It mostly was based on it, but the STL has very different requirements than a standalone library. Thing is, std::format was standardized in C++20, the last revision of the introductory paper was in mid 2019, and the majority of the API was set in stone before then.

That's over 7 years ago. fmt has changed quite a bit since then.

2

u/smdowney WG21, Text/Unicode SG, optional<T&> Sep 15 '26

We also, with great controversy and complaint, made breaking changes immediately after 20 shipped. It was constexpr checking of the format spec, but it still delayed ABI freeze for some standard libraries.

5

u/[deleted] Sep 13 '26

I think it was there before the standard one

2

u/TheTimBrick Sep 15 '26

Currently working on my own project using modules! Probably won't be popular enough to make that list, but I'm still proud of it regardless.

Modules on top!

7

u/TheRavagerSw Sep 13 '26

Don't waste your time on third party library support, their build script quality is terrible and module support is secondary to header only.

Fork the libs you want to use and port them to modules.

3

u/SLAidk123 Sep 13 '26

Are clangd and clang-tidy still the bottleneck? It's a great feature, but a few months ago I was writing modules in CLion and it felt like using notepad++

0

u/TheTimBrick Sep 15 '26 edited Sep 15 '26

I've been writing with modules and import std using clangd for an entire project. In my experience clangd module support seems to require clang++ though from my experimentation since g++ has a different format for compiled modules than clang++ and clangd can't understand (g++ compiles to .gcm whereas clangd looks for .pcm and other compiler specific arguments). Might be different now though.

E: improved clarification.

-7

u/arihoenig Sep 13 '26

Claude

3

u/germandiago Sep 13 '26

What do you mean?

7

u/arihoenig Sep 13 '26

Why there was a sudden rapid increase in the number of libraries using modules.

2

u/germandiago Sep 14 '26 edited Sep 15 '26

Probably it was not properly updated yet. Or summer break. Idk but issues are supposed to go to projects so I assume the support is official from every oroject, whether they helped with AI the implementations or not.

5

u/wyrn Sep 13 '26

You're getting downvoted but you're probably right

-6

u/arihoenig Sep 13 '26

Getting downvoted is how you know you're right ;-)

4

u/delta_p_delta_x Sep 13 '26

This is a good thing. LLMs have worked pretty fantastically for me to port things to modules.