News for hackers. Stuff that matters.
Re:Trying out C++20's modules with Clang and Make by IshKebab on Sunday October 15, 2023 @01:21PM (#37891588)
Existing C++ file extensions aren't standardised. There's no reason they couldn't mandate file extensions for this.

And really even among the non-standard extensions it's like 95% .cpp, 4.9% .cc and 0.1% .c++. Ignoring the weirdos it's de facto .cpp or .cc. They could standardise that too if they really wanted and there was a benefit.

This sounds like one of those things that often happens where people worry about technically possible but totally insignificant risks, and insist on handling them because they feel proud of having thought of them.

Not enough YAGNI.

Re:Trying out C++20's modules with Clang and Make by dagmx on Sunday October 15, 2023 @01:30PM (#37891650)
You’re missing cxx and mm, which are more common in codebases I deal with than most of your examples. Which is to say you can’t make sweeping statements.

Anyway, I’d try and contextualize your argument more by adding that feature teams are restricted in the scope of the changes they can do to the features they’re working on. They can certainly suggest that the language specify specific extensions but that goes against decades of convention, and is a hill that would likely have taken more of their time and energy for little specific gain for the feature itself.

I’m not arguing that there shouldn’t be standard extensions, just that I can understand why it didn’t happen. It’s like swimming upstream

Re:Trying out C++20's modules with Clang and Make by IshKebab on Monday October 16, 2023 @07:27AM (#37898249)
Ah yes `.cxx` is rare but used. I haven't seem `.mm` for decades. IIRC gtkmm uses that? No maybe not, they use `.cc`. What on earth uses `.mm` now?

Anyway none of that really changes the point - they could easily standardise extensions. The only reason they haven't is because there has been no real benefit until now.

Re:Trying out C++20's modules with Clang and Make by dagmx on Monday October 16, 2023 @10:51AM (#37900633)
cxx is what msvc prefers hence why they picked icxx for their module types.

mm is convention for ObjC++ files, which is a required dialect if you need to use most the platform libs on Apple platforms.

Being the standard extensions for the two most major platforms, I wouldn’t call them rare at all.

And which further reinforces my point. They could have mandated an extension BUT it would have been going against convention which makes it decidedly not easy. There’s not one singular team in charge and there’s lots of friction in such a seemingly minor change.

I’d argue too that even with modules there’s very minimal benefit to a standard extension. Any such benefit would have had even greater benefit for the rest of the language.

Re:Trying out C++20's modules with Clang and Make by groos on Sunday October 15, 2023 @01:29PM (#37891646)
You forgot .cxx
Re:Trying out C++20's modules with Clang and Make by Conscat on Sunday October 15, 2023 @02:46PM (#37892250)
What .ii for preprocessed files? And .ipp and .tpp for template implementation files?
Re:Trying out C++20's modules with Clang and Make by mathstuf on Sunday October 15, 2023 @04:54PM (#37893307)
The implementations have no agreement here. Clang "likes" `.cppm` while MSVC "likes" `.ixx`. I don't think there's any hope for agreement on extensions.