Our template emission strategy is broken
David Nadlinger via Digitalmars-d
digitalmars-d at puremagic.com
Wed Nov 11 09:19:28 PST 2015
On Wednesday, 11 November 2015 at 15:04:01 UTC, Andrei
Alexandrescu wrote:
> Yes, compiling package-at-a-time should be the mode endorsed by
> the core community. Liran Zvibel and I discussed this privately
> following his DConf 2015 talk, and I recall he mentioned the
> package-at-a-time solved essentially all of their build
> problems.
If you have a look at the bug report I linked in the original
post, you'll find that this case occurs precisely with
per-package compilation. Yes, there is a single cyclic
inter-package dependency hidden somewhere deep inside the
dependency graph, but getting rid of it after the fact would have
either required re-structuring large parts of a ˜10^5 LOC code
base, or would have again involved creating logical packages so
large that the memory inefficiencies (CTFE is the biggest problem
here) and run-time scaling issues (e.g. O(n^2) behavior in the
overall number of templates) in the front-end become a problem
again.
Of course, many of the problems could have probably been avoided
if there was an iron-clad rule that the module dependency graph
must remain acyclic from the beginning of development (at least
at the level of units of compilation). But how could they have
known how bad it would get otherwise? I don't think this is
reflected in our documentation anywhere, at least not in a
prominent place.
— David
More information about the Digitalmars-d
mailing list