On 2023-06-09 10:12, Kenton Wilson wrote: > Hello All, > > I came across a paper by Nathan Sidwell entitled, 'Make Me a Module': > > > https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2019/p1602r0.pdf
Yikes, that whole thing is just grotesque. What is he thinking? The fundamental problem is that a module system is supposed to make a tool like Make unnecessary! As it incrementally compiles, the module system determines what else needs to be compiled. The transitive closure of the dependency graph is interleaved with the compiling. Interfacing with make brings nothing to the table, other than leveraging some parallelism? If you know what to build, and what the dependencies are, you can check them yourself rather than sending a message to make over some protocol. Most of the complexity in GNU make revolves around being a tool which can be programmed to build anything, using almost any imaginable file system structure. It has expansions and patterns, and re-evaluation, inclusion, interpolation of outputs of external commands, control via environment and command line variables, ad nauseum ... The problem of building C++ modules with a particular toolchain is very specific; it doesn't require any of that. It is a focused and specific problem. It *has* to be solved by the C++ toolchain itself in order for that module system to demonstrate its worth. A comprehensive module build can be plugged into a Makefile; it can be invoked as some unconditional step. The program to be built can be treated as a phony target so that the module builder is always invoked. .PHONY: $(PROGRAM) $(PROGRAM): c++-module-build-system $(PROGRAM) # does everything install: $(PROGRAM) ... steps to install program tests: $(PROGRAM) ... steps to run tests