Thursday, May 8, 2008

Notes from the SoCal Piggies meeting on May 1st

This is overdue by a week, but better late than never...We had our SoCal Piggies meeting last Thursday May 1st at the offices of Gorilla Nation, who graciously provided the conference room and the food for the meeting. A lot of new people showed up at the meeting, plus some of the veterans. In all I think we had around 20 attendees -- not bad at all, considering our humble beginnings in March 2005.

The first speaker was Ben Bangert, who gave us an overview of his Python Web framework, Pylons. I hope I'll get the actual slides from Ben, and I'll post a link here as soon as I can (UPDATE: here are the slides in PDF format). In the mean time, I'll use my notes to give you an idea of what Ben talked about:
  • Pylons was created with simplicity in mind (it consists of only 1,400 lines of code)
  • It uses WSGI as the glue between various components
  • It follows the Model-View-Controller pattern: Pylons itself is the Controller, the ORM (SQLAlchemy) is the Model, and the template language (Mako) is the view
  • The core components of Pylons are: Routes for URL configuration, Beaker for session/caching management, WebError for exception handling/debugging info, WebOb for easier HTTP request/response handling, and Paste for WSGI loading/configuration
  • All these components are examples of what is called 'WSGI Middleware'
  • Pylons recommends SQLAlchemy for the database/ORM layer, and Mako for templating, but it supports other ORM and templating modules too (examples of alternative templating tools are Genshi and Jinja)
Ben followed these more theoretical consideration with practical examples of creating a 'Hello, world' Pylons application. He used the handy 'paster' command-line tool, which created the scaffolding for the application (including unit tests!). Ben then delved into details on customizing the application, using the template language, and debugging via the awesome WebError module functionality (which can be used by any WSGI application.) Watching Ben speak and demonstrate the code reminded me of a karate sensei doing a kata -- it all seems so easy when the master shows it to his disciples, but you can feel the vast experience and power behind this simplicity.

One thing I didn't quite realize before Ben's presentation is that Pylons and its core/recommended components are the work of a triumvirate which I'm tempted to call 'B Cubed', or The Bangert-Bicking-Bayer Ensemble. As Ian Bicking says, Ben Bangert lords over Pylons, Route and Beaker, Ian lords over Paste, WebOb and FormEncode, while Mike Bayer lords over SQLAlchemy and Mako.

The second presenter was Pablo M. He showed us a practical example of a Google App Engine application called tapapps and built using Flash as the front-end. His goal for this app is to be a portal that aggregates content from various sources. He will then synchronize his iPhone with this one app, as opposed to syncing it to a multitude of content sources. For now though, the app just accepts user input, saves it on the Google BigTable, and displays it to the other users. Pablo was impressed with the ease of deployment of a GAPE application. He modified his Flash source, rebuilt the swf file, then ran appcfg.py to upload a new version of the app to the Google cloud.

A lively discussion ensued following Pablo's presentation. The discussion mostly centered on the current shortcomings of the Google AppEngine environment. For example, any task launched from within your application will be killed after 3 seconds. This means that inserts into the Google Big Table better take less than 3 seconds. Ben actually witnessed how an operation that attempted to insert 50 records at a time was killed because it was too slow. Apparently, writes to the Big Table are very slow, but reads are very fast. Also, the lack of cron-type scheduling is something that really hurts GAPE applications. Not to mention the lack of various Python modules (such as socket, or compiler) -- of which I also complained in another post. Overall though, a Python interest group should have very little to complain about when it comes to the GAPE environment. After all, as Dave Winer said, GAPE turned Python into the new BASIC!

I'd like to thank Steven Wagner from Gorilla Nation for hosting the meeting, Ben Bangert and Pablo M. for presenting at the meeting, and Andre Stechert for facilitating Ben's presence at the meeting.

1 comment:

Anonymous said...

Hello!!! python-groups.blogspot.com is one of the most outstanding resourceful websites of its kind. I take advantage of reading it every day. All the best.