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

bauss jj_1337 at live.dk
Wed Dec 19 22:52:10 UTC 2018


On Wednesday, 19 December 2018 at 17:42:00 UTC, H. S. Teoh wrote:
> 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.)
>
>
> T

Pretty much solved in Diamond.

https://diamondmvc.org/

Basically: 
https://github.com/DiamondMVC/Diamond/blob/master/app/web.d#L192

viewResult.source is the exact generated source for a specific 
view.


More information about the Digitalmars-d mailing list