[Json] LF and RS are equivalent (Re: The text in draft-ietf-json-text-sequence)

Nico Williams <nico@cryptonector.com> Tue, 15 July 2014 06:21 UTC

Return-Path: <nico@cryptonector.com>
X-Original-To: json@ietfa.amsl.com
Delivered-To: json@ietfa.amsl.com
Received: from localhost (ietfa.amsl.com [127.0.0.1]) by ietfa.amsl.com (Postfix) with ESMTP id 4369B1A0178 for <json@ietfa.amsl.com>; Mon, 14 Jul 2014 23:21:09 -0700 (PDT)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: -1.666
X-Spam-Level:
X-Spam-Status: No, score=-1.666 tagged_above=-999 required=5 tests=[BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, IP_NOT_FRIENDLY=0.334, RCVD_IN_DNSWL_NONE=-0.0001] autolearn=no
Received: from mail.ietf.org ([4.31.198.44]) by localhost (ietfa.amsl.com [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id vNDrgNvudwnL for <json@ietfa.amsl.com>; Mon, 14 Jul 2014 23:21:08 -0700 (PDT)
Received: from homiemail-a106.g.dreamhost.com (sub4.mail.dreamhost.com [69.163.253.135]) by ietfa.amsl.com (Postfix) with ESMTP id 0281C1B281C for <json@ietf.org>; Mon, 14 Jul 2014 23:21:08 -0700 (PDT)
Received: from homiemail-a106.g.dreamhost.com (localhost [127.0.0.1]) by homiemail-a106.g.dreamhost.com (Postfix) with ESMTP id CD44120047B69; Mon, 14 Jul 2014 23:21:07 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=cryptonector.com; h=date :from:to:cc:subject:message-id:references:mime-version :content-type:in-reply-to; s=cryptonector.com; bh=loJRiAFFEdC6Bo 83x68Nvm1HdOs=; b=k81dkrSq7wPgQ2bZRBp6k0f16zi8yZlGF46Du6pIMBUuLC 0bK5jtMNIFLWOAFVTy6RKqXs1v8kDVu4U46BnsYdfIhbKa3iTXaUo4nZYkyU1rRb yOFQng1JPhkDHZqsHTPIFzqx17L6byf9rdoA8YhgaTAgSvUruTQHo4QWvZYk0=
Received: from localhost (108-207-244-174.lightspeed.austtx.sbcglobal.net [108.207.244.174]) (Authenticated sender: nico@cryptonector.com) by homiemail-a106.g.dreamhost.com (Postfix) with ESMTPA id 7BD5520047B64; Mon, 14 Jul 2014 23:21:07 -0700 (PDT)
Date: Tue, 15 Jul 2014 01:20:51 -0500
From: Nico Williams <nico@cryptonector.com>
To: Tim Bray <tbray@textuality.com>
Message-ID: <20140715062050.GA2256@localhost>
References: <FD9026FF-BDC5-451C-ABBC-0608AB63B819@vpnc.org> <CAHBU6ivRDxGCBC3=8Z1UkAAF4G9r1S3u-f7QfNGJfkT1L3fa=A@mail.gmail.com>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Disposition: inline
In-Reply-To: <CAHBU6ivRDxGCBC3=8Z1UkAAF4G9r1S3u-f7QfNGJfkT1L3fa=A@mail.gmail.com>
User-Agent: Mutt/1.5.21 (2010-09-15)
Archived-At: http://mailarchive.ietf.org/arch/msg/json/f9mLnFGg918jsE3wbu1Cr0KrZ0U
Cc: Paul Hoffman <paul.hoffman@vpnc.org>, IETF JSON WG <json@ietf.org>
Subject: [Json] LF and RS are equivalent (Re: The text in draft-ietf-json-text-sequence)
X-BeenThere: json@ietf.org
X-Mailman-Version: 2.1.15
Precedence: list
List-Id: "JavaScript Object Notation \(JSON\) WG mailing list" <json.ietf.org>
List-Unsubscribe: <https://www.ietf.org/mailman/options/json>, <mailto:json-request@ietf.org?subject=unsubscribe>
List-Archive: <http://www.ietf.org/mail-archive/web/json/>
List-Post: <mailto:json@ietf.org>
List-Help: <mailto:json-request@ietf.org?subject=help>
List-Subscribe: <https://www.ietf.org/mailman/listinfo/json>, <mailto:json-request@ietf.org?subject=subscribe>
X-List-Received-Date: Tue, 15 Jul 2014 06:21:09 -0000

On Mon, Jul 07, 2014 at 04:30:19PM -0700, Tim Bray wrote:
> On Mon, Jul 7, 2014 at 1:57 PM, Paul Hoffman <paul.hoffman@vpnc.org> wrote:
> 
> >
> > - Do you feel that the protocol will be significantly broken if it uses LF
> > as the text separator?
> >
> 
> Yes

Not at all.  Consider:

 - a logger has to check that the input doesn't contain any RS, if we go
   with RS, therefore checking for and replacing LFs with SP is no more
   burdensome: it costs a few more writes to memory in the infrequent case;

 - replacing LFs (unescaped LFs; remember that LFs in strings MUST
   always be escaped) with SP is a valid transformation that does not
   change the content nor meaning of a JSON text

Therefore, LF and RS are equivalent in terms of: work for the
implementor, and run-time burden.  Also: in terms of what happens if a
logger doesn't check (or transform) the texts it logs to make sure they
don't contain the text separator.

Nico
--