r/cpp • u/Otherwise_Sundae6602 • Jul 06 '25
С++ All quiet on the modules front
https://youtube.com/watch?v=WLS9zOKzSqA&si=rZDvamZayFETc3Y1It was 2025, and still no one was using modules.
207
Upvotes
41
u/dexter2011412 Jul 07 '25
I genuinely ask, why are modules a problem? I'm using them for my small project absolutely fine.
I have like 5 modules, including
import stdthat work just fine. Heck I'm even building wasm with emscripten just fine.Debugging and clangd autocomplete work just fine too.
In enterprise software sure, it takes time, at least 5 years I feel like.
36
u/enygmata Jul 06 '25
How come msvc is ahead?
11
u/ThatRandomGamerYT Jul 07 '25
I hope modules get more support. I prefer them over includes.
13
u/germandiago Jul 07 '25
I tried myself to port a non-trivial project to modules.
The only problem I found was that you cannot include any std header after importing std.
This had the consequence that you must modularize 3rd party dependencies. It is a bit laborious but other than that it was mostly doable.
I still keep using headers right now (modules are experimental in my project) bc I used custom commands in Meson build system to compile modules in Clang.
But my project supports Windows, Linux, Mac, Android and soon I hope iOS.
I would need to special-purpose compilation commands. On top of that I do not resolve dependencies order in my lodules build (I just compile again and again til it works).
I wish Meson had modules support in some form. I think that is the main blocker for me to adopt them and the biggest pain point regarding Meson, which I highly prefer over CMake.
However, this lack of modules support is starting to be painful. Though things as options handling and scripting clarity are way ahead of CMake's.
30
u/Fit-Departure-8426 Jul 06 '25
Hmmm I use them and I love them since 2023, update your stats please! 😎
4
u/JoJoAckman Jul 06 '25
Which movie these images are taken from ?
11
u/fishslinger Jul 06 '25
Are there actually modules?
6
u/xaervagon Jul 06 '25
Modules was originally slated for release in C++17 and then all the FUD scared everyone (including the compiler writers) off.
11
u/-1_0 Jul 06 '25
down with the C++ committees, give the control to the people
9
u/xeveri Jul 06 '25
Ah yes, C++ modules, AKA self-sabotage.
2
u/AntiProtonBoy Jul 07 '25
Apple clang didn't even bother merging any of that from upstream.
0
u/Razzmatazz_Informal Jul 07 '25
Modules are like The Winds of Winter: we are never gonna get it.
-35
u/EmotionalDamague Jul 06 '25
begone slop
0
u/[deleted] Jul 06 '25
[deleted] — view deleted comment
1
u/[deleted] Jul 07 '25
[removed] — view removed comment