web.py Released

Remember Aaron Swartz's post on rewriting reddit.com from Lisp to Python in 7 days? Besides a "blow" to the Lisp community (people you don't want to offend), it also introduced issues with existing Python web application frameworks. The end result? web.py, and 0.1 was released today under an open-source license. You can download the Python file here.

Yes, the whole "frame work" comes in one single Python module. 1,042 lines and that's all, where almost 300 of them are for HTTP 500 page. It claimed to be the "anti-framework framework" that doesn't get into your way. Actually web.py is so primitive, it is no more than a thin wrapper on top of CGI plus a few helper functions. It has a regex based URL dispatcher, a few database function wrapping around PostgreSQL, WSGI handler and a wrapper function around Cheetah. That's all.

Comparing web.py with flashy MVC frame works like Django or TurboGears is really like comparing apple and orange. Django or TG has relatively higher setup cost, but makes CRUD-style web applications a breeze, if your brain can fit into their model (which are actually pretty excellent models, btw). web.py on the other hand, can truly be a replacement for PHP -- easy to get started if all you need is a "Hello World" app. It doesn't "get into your way" because it provides pretty much no way. You'll end up writing your own framework to perform common tasks like session management, caching, authentication, form generation, etc.

So far web.py 0.1 feels a bit disappointing. It is no longer 1996 where CGI.pm is all you need for your dynamic content. I'll stick to Django, TurboGears and probably Zope 3.

Update: Paul Bissex also wrote about the web.py, and he said:

In the end I think that whatever small amount of energy dissipation web.py causes will be more than offset by the ideas that it (by which I mean Aaron, really) injects into the discussion of what a web framework should be and do.

While I don't see web.py useful in my case, but Paul is right -- more frameworks generates more ideas which benefits everyone in the game.

Update: Robert Sayre questioned the license term of web.py. If web.py is indeed released under GPL3-alike term where the whole website needs to be released under GPL if it is poisoned with a GPL library, then I'll say forget about it.