News for hackers. Stuff that matters.
Re:Django Book 1.0 online by mhartl on Monday December 17, 2007 @01:15AM (#90260)
As Mike Vanier has noted (http://www.paulgraham.com/vanlfsp.html), "LFMs [languages for the masses] deliberately restrict the abstractive power of the language, because of the feeling that users 'can't handle' that much power. This means that there is a glass ceiling of abstraction; your designs can only get this abstract and no more." In this context, the Django template language appears to be an LFM. In Mike's nomenclature, embedded Ruby is an LFSP (language for smart people).

It may be that an LFM is the right design decision in some contexts. For others, an LFSP is better. For my purposes (and please forgive the pretension), I prefer an LFSP. And, while you can use an LFM in Rails (e.g., the Liquid template language), I don't see how you can use an LFSP in Django---at least, because of whitespace, not the LFSP called Python.

Re:Django Book 1.0 online by reitzensteinm on Monday December 17, 2007 @03:51AM (#90282)
Well, it doesn't just appear to be an LFM, it was explicitly designed as such.

I don't think that the Python syntax is an inappropriate choice to be used as a fully enabled template language - you could bolt on <% end %> tags with a preprocessor that indents automatically pretty trivially. Such a template language just doesn't exist yet.

Re:Django Book 1.0 online by mhartl on Monday December 17, 2007 @12:33PM (#90364)
Read the quote again: that's the canonical definition of an LFM. It's a language that restricts the user's power, not by accident, but by design.
Re:Django Book 1.0 online by reitzensteinm on Wednesday December 19, 2007 @04:29AM (#91095)
Sorry, I meant that the authors themselves say that it's designed as one - i.e. there's no 'appears to be' about it.

But not only was I unclear, in hindsight it was a total nitpick to boot. :)

Re:Django Book 1.0 online by mhartl on Thursday December 27, 2007 @12:24AM (#92898)
Ah. Gotcha. Sorry for the misunderstanding.
Re:Django Book 1.0 online by adrianh on Monday December 17, 2007 @12:39PM (#90368)
I've seen a couple of implementations of "Python as a template language with 'end' statements" over the years. Here's one:

http://www.kryogenix.org/code/vellum/docs/templates.html

Another one is Python Server Pages:

http://www.ciobriefings.com/psp/

(Edited to fix typo.)

Re:Django Book 1.0 online by reitzensteinm on Wednesday December 19, 2007 @04:31AM (#91096)
Thanks for the links. I wonder how long it will be until someone puts one in Django.