C++ Logo


Advanced search

Re: [Tooling] Request for modules recommendations

From: Boris Kolpackov <boris_at_[hidden]>
Date: Wed, 11 Apr 2018 06:58:30 +0200
Ben Craig <ben.craig_at_[hidden]> writes:

> * What granularity should I provide for my modules?
> ** Do I translate headers to modules one-to-one?
> ** Do I just have one big module for my entire library?
> ** Something in between?
> * What file extension(s) should I use for module files?
> * How should we map module names to file names? Just by replacing
> dots with slashes?
> * How should tools find modules?
> I know just enough about modules to ask subtly wrong questions, [...]

No, these are spot on. We had to answer[1] all of these (and some more)
while adding support for modules in build2.

The problem of mapping module names to file names is especially tricky:

1. We don't want it to become tedious like specifying the mapping for
   each module explicitly would be.

2. We want decent performance from the build system so parsing each
   module interface to find its name is probably not an option.

3. We want the file names to fit the project's overall scheme (some
   might want FooBar, others foo_bar, I like foo-bar and you seem
   to prefer foo/bar).

[1] https://build2.org/build2/doc/build2-build-system-manual.xhtml#cxx-modules


Received on 2018-04-11 06:58:47