Tuesday, July 17, 2007

The Return Of Wasp

Wasp
So I was writing to my good friend and fellow developer Paul Jensen about Wasp when I realised that I have a programming blog that is sadly lacking in content. So maybe I should muse on Wasp here.

What is Wasp? It's a web application framework (WAF) that I've been using since about 2000. Gah! I hear you say. Not another WAF! And I sympathise.

In March of 2006 I wrote four articles, ending with this one, examining the existing Python frameworks. There are certainly lots to chose from. So why Wasp?

Well, I tried working with those others. They are far more sophisticated, have been to the best possible schools and hang around the hippest cocktail bars. But I had a hard time getting my head around them. There's so much jargon, inter-dependencies and magical OOP stuff that it makes my head hurt.

Wasp just works and in a way I can comprehend. (I suppose that makes sense, since I wrote it.) In a world of fancy shooters and martinis with vegetables, Wasp is a plain old gin'n'tonic. Or maybe a home-brew beer -- I think I'm losing the metaphor.

Wasp is not popular since I never did much in the way of promotion. It has been used to run a small (but very real) e-commerce site and, back when I was maintaining it, I would get emails asking this or that question. Someone out there was using it. Soon after taking it off the net I had people asking where it had gone.

So maybe Wasp still has a place. Perhaps it still has advantages for newcomers to web development. Looking at it in a new light I like the following attributes:

1. Zero external dependencies. Install one package in a folder somewhere on your path and you are done.

2. It can work as plain CGI. No need for fancy application servers, compilation steps or other mechanisms. This means you can set it up quickly with just about every web hosting company in existence.

3. It can work from the command line. Process a bunch of templates into static HTML you can throw anywhere you like.

4. It doesn't try to reinvent web files as classes. URLs retain their traditional interpretation as file locations. There's no super-OOPy "one thing really means another" stuff going on.

5. Since your web files are still files it's easy to integrate with designers and their tools. Ever try to get a web designer to write a subclass of a page or a regular expression to parse an URL? Didn't think so.

6. Has a simple templating mechanism that can be described in one page.

7. Easy to plug in your own code.

8. Emphasises a proper division of markup for display purposes, code for back-end processing.

9. Has no database dependencies.

10. Comes with session and cookie management that works.

Now, to be fair, here are the main disadvantages:

1. Written by one guy: me. No support team or corporate hand-holding.

2. Not WSGI compliant. Doesn't know from middleware. Not designed to be used with other web packages in a turnkey way. (Though of course any Python module can be imported as usual.)

3. Did I mention the templating is very simple? Maybe too simple for some.

4. Uses custom modules for some things that didn't exist in the Python standard library back in 2000 (cookies, dates, logging).

5. Not replete with unit tests and other aspects of correctness.

So, yes, I think Wasp is a good thing. I've decided to use it for my own projects and will make it available for others once again (as free open source, naturally). But not before I have it good and ready.

In my next article I'll discuss what I've decided to do to update Wasp for the year 2007.

Update 2007.07.26: So as not to draw any further flack, I've changed the word "meaning" to "traditional interpretation" in point 4.

RELATED POSTS

5 comments:

Hamish said...

RFC1630 "Universal Resource Identifiers in WWW" explicitly states: "The similarity to unix and other disk operating system filename conventions should be taken as purely coincidental, and should not be taken to indicate that URIs should be interpreted as file names."

EY said...

Sounds promising. I occasionally have smaller web projects that don't need the features of larger web frameworks so this could definitely fill a niche.

robin said...

@Cristian -- Thanks for that! Even if a handful of people have found Wasp useful it was well worth the effort in sharing the code.

JohnMc said...

So Robin when do you project WASP 2.0 being released?

robin said...

@john mc: My "free time" -- that is, time I spend on free projects -- has largely been spent on artistic endeavors in the last six months. My web development time has been focused on client work. So I have made little progress on Wasp. Even getting what I have cleaned up for release might take me a month of work, with no way to fund that month. A bit of a dilemma.

Post a Comment