First of all, most of them will be a lot faster, since Temple
encourages compilation (it is of course still possible to turn
everything into render-time method calls).
Secondly, it would be far easier to understand how different engines
works. Boring parsers are separated from code generation. If you want
to improve code generation, you can do that without even looking at
the parser. If you want to make the parser faster, you could for
instance rewrite it in C without thinking about the code generation.
It's easier to rewrite two or three small chunks, than one big. Easier
to test too.
Thirdly, it would be possible to share code, abstractions and
optimizations between engines. More sharing, less work.
--
Matt: Cool, I'd love to hear more about every template engine out
there (inside your minds too). Feel free to post on the mailing list,
and I'll check it out. If you even write something like "because of X
I think it would be difficult to compile it", I'll probably take it as
a challenge. After Tobias' comment
(
http://judofyr.net/posts/temple.html#comment-25654446 ) I started
writing the Liquid backend, but I got kinda stuck playing with Ragel
as a tokenizer.
//Magnus Holm