Re: [Json] Nudging the English-language vs. formalisms discussion forward

Nico Williams <nico@cryptonector.com> Wed, 19 February 2014 23:15 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 201E41A02B9 for <json@ietfa.amsl.com>; Wed, 19 Feb 2014 15:15:15 -0800 (PST)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: -1.378
X-Spam-Level:
X-Spam-Status: No, score=-1.378 tagged_above=-999 required=5 tests=[BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, FM_FORGED_GMAIL=0.622, 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 8BlDprGCMFI2 for <json@ietfa.amsl.com>; Wed, 19 Feb 2014 15:15:13 -0800 (PST)
Received: from homiemail-a109.g.dreamhost.com (caiajhbdcahe.dreamhost.com [208.97.132.74]) by ietfa.amsl.com (Postfix) with ESMTP id 76FD41A0296 for <json@ietf.org>; Wed, 19 Feb 2014 15:15:13 -0800 (PST)
Received: from homiemail-a109.g.dreamhost.com (localhost [127.0.0.1]) by homiemail-a109.g.dreamhost.com (Postfix) with ESMTP id 4F2092005D90E for <json@ietf.org>; Wed, 19 Feb 2014 15:15:10 -0800 (PST)
DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=cryptonector.com; h= mime-version:in-reply-to:references:date:message-id:subject:from :to:cc:content-type; s=cryptonector.com; bh=VwBFM4r/UZ5HuAykRESB FlnH1dw=; b=dP1ar23ExVTKKGbiNbxsTtHnr6wtF63MONOY0Ui0lSkIFURHjp+S up/LwDChqSf3yZPwTs0UPQDoweihWg+VAzHW4aqSabDGwVobgEHEHbMNBn4egG6Y yIvCOYWRo+f471X0ouFxYamOPYhNln3JmmmBXM8UYb0c5PBAIY+Nn6k=
Received: from mail-we0-f178.google.com (mail-we0-f178.google.com [74.125.82.178]) (using TLSv1 with cipher ECDHE-RSA-RC4-SHA (128/128 bits)) (No client certificate requested) (Authenticated sender: nico@cryptonector.com) by homiemail-a109.g.dreamhost.com (Postfix) with ESMTPSA id D3FD72005D909 for <json@ietf.org>; Wed, 19 Feb 2014 15:15:09 -0800 (PST)
Received: by mail-we0-f178.google.com with SMTP id q59so878861wes.23 for <json@ietf.org>; Wed, 19 Feb 2014 15:15:08 -0800 (PST)
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type; bh=V9T+m3LXVi+QxrPY5m/0RgaDeXJsHPmqehgymED/q3c=; b=YZvxBrk3Hio4QpIhdEQWxNW34WDc60TvpEPmcQ4r9e3UMocNzYXdDi+FSMEe4YPdjl JAcgqT/sfyVbq7jtglBiNbS59gQOsK15P84OVW+X27sl5XIQsvyxwY6gvo3llLWQeyPf 7m5w1/a+RixRY+hDXDo097FH9m5qEEM2vOBPlCIw0pXxXkEaZEuDSjBiwSWzG90waA26 kQTAu2wAVv16kDoP8I3e0t7WGVA1HzWRkBZSZJ9RGd7bdORO9yvM7uY0biF8ei8NQ52v VH3IsGTQvu9bdMgKKlrlwq+ahHk+xff+MXcU0S1izPj8qnm85kKW0vPjEqjlmE1ggEZs we3A==
MIME-Version: 1.0
X-Received: by 10.194.104.39 with SMTP id gb7mr4576263wjb.69.1392851708220; Wed, 19 Feb 2014 15:15:08 -0800 (PST)
Received: by 10.217.108.132 with HTTP; Wed, 19 Feb 2014 15:15:08 -0800 (PST)
In-Reply-To: <CAAQiQRfc=cQrs8acaLWP-_9Z8ctNtKKid4G8WswPvk1roxWf4w@mail.gmail.com>
References: <C87F9B96-E028-4F0E-A950-B39D3F68FFE7@vpnc.org> <CAMm+LwhUh_yN-hzaoDWfrO_H2iGvYvj99BCE4EcYmgqCPqXoVQ@mail.gmail.com> <CAHBU6itpttXBfVQGKw=u==k_XSdrht81+m_YDNZP6RM+=9CNow@mail.gmail.com> <CAK3OfOjHkBFOzJSx=bhhoQJ8Z2bWyEXK52dNyYGWVb9FAj99ow@mail.gmail.com> <CAHBU6itzQ0rzU3EUYUqzm2qhx03qk1mpx2sehS_zeiw1ypcEgw@mail.gmail.com> <CAAQiQRfc=cQrs8acaLWP-_9Z8ctNtKKid4G8WswPvk1roxWf4w@mail.gmail.com>
Date: Wed, 19 Feb 2014 17:15:08 -0600
Message-ID: <CAK3OfOiFMWVSzEsqgSicNojBKdLXWQpnw8AadcZhH0ZPoof1mg@mail.gmail.com>
From: Nico Williams <nico@cryptonector.com>
To: Andrew Newton <andy@hxr.us>
Content-Type: text/plain; charset=UTF-8
Archived-At: http://mailarchive.ietf.org/arch/msg/json/Y7JuNkj9Ic5aEleCyVSpRBAXN-c
Cc: Phillip Hallam-Baker <hallam@gmail.com>, Tim Bray <tbray@textuality.com>, Paul Hoffman <paul.hoffman@vpnc.org>, JSON WG <json@ietf.org>
Subject: Re: [Json] Nudging the English-language vs. formalisms discussion forward
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: Wed, 19 Feb 2014 23:15:15 -0000

On Wed, Feb 19, 2014 at 4:23 PM, Andrew Newton <andy@hxr.us> wrote:
> On Wed, Feb 19, 2014 at 12:30 PM, Tim Bray <tbray@textuality.com> wrote:
>> I think clear English prose is *essential*, the one thing a specification
>> must have. Thus, schemas can be actively harmful if arguing over them
>> distracts attention from crafting the prose properly.  This is particularly
>> the case when the schema language is a flawed tool, which so many of them
>> are.
>
> I agree, clear English prose are essential. At the moment, I am
> evaluating two competing security protocols, both open standards
> specified with XML Schema of which one is the product of an IETF
> working group. The IETF standard is much clearer to understand because
> it offers prose on top of the XSD. I cannot help but think that the
> reason the IETF standard stands out is simply because it is an IETF
> standard; along the way to RFC it was reviewed and reviewed and people
> simply would not have let it pass had it been only an XSD. Therefore I
> do not think we need to worry about IETF specifications being harmed
> by schemas.

So you agree that prose is needed (no one here yet disagrees), but you
don't think schemas are harmful because we generally require prose
(which we do) and that's good.  Good!

We do need prose-mostly descriptions of protocols.  We need formal
languages to avoid accidents and to convey concisely and precisely
things that can be difficult to do in prose (in any natural language).
 Prose is needed for semantics -- formal alternatives for that (e.g.,
SDL) so far haven't worked well.

What I want to avoid:

 - TLS-style tool-less inconsistent ad-hoc syntaxes
 - SSHv2-style tool-less inconsistent ad-hoc syntaxes
 - 100% prose-only (e.g., SASL)

I also do not want an ASN.1 where the only way to implement is either
a) spend years building tools first, or b) ad-hoc manual coding based
off a syntax that's full of nuances (since this leads to accidents).

Whatever schema(s) we go with has to be simple enough that ad-hoc
manual coding off of the syntax is less likely to cause accidents than
ad-hoc manual coding off of prose, while also being usable with
automatic tooling.

Since we're talking about JSON we don't need to worry about silly
warts like DER/BER/CER tagging.  No need to mention such nastiness :)

Things I'd consider, and maybe propose:

 - just pattern-matching validation rules (e.g., using the jq or other
similar language that can do pattern matching);

 - a schema with describe-by-example-mostly metaschema, with special
names denoting "types" defined separately, something like:

{
    "message": { "sender": "_sender_type, "receiver":
"_receiver_type", "payload": "_json_string"}
    "sender": { ... },
    ...
}

 - a schema like compact RelaxNG that can be parsed and converted into
one of the above;

or anything else that's relatively simple and from which code can be
generated (or which can be interpreted) to at least do validation (for
testing, not necessarily at run-time in production), and preferably
more (e.g., RPC-like stubs, programming language types, ...).

Nico
--