top | item 40225657

(no title)

muricula | 1 year ago

Is it just me or does it seem like modules are a good idea which is totally dead on arrival? It's been four years, and we've had a whole new edition of c++ standard in the meantime, and Clang and GCC still don't have full support for modules.

discuss

order

Maxatar|1 year ago

The issue is that everyone has their own hopes and dreams for what modules in C++ should and could be, and what ended up being standardized is an unbelievably complicated and overengineered mess. A small number of people worked on standardizing modules, and the proposal is so complicated and obscure I really doubt if most of the people who voted to approve it actually understood what it is they were even voting on.

In the future, things should not get standardized without an actual working implementation of the feature that people can actually use. Even better would be to have multiple similar non-standard features that each compiler can implement, and then the standardization can serve as way for them to converge.

ghosty141|1 year ago

The problem with most new features in the standard is that they are so complicated and tough to implement that it takes ages leading to the current situation where there are features already planned for c++26 while compilers barely support c++20.

It's even worse that for embedded stuff it takes even longer for these modern compilers to be included in the toolchains etc. For example at work we are looking forward to being able to use GCC 13 later this year so we can use some features that were lacking in the GCC 11.3 we are using currently.

I don't think we can expect modules to be widely adopted before like 2026-38.

shrimp_emoji|1 year ago

Yeah. Does gp not use C++? No new feature gets support in like less than 4 years. :p And I don't think that's a bad thing unless it's replacing a premature abomination feature released too soon, like `auto_ptr`. That's getting removed entirely soon; imagine if it were harder to do that because it got adopted faster and so much code relied on it that WG21 decided to keep it in "deprecated" limbo forever.

Also, we're on GCC 8! TnT '17 is the highest it can go.