[Numpy-discussion] Template system

Charles R Harris charlesr.harris@gmail....
Fri Jan 11 23:05:43 CST 2008


OK, so far I've knocked it down to 35KB by removing stuff I'm not interested
in. It is now smaller than Cog, and 7x larger than the file we now use to do
the same job. I'm pretty sure I can make it leaner than that. It remains
extensible.

On Jan 11, 2008 7:02 PM, Robert Kern <robert.kern@gmail.com> wrote:

> Charles R Harris wrote:
> >
> >
> > On Jan 11, 2008 2:58 PM, Robert Kern <robert.kern@gmail.com
> > <mailto:robert.kern@gmail.com>> wrote:
> >
> >     Charles R Harris wrote:
> >      > Hi All,
> >      >
> >      > I'm thinking of adding the template system I pulled out of Django
> to
> >      > Numpy to use in place of the current code generator. Its
> >     advantages are
> >      > documentation, flexibility, and maintainance. The code totals
> >     about 470
> >      > KB, comes with a BSD license, and is compatible with Python >=
> 2.3. I
> >      > want to bring this up on the list because I'm sure there will be
> >      > objections along the lines of "why do we need that"?  So I want
> >     to see
> >      > how strenuous the objections are.
> >
> >     It's too big. If you want a better template system than the current
> >     one, there
> >     are a few which are contained in a single file. That would be fine
> >     to include,
> >     but I object strongly to incorporating Jinja.
> >
> >
> > Ummm, harsh. I'm certainly open to suggestions. I took a closer look at
> > the django system and reduced it to 308K, 70K zipped. There was a lot of
> > space taken up by the .svn directories inherited from django and *.pyc
> > files. I could probably knock another 50K off by removing some
> > functionality we don't really need: html, http, dates, time, and maybe
> > template inheritance. Just for comparison, here are some things that are
> > in a fresh checkout of numpy, including the .svn files
> >
> > Numpy 23 MB
> > f2py   5.4 MB
> > doc/swig 1.5 MB
> > code_generators 192K
> >
> > So adding the template subsystem would increase the repository size by
> > about 1.4%.  Do you have any objections in addition to the size?
>
> Yes. I'm not convinced that we need anything better than we have now. Show
> me
> how using Jinja templates makes the current code better. Check the
> one-file
> templating modules (like YAPTU[1] or Cog[2]) out there to see if those are
> sufficient. Jinja and its kin (Mako, Cheetah, etc.) are intended for a
> very
> different use case, and their design, implementation, and footprint are
> optimized for that.
>
> [1] http://aspn.activestate.com/ASPN/Cookbook/Python/Recipe/52305
> [2] http://nedbatchelder.com/code/cog/
>
> --
> Robert Kern
>
> "I have come to believe that the whole world is an enigma, a harmless
> enigma
>  that is made terrible by our own mad attempt to interpret it as though it
> had
>  an underlying truth."
>   -- Umberto Eco
> _______________________________________________
> Numpy-discussion mailing list
> Numpy-discussion@scipy.org
> http://projects.scipy.org/mailman/listinfo/numpy-discussion
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://projects.scipy.org/pipermail/numpy-discussion/attachments/20080111/715bbbb6/attachment.html 


More information about the Numpy-discussion mailing list