Building C++ modules

Atila Neves atila.neves at gmail.com
Fri Aug 9 13:17:02 UTC 2019


On Friday, 9 August 2019 at 09:22:12 UTC, Dukc wrote:
> On Friday, 9 August 2019 at 08:37:25 UTC, Atila Neves wrote:
>> The other difference is that despite having modules, C++20 
>> still has the equivalent of module headers and module 
>> implementations.
>
> Don't we have those too? .hd files.

.di files are usually auto-generated, not needed, and AFAIK not 
that used.

> I remember that you did blog that 1.5 seconds compile time or 
> something like that is already frustatingly long for you.

Indeed.

> What do you think if the effect of compile time there, to 
> programmer?

 From experience, it makes me work much slower if I don't get 
results in less than 100ms. If I'm not mistaken, IBM did a study 
on this that I read once but never managed to find again about 
how much faster people worked on short feedback cycles.

> I had to use Dub with a --combined build back at Windows,

Doing pretty much anything on Windows will mean it'll be slower.

> and while it sure was a lot slower than a bare D compiler, it 
> was still faster than the main part of my project written in 
> C#. Even then, I found the compile time (haven't measured, but 
> probably like 20 seconds for debug build if both D and C# files 
> were changed) only mildly annoying.

That's why I said fast is relative. What's mildly annoying for 
you makes my brain slow to a crawl, never mind the frustration 
and desire to headbutt the wall repeatedly.

> So I'm interested, are virtually-instant compiles something one 
> has to experience to understand their benefit?

Maybe? There's the IBM research I talked about, but I can't 
remember the details or the general applicability.


More information about the Digitalmars-d mailing list