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

Tim Bray <tbray@textuality.com> Thu, 20 February 2014 00:24 UTC

Return-Path: <tbray@textuality.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 A64CD1A0538 for <json@ietfa.amsl.com>; Wed, 19 Feb 2014 16:24:57 -0800 (PST)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: -1.977
X-Spam-Level:
X-Spam-Status: No, score=-1.977 tagged_above=-999 required=5 tests=[BAYES_00=-1.9, FM_FORGED_GMAIL=0.622, HTML_MESSAGE=0.001, RCVD_IN_DNSWL_LOW=-0.7] autolearn=ham
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 y1FJVM0fqGos for <json@ietfa.amsl.com>; Wed, 19 Feb 2014 16:24:55 -0800 (PST)
Received: from mail-vc0-f180.google.com (mail-vc0-f180.google.com [209.85.220.180]) by ietfa.amsl.com (Postfix) with ESMTP id 08A6D1A0467 for <json@ietf.org>; Wed, 19 Feb 2014 16:24:54 -0800 (PST)
Received: by mail-vc0-f180.google.com with SMTP id ks9so1190699vcb.39 for <json@ietf.org>; Wed, 19 Feb 2014 16:24:51 -0800 (PST)
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:in-reply-to:references:date :message-id:subject:from:to:cc:content-type; bh=S5TkTdJMEe4R7ErHcO5f/GK4nsJK9uWLByEi6q0Lzag=; b=hZlXJjgGxHCiPgE720+Jl/d/m1Ejd1RkSRDoOyDyqMxdGcN2Ru1ow2ycTXgMIaJTMA CBYmneVBeGnh21aG2Z+amam8vpfRo7tqubNka3XI2EJMkMbg7J+XAv2RmOJfln00JPv0 SLp5NUJC9t4w3T3l27uB+CFT+D9/eP88LZoCbJUkKVudu3O8q5s2oRAKXYfNlocwvIAq 30vUj7e/9A2/SlzpIGKAkWWQ/2LwnzLM71kBcgOwVT3d+xm0dftU0lOxqrjwRzW1K2TV Ej76C1cMv7kDo21DOf+fPK8XOce/O2C3Du5AEYeKGVml4gob7oM+0FEnh98wZ7Y8VIlX ondw==
X-Gm-Message-State: ALoCoQn1pQRZ1S5MzDA7XKiwg3Fq6lU88zQa4a2M+iOyxm9lE9fW6TVj/wKrnk+HoLvbhq1Frgha
MIME-Version: 1.0
X-Received: by 10.52.63.233 with SMTP id j9mr1914495vds.69.1392855891403; Wed, 19 Feb 2014 16:24:51 -0800 (PST)
Received: by 10.220.98.73 with HTTP; Wed, 19 Feb 2014 16:24:51 -0800 (PST)
X-Originating-IP: [96.49.81.176]
In-Reply-To: <255B9BB34FB7D647A506DC292726F6E1153B778363@WSMSG3153V.srv.dir.telstra.com>
References: <CAHBU6itzQ0rzU3EUYUqzm2qhx03qk1mpx2sehS_zeiw1ypcEgw@mail.gmail.com> <CAK3OfOhfjkbq6eREkt=MBVL1C9ubh-6My3Lvg-mnOxD0+cpN1Q@mail.gmail.com> <CAHBU6isZbew8O1HJ+XcFsMCR42iDoO_uemPXVwa3=vM5A=MngA@mail.gmail.com> <CAK3OfOgmVsNJqrqCfsD7h37axssOoaX3DGHqO=bTn5bWrA+MFA@mail.gmail.com> <A4B53816-6FBF-4A37-8BC9-F0A9D0867BCD@tzi.org> <CAC4RtVDLQ3q5KxG+jDYfDB09JZUOBcojTR3ebxhr1QUOXLeEvA@mail.gmail.com> <CAMm+LwiCHt2NLW8AV93Tzh=hUXGT7SWM8W5zXSehmBF+nEMCkw@mail.gmail.com> <rvcag9tv4cn6jioncd1rmmc19gcm59l6e9@hive.bjoern.hoehrmann.de> <CAK3OfOgOghu_4jxHuoDSnHbyJJRu=xa_YBmgO92CMspMQApceg@mail.gmail.com> <255B9BB34FB7D647A506DC292726F6E1153B778363@WSMSG3153V.srv.dir.telstra.com>
Date: Wed, 19 Feb 2014 16:24:51 -0800
Message-ID: <CAHBU6is7iH3CQE4uH55iszCAQ1afDrX8MYVXkJY8cJJ96P+wBA@mail.gmail.com>
From: Tim Bray <tbray@textuality.com>
To: "Manger, James" <James.H.Manger@team.telstra.com>
Content-Type: multipart/alternative; boundary=001a11369b04a17fc304f2cb8828
Archived-At: http://mailarchive.ietf.org/arch/msg/json/0QPQ-9hCrqUtcO0vNYjqHuaKkDQ
Cc: 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: Thu, 20 Feb 2014 00:24:57 -0000

Hm, obvious when you think about it, since JSON’s roots are in JavaScript
and JSON docs are parseable as such, a bagful of JS assertions (yeah, I
know JS doesn’t have an “assert” primitive, but still) could be a
not-terrible stand-in for a schema. Sort of Schematron-like.


On Wed, Feb 19, 2014 at 4:18 PM, Manger, James <
James.H.Manger@team.telstra.com> wrote:

> One more example of an existing practice for describing JSON values
> appears in recent draft specs from the FIDO Alliance <
> http://fidoalliance.org/specifications/download>gt;. It seems to be based on
> Web IDL with ECMAScript bindings <
> http://www.w3.org/TR/WebIDL/#ecmascript-binding>gt;.  The following example
> comes from fido-uaf-protocol-v1.0-rd-20140209.pdf:
>
> dictionary Version {
>   int mj; // Mandatory.
>   int mn; // Mandatory.
> }
>
> dictionary OperationHeader {
>   Version upv; // Mandatory.
>   DOMString op; // Mandatory. Must be “Reg”, “Auth” or “Dereg”
>   DOMString appID; // Mandatory. string[1..512].
>   DOMString serverData; // Optional, string[1..1536]
>   Extension[] exts; // Optional.
> }
>
> dictionary Extension {
>   DOMString id; // Mandatory. string[1..32].
>   DOMString data; // Mandatory. base64url(byte[1..8192]).
>   boolean fail_if_unknown;// Mandatory.
> }
>
>
> I don’t particularly like it; it doesn’t feel like JSON (eg "dictionary"
> vs "object"); constraints are all in comments; and IDL is aimed at APIs as
> opposed to protocol messages. But it sort-of works: it is fairly easy to
> guess what the JSON has to look like.
>
> --
> James Manger
> _______________________________________________
> json mailing list
> json@ietf.org
> https://www.ietf.org/mailman/listinfo/json
>