Web Programming in D

Aravinda VK mail at aravindavk.in
Thu May 23 05:27:42 UTC 2024


On Thursday, 23 May 2024 at 00:44:26 UTC, Steven Schveighoffer 
wrote:
> On Wednesday, 22 May 2024 at 16:22:42 UTC, Aravinda VK wrote:
>
>> [...]
>
> Great to see other people find it useful!
>
> To clarify a bit -- live mode does not include a D compiler, so 
> it should work as long as any of your changes are to the *html* 
> portion of the diet file. If any code has changed (including 
> restructuring the code, like moving an interpolation outside a 
> loop), then it's not just that it just won't render the 
> changes, it actually will throw an exception, and refuse to 
> render the template. The exception says as much. This is one of 
> the main reasons it's not recommended for production -- you 
> don't want to mess with the file and find it crashes your 
> server.
>
> Note that it still requires you to compile your templates into 
> D code, because, well, there is no compiler to do it later!
>

I like the way it compiles the Diet templates into binary and 
serve the content from RAM. It is awesome for production use. I 
started using the Live mode only for development where I can skip 
recompiling the code for each CSS/JS/HTML change.

> I use live mode constantly, and vibe development is 10x better 
> because of it.
>
> If you are interested in compilation speed, you can use my 
> dietpc pre-compiler and cache mode to avoid some of the giant 
> memory/compilation time of diet templates.
>
> https://github.com/schveiguy/dietpc

Looks interesting. Thanks.

>
> -Steve



More information about the Digitalmars-d mailing list