Found on Medium: Why we chose the D Language and vibe.d

H. S. Teoh hsteoh at
Wed Dec 19 17:42:00 UTC 2018

On Wed, Dec 19, 2018 at 10:28:59AM -0500, Steven Schveighoffer via Digitalmars-d wrote:
> I'm curious if the author has any words to say on vibe.d compile
> times. If they value fast compile times over performance, I can't
> imagine they are using diet templates.

Yeah, in my own vibe.d project I eventually separated out diet templates
into their own modules that are separated from "business logic". Which I
should be doing anyway, I suppose, in the spirit of good software
design, but the primary motivation at the time was to keep compilation
times under control.

I'm quite tempted to cook up my own HTML generation framework that does
codegen as a separate step, using D tools to generate D code, that then
gets compiled into the actual executable.  Despite all the power of CTFE
and other compile-time features, past a certain level of complexity I
really want to physically see the generated code rather than wade
through inscrutable templates and mixins and try to imagine in my head
what the generated code looks like. (You wouldn't believe it, debugging
is SO MUCH easier when you don't have to instantiate templates in your
head just to understand what the code is trying to do, but can just look
at the actual generated code being fed to the compiler as a file.)


Beware of bugs in the above code; I have only proved it correct, not tried it. -- Donald Knuth

More information about the Digitalmars-d mailing list