[Baypiggies] new web application framework.

Bob Ippolito bob at redivi.com
Thu Mar 1 01:40:06 CET 2007


On 2/28/07, Keith Dart ♂ <keith at dartworks.biz> wrote:
> Shannon -jj Behrens wrote the following on 2007-02-28 at 15:55 PST:
> ===
> > Pylons can do all of those things, without constricting you to *just*
> > those things.  Welcome to the wonderful world of Web framework
> > creators ;)  I'm guilty as well ;)
>
> ===
>
> What I didn't like about Pylons is that embeds the assumption that
> you're using threads. I don't like threads, and this framework uses
> multiple processes instead. One reason for this is explained very well
> here:
>
> http://poshmodule.sourceforge.net/posh/html/node1.html
>
> I also prefer it for security reasons (having multiple servers each
> running as a different user, in a different chroot).

That's why you run pools of threaded servers with a load balancer in
front... You're going to want to do blocking operations at some point,
especially SQL stuff, so you're going to need threads for that.
Assuming you don't want to write everything in a Twisted sort of
style, a model where you have N processes with M threads is most
practical.

Technically Pylons doesn't "assume threads" it just supports them by
proxying all of the globals that wouldn't otherwise be threadsafe. It
assumes a WSGI server. Technically you shouldn't really even need
globals if you pass around the WSGI environ everywhere, but globals
are a bit more practical and easier to use than accessor functions
around an environ.

If you really wanted to go crazy you could just use Erlang instead,
where you trade Python's nice syntax and libraries for some pretty
spectacular scalability and a nice process model with code reloading
that Just Works. I use Erlang for the crazy behind-the-scenes stuff
with our service (which generates only SWF files and JSON), but the
front-end that our users interact with is all Pylons. The front-end
needs to serve maybe five or six orders of magnitude less traffic and
doesn't have the same kind of strict latency requirements.

> I also like Django style regular-expression URL mapping. But it
> does not have a reverse function or mapping. My framework uses Django
> style mapping to cleanly map URL paths to callables, and can also go in
> reverse (provide the callable and get the URL that will get to it).

I'm sure you could do that with Pylons if you really wanted to, routes
is just the default routing middleware. I'm not sure when you'd want
callable to URL mapping though? I've never even thought of wanting
such a thing.

> I also don't like templates because it's difficult to guarantee
> standards compliance. This framework allows you to construct pages
> using pure Python code. The result is guaranteed to comply with the
> selected DTD (XML bases: eg. XHTML or WML), or else fail.

That's pretty much what XML template systems like Genshi (Kid, ZPT,
etc.) do except you get a much better development experience and web
designer integration than you do with a bunch of Python expressions
that end up as {W,XT,HT}ML eventually.

-bob


More information about the Baypiggies mailing list