C++ Logo


Advanced search

Re: [SG15] Draft: Requirements for Usage of C++ Modules at Bloomberg

From: David Blaikie <dblaikie_at_[hidden]>
Date: Fri, 18 Jun 2021 11:37:27 -0700
On Fri, Jun 18, 2021 at 11:21 AM Daniel Ruoso <daniel_at_[hidden]> wrote:

> On Fri, Jun 18, 2021 at 2:01 PM Gabriel Dos Reis <gdr_at_[hidden]>
> wrote:
>> - but you cannot discover the graph with a simple lexer
>> Yes, and I have not found that to be an actual problem in practice. In
>> fact there is really nothing new here
> You are right that when you look at the translation units you're trying to
> build, nothing changes. And, to be clear, I'm not trying to change the
> language to preclude the use of macros in the source files themselves.
> What I'm advocating for is that when you have a pre-built artifact, having
> to re-run that preprocessor for the module interface files at best is
> repeating work that was already done when the library was built, at worst
> may introduce an ODR violation. The requirement that I'm presenting is
> scoped for when you're consuming modules outside of the current build.

Oh, sorry, that sounds a bit different again from what I thought we were
discussing - I could see that being useful, but owing to the BMIs being
non-portable, I'd not be in favor of some standardized file format for
discovering that. A standardized entry point to the compiler to query a BMI
for its dependency information sounds OK though (again, consistency between
Clang and GCC and anyone else who's making a GCC-like/compatible command
line interface).

Though, generally, since BMIs generally won't be/can't be distributed it
seems of limited value - whatever system built the BMI would be the same
system using it later & probably would remember in its own way what the
dependencies were.

Received on 2021-06-18 13:37:40