Quick silliness before I get into the real content: lately my posts have been about Python web frameworks, where I usually mention how divided the community around them has become. For those of you who don't know just how "bad" we have it, you may be surprised to learn that it's no exaggeration — here's an incomplete list: Myghty, Bricks, Webware, Django, web.py, Quixote, Aquarium, TurboGears, Subway, SkunkWeb, Spyce, Snakelets, Zope, Twisted, Albatross, jonpy... and those are just the multi-faceted toolkits (not including single components like CherryPy, mod_python, etc.).

Anyway, while reading an "old" post by Ben Bangert about URL mapping schemes (one aspect of Controllers) in various frameworks, I noticed that the discussion turned out to be even more fascinating.

We all know that the term REST was coined back in 2000 by Roy Fielding in his dissertation. But what were people calling it before that? Certainly Fielding didn't invent the concept (however, if you didn't know, he did author the HTTP specification). Well apparently, you can look to Python for the answer!

Phillip J. Eby kicked things off with this great post, which I simply can't put any better, so here it is:

"""If you really want to trace back this style of Controller, you'd most likely find yourself looking at Java code."""

I seriously doubt that. I have in front of me the March/April 1997 issue of “Web Apps Magazine”, which has an outside headline “Publishing Objects Without Using CGI…”

Inside, on page 50, is an article entitled “Using the Python Object Publisher”, by Paul Everitt, whom you may now know as the former president of Zope Corporation, then called Digital Creations. The article described “Bobo”, the great-grandpa of what eventually became Zope.

One of the reasons I still have this magazine is because that article was the reason I’m now a Python developer. At the time I read the article, I seized on the concept as being just what I needed for developing web applications, and so I tried implementing something like Bobo in Perl, and was beset by obstacle after obstacle. Not long after, Python became my language of choice.

At the time, I don’t believe Java had much introspective capability, though I could be wrong. However, the idea that it would have been mature enough at that time for somebody to come up with the idea for Java? Seems pretty darn unlikely to me. Note also that a March ‘97 issue of a magazine would’ve had the articles written months ahead of time, so that means that this type of controller has been out there since 1996, using docstrings instead of ‘expose’ attributes to mark methods suitable for publishing. The article mentions a lot of features that would’ve taken some time to develop, and the package being open source, and used with a variety of back-ends like FastCGI, so it’s likely that development was over a good part of 1996.

The article, by the way, either gives examples of, or explains how to do, pretty much all the styles of dispatch and response that you’ve listed here. If you’re going to give props, they rightfully belong to the Zope Pope, Jim Fulton, who singlehandedly invented this entire breed of dynamic language-based, RESTful web MVC, back before “REST” was even coined as a term, back when version 4 browsers were the latest-and-greatest.

Legend has it, by the way, that Jim was pressed into service to give a talk on CGI at the IPC (International Python Conference), and therefore had to learn CGI on the plane in order to give the talk. He was so horrified by what he learned that he invented a completely different paradigm on the flight back. It’s taken this many years for his radical invention to now be considered mainstream and even “cutting edge”.

Anyway, my point is that the frameworks you mention are similar because it’s a natural design, if you aren’t trapped by the CGI mindset. Jim Fulton just happened to do it first, not by a couple months or years, but by over half a decade ahead of even the oldest of the frameworks you mention.

And I’m only here as a Python programmer because of it. Before I tried duplicating Bobo in Perl, I was (believe it or not) perfectly happy with Perl. But once I saw what Bobo could do, I knew it was the right tool for the job. I never could have dreamed that it would take almost a decade for industry to suddenly “discover” this, and still be lagging behind it. No wonder Zope does so well with people who aren’t programmers; they don’t have as much to unlearn! (I personally hadn’t been doing CGI long when I read the article, not enough to stunt my brain anyway. :)

If I knew then what I knew now, Bobo would’ve had a screencast as soon as I could’ve figured out how to make one. There was no blogosphere and no Google, then, but I’d have found some way to spread the word. Bobo could have been for Python what Rails is to Ruby – the killer app you change languages for. It certainly did the trick for me.

Wow! Although I can't find the article Phillip mentions in Google's cache or on Archive.org, there are some similar pieces still floating around — The Python Object Publisher by the apparently under-credited Jim Fulton, dated August 1996, and Scripting the Web with Python by Python author Guido van Rossum, dated October 1996. If anyone can find the original Web Apps Magazine article, please link to it!

What we can take away from all this history is that the REST-MVC model that is so popular today was actually invented as a result of Jim Fulton's experiences at IPC 5.

Paul Everitt, author of the article Phillip cites, then added more interesting history:

At IPC 3, I gave a CGI tutorial. There were some guys from a company called eShop in the tutorial. One of them was this neat guy named Greg Stein. I showed something called the ILU Requestor (props for this go to Rob Head and Brian Lloyd), which eShop subsequently added to their e-commerce product. A product which subsequently became Microsoft’s SiteServer when eShop was bought. (I wrote a W3C tech note afterwards on the ILU Requestor.) When Jim arrived and immediately produced the idea of transparently traversing and calling Python objects, we immediately dropped the ILU Requestor and became devoteees of “object publishing”.

I remember thinking last year, after all this time, most packages haven’t caught up to what Jim had on his laptop after the plane ride back. So many systems seem more like the “Gateway” in CGI, than systems that adopt the object model of the web. I suppose the rise of dynamic languages in the mainstream has now made this idea more realistic.

In the same thread, Stephan Diehl brings up WebObjects by NeXT, which was released earlier in 1996. Jeff Shell notes that while the goal of WebObjects may have been the same, the implementation was quite different. You can still see this today in the URLs at the Apple Store, which certainly does not adhere to REST.

I don't know about you, but when we all started paying attention to this REST business not long ago, I certainly looked around the proverbial room for technologies we could point at as already being "there." Looks like Bobo (and hence Zope) had been there since 1996!