15 Jan 2002 jmason   » (Master)

I just posted this on taint.org, but it's the kind of thing I usually post to this Advo diary instead (since it deals with code and free software). So I'll post it here too ;)

<bigwig> is a really interesting new design for web services. A month or 2 ago, I was thinking about web app languages, like perl/CGI, PHP, servlets, HTML::Mason, etc., and I realised that the big problem was the requirement imposed by the web environment itself; most "interesting" operations often have a UI that needs to take place over several pages, and each page has to

  • unmarshal the user's CGI params, decode them, check them for insecurity, validity etc.;
  • open the database;
  • perform actions;
  • fill out the HTML template (I'm assuming nobody's insane enough to still use embedded HTML-in-code!);
  • insert "next step" form data in that template;
  • send that back to the user;
  • save a little state to the database;
  • then exit, and forget all in-memory state.

When compared to most interactive programs now, it's clear that this is a totally different, and much more laborious, way to write code. The nearest thing in trad apps is the "callback" way to deal with non-blocking I/O, ie. what we used before we could (a) use threads (b) use processes or (c) wrap it up in a more friendly library to do that. It just screams complexity.

<bigwig> fixes that:

Rather than producing a single HTML page and then terminating as CGI scripts or Servlets, each session thread may involve multiple client interactions while maintaining data that is local to that thread.

They call it The Session-Centered Approach.

It gets better. They also include built-in support for input validation, HTML output validation, compilation and compile-time code checking, and it's GPLed free software. This is really good stuff. Next time I have to write a web app, I'll be using this.

Found via sweetcode.

Latest blog entries     Older blog entries

New Advogato Features

New HTML Parser: The long-awaited libxml2 based HTML parser code is live. It needs further work but already handles most markup better than the original parser.

Keep up with the latest Advogato features by reading the Advogato status blog.

If you're a C programmer with some spare time, take a look at the mod_virgule project page and help us with one of the tasks on the ToDo list!