[plt-scheme] Implementing web services

From: Anton van Straaten (anton at appsolutions.com)
Date: Fri Aug 10 14:08:27 EDT 2007

Matthias Felleisen wrote:
> On Aug 10, 2007, at 10:49 AM, Noel Welsh wrote:
>> In a REST every URL (entry point / API call) is atomic -- it does one
>> thing and that action finishes as soon as the response is served
> It sounds like REST is an entirely functional concept, just like all  
> batch programming. 

Yes, it's an explicit goal that REST requests be idempotent, for 
example, and violating this is considered bad.  So REST operations are 
supposed to be referentially transparent.

> I doubt its investors understand this but one never knows.

When Tim Berners-Lee designed the original web protocols, he was aiming 
for a system of "distributed hypermedia" documents.  The core of REST 
was implicit in his design, though -- resources named by identifiers 
(URIs), representations of which can be requested across a network.

In that context, "functional" was an obvious benefit: you wanted the 
same identifer to produce the "same" resource (in some sense) every time 
you requested it.  Hence, idempotent requests.

The author of the original paper about REST, Roy Fielding, with the 
benefit of experience and hindsight (in 2000), characterized and defined 
what worked and what didn't work well on the web, and why, and called it 
REST (REpresentational State Transfer).  He was still talking in terms 
of "distributed hypermedia", though.  It's not clear to me to what 
extent he saw this as a basis for a loosely coupled application service 
architecture, which is the context in which REST is most often discussed 
these days.  It's mainly in the latter context that the functional 
aspect of REST starts to become interesting.


Posted on the users mailing list.