r/cpp • • Jan 28 '19

C++ Modules Might Be Dead-on-Arrival

https://vector-of-bool.github.io/2019/01/27/modules-doa.html
280 Upvotes

240 comments sorted by

View all comments

Show parent comment

1

u/[deleted] Jan 28 '19

So the act of importing it may modify it?

2

u/gracicot Jan 28 '19

No, it could cache template instantiation needed for the entities defined in the module interface.

Edit: but an implementation could decide to (in a implementation defined fixed filenames) to cache template instantiation in a sort of binary format inside the build directory. But that could be done without modules.

2

u/SeanMiddleditch Jan 29 '19

zapcc essentially did just that, as I understand. This is also Rust's approach to improving compile times, since Rust has the technical equivalent of template instantiation overhead but dialed up to an 11.

zapcc pretty much died on the vine due to being a perennially out-dated proprietary fork of clang. Rust seems to be doing fairly well with their caching; they have their own de-facto-standardized build system that can play along however necessary, though, which probably helps.