What is the compilation model of D?

Jonathan M Davis jmdavisProg at gmx.com
Wed Jul 25 09:26:08 PDT 2012


On Wednesday, July 25, 2012 17:35:09 David Piepgrass wrote:
> > I find it shocking that anyone would consider 15 seconds slow
> > to compile for a
> > large program. Yes, D's builds are lightning fast in general,
> > and 15 seconds
> > is probably a longer build, but calling 15 seconds
> > "slow-to-compile" just
> > about blows my mind. 15 seconds for a large program is _fast_.
> > If anyone
> > complains about a large program taking 15 seconds to build,
> > then they're just
> > plain spoiled or naive. I've dealt with _Java_ apps which took
> > in the realm of
> > 10 minutes to compile, let alone C++ apps which take _hours_ to
> > compile. 15
> > seconds is a godsend.
> 
> I agree with Andrej, 15 seconds *is* slow for a edit-compile-run
> cycle, although it might be understandable when editing code that
> uses a lot of CTFE and static foreach and reinstantiates
> templates with a crapton of different arguments.
> 
> I am neither spoiled nor naive to think it can be done in under
> 15 seconds. Fully rebuilding all my C# code takes less than 10
> seconds (okay, not a big program, but several smaller programs).

Sure, smaller programs should should build quickly, and having build times get 
slower as the program grows can definitely be a problem. I'm not about to argue 
with that. But having a _large_ application build in 15 seconds is arguably a 
luxory. Large applications just aren't the sort of thing that builds quickly. 
But that's the sort of project that's usually commercial (either that or a 
major open source one), and I don't think that D's been used in that domain a 
lot yet.

While D compiles far faster than C++, the kind of application which takes 
hours to compile in C++ and the one that takes 10+ seconds in D are on a 
completely different level in terms of amount of source code and the level of 
complexity, even if D _would_ probably only take minutes on a similar project 
instead of hours.

- Jonathan M Davis


More information about the Digitalmars-d mailing list