C++ Logo


Advanced search

Re: [Tooling] Portable Module Representation

From: Boris Kolpackov <boris_at_[hidden]>
Date: Wed, 14 Mar 2018 17:55:27 +0200
Corentin <corentin.jabot_at_[hidden]> writes:

> I propose that conforming compilers must generate when compiling a module
> interface both:
> * A non portable, implementation-defined module interface file that may be
> digested by that specific compiler (like it is the case today, as per the
> module TS)
> * A defined, non compiler specific "universal" module interface
> representation.

Another alternative would be to define an API (naturally in C++ -- it's
about time we stopped using other languages for implementing our tools)
that can be used to query the compiler-specific binary module interface
(BMI) files. Each compiler vendor will then provide an implementation
of this API for their format.

> Libraries could then be distributed with those modules representations
> [...]

Distributing anything generated opens a can of worms. For example, does
it mean we check-in these representations into VCS since these days this
is the way things are often "distributed"?

> For package managers, it could provide a mean to enforce semver at the API
> level (aka that, the dependent project will still build when the source
> dependency is updated, as long as they don't depend anything else than the
> formally describe API).

Yes, having a formal API compatibility verification would be very nice


Received on 2018-03-14 16:55:34