by dureuill on 5/1/24, 3:23 PM with 90 comments
by schaefer on 5/1/24, 5:09 PM
The compensation packages we are able to offer to new hires means we're generally hiring from the middle of the talent pool, not the upper tier.
The complexity of c++ has long since outpaced the pace of fluency of the hiring pool. In my experience, the average c++ professional (that applies for our open job ads) knows c++14, and might not balk at an occasional c++17 feature.
It doesn't matter if the compilers support modules or not, because in practice, I won't be able to use modules in the workplace for ages.
--
Standard disclaimer - I'm not able to predict the crush of changes coming as generative AI for software development proliferates.
by falcor84 on 5/1/24, 4:30 PM
by cwzwarich on 5/1/24, 4:38 PM
The feature has so many irregularities that could only come out of a standards process, there are too many compiler bugs (just try using header units), the different implementations are too fragmented (I’m only using clang, which makes this easier on me), and there is a lack of things like module maps that would dramatically improve usability.
by QuadrupleA on 5/1/24, 4:42 PM
by davidthewatson on 5/1/24, 4:31 PM
However, a key opportunity is missed in that neither the icon nor the site links in the footer linked to a short definition of the language before modules (the lack), the impact of modules on the design of the language at present (the real) and its place in the future of programming languages (the imaginary and the symbolic).
by t43562 on 5/1/24, 5:10 PM
This is the source of all the evil. Even a hello world program involves reading through 100s of kilobytes, often megabytes, of headers that have to be parsed again and again for every source file but which can produce totally different outcomes in each case depending on compilers and the OS and the definitions on the commandline and whatever's defined in the source code itself and how the filesystem is laid out.
You can forget managing the dependencies on large projects this way - they are overwhelming. Every build system tends to be leaky and imperfect to not get drowned in dependencies and the fanciest systems all tend to have big holes here or there or they have to use huge "catchall" dependencies to try to be correct at the cost of efficiency.
I hoped modules would remove this problem but so far I'm not sure. I'd love to get the opinion of someone who has used them. My read-ups about it didn't seem that hopeful - I got the impression of them being a bit like pre-compiled headers.
by mid-kid on 5/1/24, 4:41 PM
I think this line on its own sums it up.
by duped on 5/1/24, 4:32 PM
by terr-dav on 5/1/24, 4:37 PM
by flatline on 5/1/24, 4:59 PM
by CamouflagedKiwi on 5/1/24, 4:50 PM
by delta_p_delta_x on 5/1/24, 4:58 PM
This website scrapes vcpkg's registry[1], which contains many C libraries which are unlikely to ever receive C++20 module updates. Many are primarily binary executable packages, like lunarg-vulkantools. It is quite unfair to judge C++ module support by this. There are even bugs in the table: the issue tracking Vulkan-Hpp module links to https://github.com/KhronosGroup/Vulkan-Hpp/issues/121, but it was actually implemented in https://github.com/KhronosGroup/Vulkan-Hpp/issues/1580 (full disclosure: I implemented it).
Boost maintainers have picked up on this[2], which is big.
The big 3 compilers have had a myriad of bugs, ICEs, and redefinition errors, despite what is claimed on cppreference[3]. VS 2022 17.10 will only just fix some of these, and G++'s module support isn't even released yet. Clang 18 has seemingly full(er) support for C++20 modules, but clangd is broken, and it seems mixing standard library headers and `import std` might still break, as will header units (`import <header>`).
CMake released C++20 modules support with 3.28, and will release `import std` support with 3.30.
This is painful but IMO worth the paper cuts that the bleeding-edge adopters will experience in the next year or so as modules are implemented.
I fully believe that a good one-third to half of build time and power consumption in the past 40+ years of compiling C and C++ code (considerably more so in the case of template-heavy C++ header-only libraries and projects) has gone to parsing and re-parsing headers and the resultant output.
Headers are a distinctly 1970s approach to compartmentalisation. Other languages have sorted dependency and library/import resolution years ago; there's no reason the C and C++ world has to be stuck with essentially copy-pasting code over and over. The embarrassingly parallel building that results from headers is fake; it takes more time and more energy than strictly necessary.
[1]: https://vcpkg.link/browse/all
by afavour on 5/1/24, 4:46 PM
by greenavocado on 5/1/24, 5:20 PM
by krunck on 5/1/24, 5:37 PM
by softwaredoug on 5/1/24, 5:18 PM
by neilv on 5/1/24, 4:56 PM
by obituary_latte on 5/1/24, 4:51 PM
by chefkd on 5/1/24, 4:44 PM
by 8f2ab37a-ed6c on 5/1/24, 4:51 PM
by eranation on 5/1/24, 5:45 PM
(edit: Conan seem to address C++20 modules, seems to seek compatibility, but as a non CPP developer, not sure I read it right https://blog.conan.io/2023/10/17/modules-the-packaging-story...)
by throwitaway222 on 5/1/24, 4:47 PM
by muricula on 5/1/24, 4:37 PM