I wasn't trying to claim WSGI is the first web server to application server interface. I was just showing Rack and WSGI are similar, and Rack was WSGI inspired.
Yes, but IMHO servlets got it all wrong, and WSGI took very little from servlets (though for instance Webware, a pre-WSGI framework did use the servlet model). But it owes much to the superior CGI model; replace processes with function calls and structure the response lightly and you have WSGI.
Ianb, may I inquire as to what is the difference you mean between servlets and cgi. A cgi written in perl for example, was essentially a perl servlet, I think. How is the CGI model fundamentally different from a servlet model, where your application code is given a request as a parameter to a function, and must return a response?
> How is the CGI model fundamentally different from a servlet model,
Since both are web server to application server interfaces, they aren't fundamentally different - the difference is cgi was language independent and hence defined for the common minimum. cgi couldn't have been defined in request and response objects - it would have caused trouble for languages which doesn't have objects.
> where your application code is given a request as a parameter to a function, and must return a response?
cgi is not given a request parameter - the request parameters are passed in the environment. And cgi doesn't return a response object - whatever it writes to stdout constitutes the response. cgi had to cater to all sorts of implementation - assuming request/response objects wasn't a possibility.
Servlets and cgi aren't fundamentally different, but I guess we can agree they are sufficiently different.
To add/agree: I think the biggest difference is that CGI dealt in data, and did not have objects/APIs/etc. In many ways it would have been reasonable to skip even that, and pass an HTTP request in on stdin, and get an HTTP response on stdout, with just some minimal sanitizing promises; but I don't think I've ever seen that approach. Coincidence of history I suppose. Anyway, WSGI also carefully avoided any objects, only using standard data structures (dicts/hashes, strings, ints, ordered-associative-arrays, and iterable response). The result is a functional API without an opinions.