Am 23.11.2013 16:56, schrieb Shammah Chancellor:

On 2013-11-19 09:32:30 +0000, Sönke Ludwig said:

On Tue, 19 Nov 2013 06:14:30 GMT, Manu Evans wrote:

So, I'm trying to work with templates, and I'm finding it quite a
tedious process.

It's awesome that they're compiled and super fast and all that, but
it's really annoying during development.

I'm getting really tired of having to terminate the server, rebuild
(because I changed some text in a template, or tweak or colour, or
whatever), rebuild (not helped by the failed dependency checking in
VD), launch, then switch back to my browser and refresh.

This seems a crazy iteration cycle to me. I'm assuming that I've
missed something?

Is there a way to interpret the templates at runtime during
development? I should be able to edit a template, hit save, refresh my
browser and see the changes.

Possible? Possible to implement if not?

Not possible as soon as any D code is embedded - unless someone writes
a D interpreter that can sit on top of the static application state.

What are other peoples iteration cycles? Surely they can't work like
this...?

It's not optimal, but I generally still find it acceptable since I
personally don't have much tuning going on inside of templates (all
optical aspects are handled by CSS, logic is handled in normal D code
and not much is left in-between usually). The main improvement that I
had planned in this area was to have a background process monitor
source changes and automatically start a compilation pass in the
background + seamlessly switch to a newly started process - but that
wouldn't improve the turnaround time of course.

As far as I can see, there are three possibilities to get near-zero
turnaround times:

  1. Use only static HTML

  2. Use some kind of embedded scripting language to generate HTML

  3. Compile each template to a separate DLL and dynamically load it
    into the process like you have already done for game entities

Option number three could probably even be nicely and seamlessly
integrated into the current framework, but I definitely lack the time
to do so.

What about compiling the templates to a shared library, and having
vibe-d load and unload them as needed when it detects the templates
change? Vibe-d could run a background recompile task and lock the
thread for a second and reload them. This is what ASP.NET does.

Doesn't seem like it would be too difficult to implement.

Exactly, thats option 3. It's not difficult, but my time schedule is
already so stuffed with other things that I personally have to put it
into the nice-to-have category. But I'd definitely accept a pull request.