After years, I started a #cpp20modules upgrade experiment.

Result: It's possible to cover legacy static #cpp libraries with modern export module interfaces.
And with support from #cmake, creating additional module libraries is simple.

I like to see both worlds side by side, classic headers in legacy projects and modules in new code, both using same sources.

Unfortunately we all have waited too long, only few libs have module support, and #gcc still has issues.

But it's time to upgrade! 👍

"Keynote: Teaching an Old Dog New Tricks - Matt Godbolt - ACCU 2025"

https://www.youtube.com/watch?v=jlt_fScVl50

nice talk!

#cpp #cpp20modules #zxspectrum

Keynote: Teaching an Old Dog New Tricks - Matt Godbolt - ACCU 2025

YouTube

Funny. I removed all modules from my C++ codebase (roughly 10% of it) and I got about 10-16% shorter compilation times. Not to mention Intellisense no longer crashing all over the place.

I wonder if it ever be a worthwhile feature to use.

#cpp20modules #cpp #cpp20 #cpp23

Using C++20 modules in any kind of contemporary project that is not modules-first from the beginning is just a huge mistake 😥

#cpp20modules #cpp

and I now have made my first compiler bug report on the microsoft community site. If any C++ devs with more module experience than me want to weigh in it would be appreciated. I don't even know if this is supported, but it feels pretty bad if it isn't.

https://developercommunity.visualstudio.com/t/Module-containing-template-with-explicit/10617704

#cpp #cpp20modules

🎉 yay! finally upgraded all development machines to Ubuntu with new-enough version of clang and libc++ to be able to remove my own module std that I had to use temporarily.

#cpp #cpp23 #cpp20modules

https://github.com/matus-chochlik/eagine-core/commit/6253beb7dc3bcde0aa816b4815d90b34d11a5339

Removed the temporary std module · matus-chochlik/eagine-core@6253beb

Contribute to matus-chochlik/eagine-core development by creating an account on GitHub.

GitHub

It wouldn't be C++ if every single good idea wasn't messed up in some way.

Like with modules. You can have a single ixx file instead of hpp+cpp combo and not pay the price of longer recompilation time if you change the implementation of some exported method.

BUT!

You must split the declaration from the definition and implement the method in the private module fragment.

So you cannot have the C# cake of declaring and implementing at the same place -_-

#cpp20modules #cpp20 #cpp

Oh boy, I wanted to provide docker images with bleeding edge GCC/LLVM/Cmake for Advent of Code 2023.

Turns out that GCC can't even be compiled for arm64 through GitHub actions. The QEMU solution is slow enough to timeout with a 6-hour timeout.

I managed to build things locally now, so if you don't trust me, you will have to build it yourself, but look forward to an article explaining how to do C++20 modules for AOC 2023.

#cpp #cpp20modules #AdventOfCode

Does anyone happen to know the state of #clang and #Cpp20Modules as of late november 2022?