C++ Logo

sg15

Advanced search

Re: [Tooling] Modules feedback

From: Gabriel Dos Reis <gdr_at_[hidden]>
Date: Tue, 12 Feb 2019 20:32:06 +0000
That sounds about right. 😊

From: tooling-bounces_at_open-std.org <tooling-bounces_at_[hidden]> On Behalf Of Mathias Stearn
Sent: Tuesday, February 12, 2019 12:28 PM
To: ben.boeckel_at_[hidden]; WG21 Tooling Study Group SG15 <tooling_at_[hidden]>
Subject: Re: [Tooling] Modules feedback

On Tue, Feb 12, 2019 at 2:50 PM Ben Boeckel <ben.boeckel_at_[hidden]<mailto:ben.boeckel_at_[hidden]>> wrote:
On Tue, Feb 12, 2019 at 19:32:45 +0000, Gabriel Dos Reis wrote:
> IPR isn’t for distribution.

OK. Substitute whatever format we end up using for distribution of
modules within RPM, DPKG, vcpkg, ports, etc. It just can't be "nothing"
because otherwise modules are effectively only useful in monorepo
build-the-world-from-scratch projects. Which is not how C++ works today
in the realm of FOSS. And it is best if that format is compatible
between otherwise-compatible compilers too.

If I understand the situation correctly (not at all guaranteed), I think the replacement for headers is module interface source files. Downstream projects can consume a precompiled lib by extracting the BMI from the module interface using their compiler and settings of choice, as long as they are ABI compatible with how the library was originally compiled. This requirement is the same as it was for headers, it just happens to be more obvious with modules.

I certainly hope this is the plan, because as a human, I can read a header or a cppm (ideally with comments) to understand an API. However I can't read a BMI or IPR. We should not neglect the human consumers of code. Our time is (usually) much more valuable than the computer's that we are compiling on.

Someone who knows better than me, please correct anything I am wrong about.

Received on 2019-02-12 21:32:12