u/tartaruga232

▲ 0 r/cpp

Options for Organizing Partitions

I did it again!

DISCLAIMER

Apologies for "spreading invalid, ill-formed code" (famous quote) again. I've done this in this blog posting for demonstration purposes. No programmers were harmed when preparing it. The code examples in this blog posting were tested using a C++ compiler, which is spread by a famous company. Some behaviors of this compiler may not be standard-conformant. Use at your own risk!

I'm looking forward to getting grilled. Thanks in advance for your time and your patience!

abuehl.github.io
u/tartaruga232 — 10 hours ago
▲ 30 r/cpp

Current Status of Module Partitions

A brief recap of the current status of module partitions - as I understand it.

  1. People are using hacks to avoid unneeded recompilations.
  2. The C++ standard has an arcane concept of partition units, which forces build systems to generate BMI files that aren't used (which is wasting work during builds).
  3. The MSVC-compiler (per default) provides a simple, easy to use and efficient implementation of module partitions (no unneeded recompilations, no wasted work during builds), which is not conformant to the current C++ standard.
  4. A CMake developer is working on a proposal that would fix items 1 and 2, which is probably the smallest required change to the standard, but adds another arcane concept ("anonymous partition units" using the new syntax "module A:;") on top of an already arcane concept.

Questions:

  • How and why did we get into this mess?
  • What's the historical context for this?
  • What was the motivation for MSVC ignoring the standard per default?^(1)

^(1) Yes, I know the MSVC compiler has this obscure /InternalPartition option for those who want standard conformant behavior and who are brave enough trying to use it (which is a PITA).

reddit.com
u/tartaruga232 — 3 days ago