Apple's Module proposal to replace headers for C-based languages [pdf]
While LLVM authors probably know best, I don't understand some of his criticisms on the "Inherently Non-Scalable" slide.<p><pre><code>  • M headers with N source ﬁles ->  M x N build cost
</code></pre>
It's only MxN if there is no use of the "#ifndef _HEADER_H" workaround that he mentioned earlier.   Wouldn't adding a preprocessor directive like "#include_once <header.h>" solve this?  Alternatively, these guards could be added to the headers themselves without changing the preprocessor.   This probably should be a parallel set of headers (#include <std/stdio.h>) to avoid breaking the rare cases that depend on multiple inclusions, but creating that set would be a simple mechanical translation.<p><pre><code>  • C++ templates exacerbate the problem
</code></pre>
I'm mostly a C programmer, so I have no argument here.<p><pre><code>  • Precompiled headers are a terrible solution
</code></pre>
Why is this?  It likely would break the ability of headers to be conditional on previous #define statement, but since the proposal does this anyway it doesn't seem insurmountable.  Along that lines, how does this proposal handle cases where one needs/wants conditional behavior in the header such as "#ifdef WINDOWS" or the like?  And is caching headers during the same compilation also "terrible"?