On 7 May 2015 at 19:10, John Maddock wrote:
I suspect that C++ Modules cannot deliver any improvements over the non-header only with precompiled headers configuration. Good build config always beats compiler magic.
Actually it can - if implemented well - way back when, Borland's C++ compiler had better PCH support than anything else out there, it wasn't quite C++ modules, but it was quite a decent part of the way there. They had a little server app that managed and loaded all required PCH's as AST's into memory, so when a file was being compiled it would just map the memory from the other process and start compiling from there. It was lightning fast with near enough instant compile times. And this was 10+ years ago on hardware that folks would laugh at today. It was more or less automatic too - if there were no changes to a files #includes it would just go ahead and cache everything till after the last #include without the user having to excplicitly mess with PCH's at all. Of course both templates and C++ in general are a lot more complex now: this was all pre-STL days! Still it would be nice, if we could have a compiler/IDE release that wasn't actually 3 times slower than the one before ;)
It looks like I accidentally deleted a subsequent paragraph about C++ Modules being more likely useful as a step towards next gen tooling :( My C++ Now 2014 white paper (http://arxiv.org/abs/1405.3323) detailed how one might implement a C++ compiler as a database of ASTs such that all C++ was always as if inline defined i.e. every bit of code could see all other C++ code anywhere on the system. Build and dependency management simply become graph database queries. I think one of the C++ Now 2015 talks might cover some actual work done on such a database repository of ASTs to implement a build and package manager (this one? http://sched.co/2oLN), it's ultimately where Link Time Optimisation must eventually end up anyway when pushed to extremis. Might as well get a JIT zero time build system for free out of it. I guess the question eventually becomes if the compiler vendors are game for implementing such a very complex tool. Niall -- ned Productions Limited Consulting http://www.nedproductions.biz/ http://ie.linkedin.com/in/nialldouglas/