Spitfire: Template Lightning Talk

Preview:

DESCRIPTION

Lightning talk about the new Python-based template language called Spitfire. Given at the Plone Conference 2007 in Naples, Italy by Alexander Limi — http://limi.net

Citation preview

AllTemplate

LanguagesSuck

aka

Why another template

language?

Because we can™

(Who’s “we”?)

Mike / YouTube

(f**king genius)

Yours truly

(markup obsessive)

Also, because

AllTemplate

LanguagesSuck

Why do they suck?

Let me count the ways…

Either they look like this

UGLY

<p class=”<?php someClass() ?>”><?php callSomeFunction() ?></p>

Or they perform like this

We can do better

We want

NICE

<p tal:content=”context/something”

>Text goes here</p>

and

What are your current options?

•TAL

•Genshi

•Myghty/Mako

•Cheetah

•Your own

Let’s do a simple benchmark

Standardized test

bigtable.pyhttp://genshi.edgewall.org/wik

i/GenshiPerformance

· obviously synthetic· 10×1000 table render

· measures pure throughput

Rendering times

100% Python goodness

Current version:

Compiler: ~2000 LoC

Runtime: 150 LoC

Compiles templates to

bytecode

Pluggable syntax

Both XML and text modes

Rendering times

Rendering times

Rendering times