Date: Tue, 12 Feb 2019 15:27:46 -0500
On Tue, Feb 12, 2019 at 2:50 PM Ben Boeckel <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.
> 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:28:00