[Grok-dev] Re: Skinning/themeing

Martijn Faassen faassen at startifact.com
Mon May 21 13:31:43 EDT 2007


Martin Aspeli wrote:
>> * Grok/Zope 3 can "get out of the template language business"
> We seem to be wanting to get out of a lot of businesses these days. I 
> still prefer ZPTs to all other templating solutions I've used and looked 
> (though I haven't spent much time with Genshi yet).

I find Genshi to be equivalent in power to ZPT, and similar in feel to 
ZPT, and nicer in some respects. As a minor example, tuple unpacking 
works with py:for loops, for instance. That's ugly with tal:repeat. You 
can also using myattribute="${mything}" instead of having to use 
tal:attributes. It's also well documented, maintained, and used by a 
range of other frameworks.

Because all of that is the case, it becomes tempting to get out of the 
templating language business.

Of course Genshi will also have to prove itself in practice. I say path 
expressions should go away, but how to replace the very useful 

>> * I want to move away from ZPT as Grok's template language.
> Really?

I'm at the very least *extremely* interested in exploring this.

> I think it's something that we should give very careful thought to. ZPT 
> is the modus operandi in the Zope (2 + 3 + Plone) world. We may find 
> there are beneficial synergies here (for example in terms of form 
> widgets, particular viewlets and so on).

This is indeed not a minor step. That's why it's probably better to step 
towards template-language neutrality first and then see about going to 
another template language.

> If the benefits of a different templating language are not very strong, 
> I think we need to be careful. We could end up "stick in the middle" 
> where Zope developers feel uneasy about an alien templating language and 
> non-Zope developers feel uneasy about various Zopeisms. :)
> I'm not saying it's a bad idea, only that it's not one to take lightly.


I don't think we can make a very strong for the benefits of a different 
template language from a programmer's perspective. No template language 
I've seen is *that* much better than ZPT. You can argue increased 
convenience and you can argue a lesser conceptual overhead (no path 
expressions, perhaps), but those are not very strong reasons to switch. 
You could also argue increased performance (but that would require using 
something like Mako).

 From an evolution and maintenance perspective, it might make sense to 
go to a template language the Zope community is not supporting. We would 
not need to document it or maintain it, or optimize it. Genshi is 
currently the only language in the Python world I know about that has a 
significantly broad community around it to make this potentially 
worthwhile. (not that Genshi is actually faster than ZPT; I believe 
currently it's somewhat slower)

Anyway, I'm not pushing for switching to Genshi as the official template 
language today. If I ever will, that is quite a while off, in the Grok 
2.0 era or something. What I am pushing for is template language 
neutrality in the more near future. One of the motivations is the 
ability to switch later, but since it'd be good engineering anyway to 
support multiple template languages we can just forge ahead with this, 
no matter what we will decide to do later.

Flexibility is what Zope 3 is all about, and Grok inherits this, so it 
fits in our philosophy. Grok just needs to say "yeah, but this is the 
one we use in all the examples and all our own code" in addition to that.



More information about the Grok-dev mailing list