The New, New Web API

It seems like not only SOAP is dying, but POX is definitely falling out of favor, if not exactly dying.  Niall pointed out the new del.ico.us API this morning, and yesterday, there was the announcement that Google has deprecated its search API in favor of widgets.  The two aren't exactly the same thing, but the essential thing they share is that they assume that the client has a Javascript interpreter available.  There's more to the Google move than that - they aren't exactly trading an API for anoth API - but I believe that the trend towards Javascript as a data transfer syntax is real.

I don't agree with James here.  I'm sure James would enjoy a format that involved passing Smalltalk syntax on the wire.  JSON is an absolutely wonderful transfer format, assuming you have a Javascript interpreter available to you.  JSON did what XML never did - it turned an executable syntax into a data exchange syntax.  Schemes and Lisps could at least dream of executable XM.  SSAX actually brought that very close to a reality. 

I have mixed feelings overall about the trend.  I have quite a bit invested in SOAP and POX, and James' point is certainly valid - now you need to understand at least rudimentary Javascript to play with these APIs.  Still, the Lisper in me thinks that the idea of code as data has a lot of appeal.  It's absolutely true - you could have done JSON as XML, and in fact, a translation would be straightforward.  The problem is that if you'd waited for it to happen with XML, you'd still be waiting.  While JSON was being hammered out over the last couple of years, the XML crowd was arguing about XML-RPC vs. SOAP vs. Document/Literal SOAP, XML-Schema vs. RELAX-NG vs. Schematron, RSS vs. Atom vs. RDF.  It almost had to happen.

— Gordon Weakliem at permanent link