On Thursday, 5 December 2013 at 13:49:51 UTC, Dicebot wrote:
On Thursday, 5 December 2013 at 04:02:58 UTC, Puming wrote:
There maybe another traditional approach, by converting the
.dt diet templates directly into D source code BEFORE the
actuall compilation. That is the way many other HTML template
systems use, and the performance is fairly good.
It is somewhat complicated by the very tight integration
between D handler host and Diet - you can expose D symbols for
rendering context to template. It is still possible to do it
that way but is likely to require more efforts and effectively
will just to the same thing as good JIT-ed CTFE should. I don't
like it because it is too effort-demanding for a quick hack and
not suitable in the long term by design (one of D goals was to
remove reliance on external build steps as much as possible)
Yes, I agree that for dev mode a pure runtime version would fit
more and its implementation could take advantage of many
functions in the CTFE version (or is that already possible?)