Our template emission strategy is broken

Johannes Pfau via Digitalmars-d digitalmars-d at puremagic.com
Wed Nov 11 06:50:26 PST 2015


Am Wed, 11 Nov 2015 14:31:53 +0000
schrieb Martin Nowak <code at dawg.eu>:

> On Wednesday, 11 November 2015 at 14:15:54 UTC, Johannes Pfau 
> wrote:
> > And where do you draw the line? Do we expect ARM users to have 
> > 4GB of RAM to compile phobos? Is 512MB enough? 64 MB? Even huge 
> > C++ codebases such as GCC compile with 128MB memory.  
> 
> OK let's clarify the terminology first.
> 
> separate compilation: -c single_source.d
> incremental compilation: -c source_a.d source_b.d (as well as -c 
> -ofsingle.o source_a.d source_b.d)
> library compilation: -lib all_pkg_sources
> 
> Separate compilation works fine (and predictable) but is slow 
> (due to reparsing), you do need to link all objects from all your 
> sources though.
> Choosing this strategy makes sense to mitigate OOM issues.
> 

OK, that makes sense. I thought there were some issues with separate
compilation as well, but I'm not sure.

Anyway, I meant working _separate_ compilation is important, incremental
compilations is much less important for me. GDC doesn't even support
multiobj style compilation.

BTW: shouldn't incremental compilation with one single output object
have exactly the same result as compiling into one static library? So I
guess we already avoid most of these problems in gdc by simply not
offering a multiobj mode ;-)


More information about the Digitalmars-d mailing list