Re: Mason 2.0 thoughts

Michael Bayer <[email protected]> Mon, 30 Apr 2007 09:48:17 -0400
Newsgroups gmane.comp.web.mason.devel
Message-ID <[email protected]>
On Apr 29, 2007, at 6:22 PM, Dave Rolsky wrote:

> Jon Swartz and I recently chatted and one of things we talked about is
> what a Mason 2.0 might look like. It's been buzzing around my brain
> recently, so I write up some notes on this here -
> http://www.masonhq.com/?Mason20Notes
>
> Please note that this is still just at the "maybe this might be a good
> idea" stage, which means there is no commitment to do it at all,  
> much less
> a timeline.
>
> Nonetheless, if people are interested in discussing this, now's a good
> time.
>

hey there,  Mike over from the Python world here.  Just wanted to  
chip in that Myghty, the Python port of HTML::Mason, has recently  
undergone changes that I am reminded of when reading this link.  As a  
lot of web framework activity happened in Python subsequent to  
Myghty's release, Myghty's "framework features" also started getting  
in the way of things and looking pretty dated (also too perlish for  
the Python community to widely accept)...with the analogies to  
Catalyst being systems like Pylons (which actually grew out of  
Myghty) and Turbogears.

In my case, I could see that framework development activity was well  
under control by other projects so I created a new template  
application called Mako, which is very strictly about templates and  
does not venture into any framework-like concepts (the Python  
community sees that as a good thing).  I tried to maintain everything  
that I love about HTML::Mason and Myghty's template concepts, but I  
threw out syntax entirely and went with something much simpler and  
with fewer "left turns" so to speak (yet it provides *more*  
flexibility than Myghty in many ways).  I also wanted to integrate  
some other ideas i saw in other Python template systems,  wanted to  
have a little bit more "strictness" in its usage, and very  
importantly wanted to speed up the crap out of it, which I achieved  
by removing the entire request object/call stack and allowing  
Python's interpreter to do all that work....its now probably the  
fastest template language for Python, along with Cheetah which relies  
on some native code for its speed (Mako doesnt).

I mention this because I did come up with some interesting twists on  
component-call-with-content (you can call not just the "body" of the  
caller, but "sub-templates" defined by the caller...you can also pass  
arguments in both directions though maybe Mason allows this by now  
too).  Its runtime is also designed in such a way that inheritance is  
calculated per-request, meaning that dynamic "inheritance" schemes  
are possible.  "autohandler" functionality is no longer built in but  
is available as an extension which builds onto the dynamic inheritance.

Mako is also going to be the "default" template language in the next  
release of Pylons, which IMHO will soon be the second most prominent  
lightweight framework for Python (next to Django...which is its own  
world).  Its been very well received, adding plenty of users who  
would never have gone near Myghty.   Pylons + Mako continues to have  
advantages which originated in HTML::Mason that nobody else has, like  
the ability to cache page components individually (the Ruby on Rails  
folks are just beginning to stumble upon this notion).

While HTML::Mason is decidedly a totally different beast at this  
point, maybe theres some inspiration to be had from seeing where the  
HTML::Mason philosophy has winded up within the Python world.    
Pylons:  http://www.pylonshq.com   Mako:  http://www.makotemplates.org

as always, thanks to the Mason community for giving me such great ideas.

- mike



-------------------------------------------------------------------------
This SF.net email is sponsored by DB2 Express
Download DB2 Express C - the FREE version of DB2 express and take
control of your XML. No limits. Just data. Click to get it now.
http://sourceforge.net/powerbar/db2/