Re: [hybi] Is there a traffic jam?

Jamie Lokier <jamie@shareable.org> Tue, 14 April 2009 14:42 UTC

Return-Path: <jamie@shareable.org>
X-Original-To: hybi@core3.amsl.com
Delivered-To: hybi@core3.amsl.com
Received: from localhost (localhost [127.0.0.1]) by core3.amsl.com (Postfix) with ESMTP id 1AE5928C14B for <hybi@core3.amsl.com>; Tue, 14 Apr 2009 07:42:55 -0700 (PDT)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: -4.137
X-Spam-Level:
X-Spam-Status: No, score=-4.137 tagged_above=-999 required=5 tests=[AWL=-1.538, BAYES_00=-2.599]
Received: from mail.ietf.org ([64.170.98.32]) by localhost (core3.amsl.com [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id wNjN57tPCvR7 for <hybi@core3.amsl.com>; Tue, 14 Apr 2009 07:42:54 -0700 (PDT)
Received: from mail2.shareable.org (mail2.shareable.org [80.68.89.115]) by core3.amsl.com (Postfix) with ESMTP id 19A8328C143 for <hybi@ietf.org>; Tue, 14 Apr 2009 07:42:54 -0700 (PDT)
Received: from jamie by mail2.shareable.org with local (Exim 4.63) (envelope-from <jamie@shareable.org>) id 1Ltjrm-0007JP-GN; Tue, 14 Apr 2009 15:44:02 +0100
Date: Tue, 14 Apr 2009 15:44:02 +0100
From: Jamie Lokier <jamie@shareable.org>
To: Ian Hickson <ian@hixie.ch>
Message-ID: <20090414144402.GB26621@shareable.org>
References: <03BCE29D-7AA5-4128-9F61-446E0229479A@lindenlab.com> <E51D5B15BFDEFD448F90BDD17D41CFF105A0C46E@AHQEX1.andrew.com> <Pine.LNX.4.62.0904132352430.10339@hixie.dreamhostps.com> <E51D5B15BFDEFD448F90BDD17D41CFF105A0C476@AHQEX1.andrew.com> <Pine.LNX.4.62.0904140002360.10339@hixie.dreamhostps.com> <1cb725390904131712k292a4860pbd078bb251d3855b@mail.gmail.com> <Pine.LNX.4.62.0904140031040.10339@hixie.dreamhostps.com> <1cb725390904131752u5842c039wb3d75602c479fa45@mail.gmail.com> <Pine.LNX.4.62.0904140053050.10339@hixie.dreamhostps.com>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Disposition: inline
In-Reply-To: <Pine.LNX.4.62.0904140053050.10339@hixie.dreamhostps.com>
User-Agent: Mutt/1.5.13 (2006-08-11)
Cc: hybi@ietf.org
Subject: Re: [hybi] Is there a traffic jam?
X-BeenThere: hybi@ietf.org
X-Mailman-Version: 2.1.9
Precedence: list
List-Id: Server-Initiated HTTP <hybi.ietf.org>
List-Unsubscribe: <https://www.ietf.org/mailman/listinfo/hybi>, <mailto:hybi-request@ietf.org?subject=unsubscribe>
List-Archive: <http://www.ietf.org/mail-archive/web/hybi>
List-Post: <mailto:hybi@ietf.org>
List-Help: <mailto:hybi-request@ietf.org?subject=help>
List-Subscribe: <https://www.ietf.org/mailman/listinfo/hybi>, <mailto:hybi-request@ietf.org?subject=subscribe>
X-List-Received-Date: Tue, 14 Apr 2009 14:42:55 -0000

Ian Hickson wrote:
> I agree. But who mentioned scalable TCP servers for binary protocols? I 
> want to let people like my dad write little scripts that do insignificant 
> little things, just like today people write CGI scripts for all kinds of 
> stuff. I want to let 12 year olds write multiplayer games. I want to let 
> someone who picked up HTML on Monday and CSS on Wednesday try their hand 
> at WebSockets on Friday. I want to support the intern whose boss told him 
> to put one of those interactive chat widgets on the intranet.
> 
> > This is likely to require multi-threading in most languages.
> 
> It's easy to write simple TCP servers using a select() loop without 
> threads.

It's easy to write a simple HTTP server using a select() loop too, if
you know unix, or Perl, or Python.  There are lots of bad ones around
to prove it.  It's even easier with fork().

But mostly people use big HTTP servers written by other people and hang
applications off the back now, using CGI/FastCGI/WSGI/mod_*/ etc.

I expect your dad / 12 year old / person who picks up HTML on Monday
will use Apache or similar with a CGI or similar backend to their
favoured programming language.

They probably don't care much about HTTP, just that it calls their
application when a page is requested.  And they probably don't know
anything about unix system calls.

So on Friday they'd rather use Apache with a "hybi-CGI" backend to
their favoured programming language, than write their own select() loop.

The important thing for that scenario is that "hybi-CGI" must be easy
to understand and use.  Whether that's because it's so trivial anyone
can write TCP/WebSockets in good programming languages, or because the
protocol fits into widely used CGI-like frameworks in a way people
understand.

Right now, AJAX is widely used, and polling-AJAX is widely used for
server-driven updates to web pages because people find it easy to
understand, and it's easy to use existing frameworks - just another
tiny web page (fragment) to serve.

Indeed a lot of people think polling-AJAX is the most efficient way to
keep bits of a web page updated.  From a CGI-writing point of view,
that's true.  (From my point of view it's obviously false.)

For those people (imho the majority), what's most important is that
their preferred CGI-like framework supports the new protocols and
doesn't change the way they program too much.

Of course we'd like to support people who are happy writing their own
low-level server implementations too, and work well in that case.

> To reiterate: I have no objection to there being many protocols 
> standardised here. But I do want to make sure that at least one of them 
> enables an inexperienced programmer to bang out an interactive toy in a 
> few days without having to use libraries, just like they can bang out a 
> CGI script today and get interaction in forms. Currently, of the various 
> proposals, only one of them comes even close to this, IMHO.

Which one?

(I've designed my flavour of asynchronous HTTP to fit banging out
extended-CGI/etc. services like a glove, while also addressing
TCP-style streaming/messaging services.  I think WebSockets (without
metadata) does not fit the CGI-style usage as well, but it's
interesting to see the perspectives and differing requirements being
expressed.)

-- Jamie