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

"Pete Cordell" <petejson@codalogic.com> Wed, 19 February 2014 18:04 UTC

Return-Path: <petejson@codalogic.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 3E2AA1A01FB for <json@ietfa.amsl.com>; Wed, 19 Feb 2014 10:04:14 -0800 (PST)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: 3.537
X-Spam-Level: ***
X-Spam-Status: No, score=3.537 tagged_above=-999 required=5 tests=[BAYES_50=0.8, FH_HOST_EQ_D_D_D_D=0.765, HELO_MISMATCH_COM=0.553, RDNS_DYNAMIC=0.982, SPF_HELO_PASS=-0.001, SPF_PASS=-0.001, STOX_REPLY_TYPE=0.439] 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 iAI7hR57lpDO for <json@ietfa.amsl.com>; Wed, 19 Feb 2014 10:04:12 -0800 (PST)
Received: from ppsa-online.com (lvps217-199-162-192.vps.webfusion.co.uk [217.199.162.192]) by ietfa.amsl.com (Postfix) with ESMTP id 4E34F1A04B8 for <json@ietf.org>; Wed, 19 Feb 2014 10:04:12 -0800 (PST)
Received: (qmail 25666 invoked from network); 19 Feb 2014 18:03:27 +0000
Received: from host81-155-177-242.range81-155.btcentralplus.com (HELO codalogic) (81.155.177.242) by lvps217-199-162-217.vps.webfusion.co.uk with ESMTPSA (RC4-MD5 encrypted, authenticated); 19 Feb 2014 18:03:26 +0000
Message-ID: <0581F38DEFEA4660B6A071986B0B235B@codalogic>
From: Pete Cordell <petejson@codalogic.com>
To: Nico Williams <nico@cryptonector.com>, Tim Bray <tbray@textuality.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> <CAK3OfOhfjkbq6eREkt=MBVL1C9ubh-6My3Lvg-mnOxD0+cpN1Q@mail.gmail.com>
X-Unsent: 1
X-Vipre-Scanned: 01BEFCE400680C01BEFE31
Date: Wed, 19 Feb 2014 18:04:08 -0000
MIME-Version: 1.0
Content-Type: text/plain; format="flowed"; charset="iso-8859-1"; reply-type="original"
Content-Transfer-Encoding: 7bit
X-Priority: 3
X-MSMail-Priority: Normal
X-Mailer: Microsoft Outlook Express 6.00.2900.5931
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.6157
Archived-At: http://mailarchive.ietf.org/arch/msg/json/zRLfP7pyVy4GND2KDnHcTB_zrYU
Cc: Phillip Hallam-Baker <hallam@gmail.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 18:04:14 -0000

----- Original Message From: "Nico Williams"

> I really want any JSON schema to be expressed in JSON itself: we all
> have JSON parsers, so at least the first step is done and we won't
> have to worry about how difficult it is to write LALR(1) grammars for
> ASN.1 or whatever.


Personally I think it's more important that the schemas are easier to read 
and write by a human.  Compare:


    int<0..65535>? port;

to:

    [ {
        "name": "port",
        "type": "int",
        "minOccurs": 0,
        "maxOccurs": 1,
        "minInclusive": 0,
        "maxInclusive": 65535
        } ]

Comments are also nice in schema!

An important consideration in designing a schema like the above is to have 
some kind of 'escape' mechanism for extending the definition such as 
attributes and annotations in C# and Java.

Pete Cordell
Codalogic Ltd
C++ tools for C++ programmers, http://codalogic.com
Read & write XML in C++, http://www.xml2cpp.com