Web Programming in D

Steven Schveighoffer schveiguy at gmail.com
Thu May 23 00:44:26 UTC 2024


On Wednesday, 22 May 2024 at 16:22:42 UTC, Aravinda VK wrote:

> **Note**: Please note, Live mode will not work as expected if 
> lot of embeded D code used inside the diet template. Using Live 
> mode is not recommended for production use (Refer: 
> https://github.com/rejectedsoftware/diet-ng/?tab=readme-ov-file#experimental-html-live-mode)

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 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

-Steve


More information about the Digitalmars-d mailing list