Am 12.08.2024 um 19:38 schrieb Antony Polukhin via Boost:
ср, 10 июл. 2024 г. в 00:01, Antony Polukhin
: понедельник, 8 июля 2024 г. пользователь Ruben Perez
написал: <...> I'm happy to hear your opinion. My opinion is that I have not enough experience with modules yet :)
To fix that I'll try to modularise Boost.PFR in a few months. Many thanks for the links, especially with CMake scripts for modules Here's my first attempthttps://github.com/boostorg/pfr/pull/177/files
I've only tested it on clang-15. Looks like the compiler has issues with mixing global module fragment and includes (just as was noted above), so I've ended up with a toy sample that uses only std::puts. And it works!
The compilation time change is qute impressive:
$ time clang++-15 -std=c++20 -I /data/code/boost/ example/motivating_example0.cpp real 0m2,051s user 0m1,844s sys 0m0,144s
$ time clang++-15 -std=c++20 -fmodule-file=pfr.pcm pfr.pcm example/module_usage.cpp real 0m0,375s user 0m0,249s sys 0m0,107s
No idea how to deal with dependencies between diffrent Boost libraries, so I'd probably try to modularise Boost.Core + Boost.TypeIndex to get the idea.
Cool! Please be aware that Clang-15 is riddled with module-related bugs (according to one of the compiler devlopers I've been speaking to in Varna last year). With Clang-16, this is still true, Clang-17 is quite usable if you know how to deal with the ABI problems. And yet, Clang-18 still has troubles with merging definitions coming from multiple TUs. Dani -- PGP/GPG: 2CCB 3ECB 0954 5CD3 B0DB 6AA0 BA03 56A1 2C4638C5