C++ Logo

sg15

Advanced search

Re: P1905 In-Source Mechanism to Identify Importable Headers

From: Gabriel Dos Reis <gdr_at_[hidden]>
Date: Thu, 28 Jul 2022 23:26:48 +0000
A key point that I would hope would become clear, as people get more concrete in-field experience, is that "importable" is a description of "use", not a state of being independent of use.

-- Gaby

From: Bret Brown <mail_at_[hidden]>
Sent: Thursday, July 28, 2022 3:03 PM
To: SG15 <sg15_at_[hidden]>
Cc: Gabriel Dos Reis <gdr_at_[hidden]>
Subject: Re: [SG15] P1905 In-Source Mechanism to Identify Importable Headers

I suspect eventually the toolchains and/or static analysis tools would benefit from a standard way to declare the intention that a header be importable. I expect certain kinds of antipatterns or even bugs could be identified that way.

But I also suspect we can circle back to that idea after we have some significant adoption and real-world experiences.

Bret

On Wed, Jul 27, 2022, 10:17 Gabriel Dos Reis via SG15 <sg15_at_[hidden]<mailto:sg15_at_[hidden]>> wrote:
Thank you.

-- Gaby

________________________________
From: SG15 <sg15-bounces_at_[hidden]<mailto:sg15-bounces_at_[hidden]>> on behalf of Daniel Ruoso via SG15 <sg15_at_[hidden]<mailto:sg15_at_[hidden]>>
Sent: Wednesday, July 27, 2022 5:36:08 AM
To: sg15_at_[hidden]<mailto:sg15_at_[hidden]> <sg15_at_[hidden]<mailto:sg15_at_[hidden]>>
Cc: Daniel Ruoso <daniel_at_[hidden]<mailto:daniel_at_[hidden]>>
Subject: Re: [SG15] P1905 In-Source Mechanism to Identify Importable Headers

On Wed, Jul 27, 2022, 05:50 Corentin via SG15 <sg15_at_[hidden]<mailto:sg15_at_[hidden]>> wrote:
I think it's something we ought to explore, if only for the sake of ahead-of-time scanning build systems.

I have gotten to the conclusion that it's actually a good thing that importable headers are indistinguishable from the source code alone.

Essentially, from the build system perspective, an importable header needs all the same semantics that named modules do, including the need for additional metadata (such as preprocessor arguments) as well as the ability to reuse BMI files.

For that reason, I think importable modules will always need to be explicitly identified by the build system either when they're in the same project, but even more when importable headers are shared with a pre-built library.

IOW, just knowing that a header is importable is not sufficient, the same way that just knowing that a module interface exists is not sufficient.

Daniel





_______________________________________________
SG15 mailing list
SG15_at_[hidden]<mailto:SG15_at_[hidden]>
https://lists.isocpp.org/mailman/listinfo.cgi/sg15<https://nam06.safelinks.protection.outlook.com/?url=https%3A%2F%2Flists.isocpp.org%2Fmailman%2Flistinfo.cgi%2Fsg15&data=05%7C01%7Cgdr%40microsoft.com%7Ccf7e5d2c47304a89a02908da70e4f877%7C72f988bf86f141af91ab2d7cd011db47%7C1%7C0%7C637946426800959768%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C1000%7C%7C%7C&sdata=c9AEUpraUl4FF9xpKNj%2FPeHAce8EVmGjDpxhi%2BkRmNk%3D&reserved=0>

Received on 2022-07-28 23:26:52