A idea to improve diet-ng compile speed!

Steven Schveighoffer schveiguy at gmail.com
Thu Aug 12 14:04:03 UTC 2021


On 8/12/21 9:45 AM, workman wrote:
> On Thursday, 12 August 2021 at 07:55:08 UTC, workman wrote:
>> D CTFE is great, but not suit for task like dieg-ng.
> 
> simple code like this, finish in 0.004s for 20 files. ldc2 take hours to 
> finish in product mode.

 From experience, I think the 2 hours is probably not because of diet 
CTFE interpretation. But I could be wrong, I don't know what your 
application is like.

> 
> dieg not support inherit and layout like 
> https://mozilla.github.io/nunjucks/ or 
> https://jinja.palletsprojects.com/en/3.0.x/, to add more advance 
> function CTFE will  crashed to compile.

diet supports layout inheritance via the `extends` directive.

e.g. all my files look like:

```pug
extends layout
block extraCss
   // extra css includes
block extraJs
   // extra js includes
block content
   // page content
```

Where `layout.dt` provides the overall layout.

-Steve


More information about the Digitalmars-d mailing list