Re: [Json] Schema Requirements (Was: Re: Nudging the English-language vs. formalisms discussion forward)

Nico Williams <nico@cryptonector.com> Thu, 20 February 2014 18:38 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 10FB41A0232 for <json@ietfa.amsl.com>; Thu, 20 Feb 2014 10:38:57 -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 aoDPlqv5znGb for <json@ietfa.amsl.com>; Thu, 20 Feb 2014 10:38:55 -0800 (PST)
Received: from homiemail-a30.g.dreamhost.com (caiajhbdccac.dreamhost.com [208.97.132.202]) by ietfa.amsl.com (Postfix) with ESMTP id AEFEC1A019F for <json@ietf.org>; Thu, 20 Feb 2014 10:38:55 -0800 (PST)
Received: from homiemail-a30.g.dreamhost.com (localhost [127.0.0.1]) by homiemail-a30.g.dreamhost.com (Postfix) with ESMTP id D697521DE83 for <json@ietf.org>; Thu, 20 Feb 2014 10:38:38 -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=pB6kMzM0S0twO3e898dS 0Zn7KCM=; b=k0DEQgjSezLrxmlRYHzyC1InHcAU4ntpk33xbXe/KtA/xIG5p0ry wSmaXEawf13WnXLDqhLbbRDT+edFuXo+IKADAxAH7mVUrqOUHibS4gurnRXbeSFw BaOG6YiY0RU3VnctVHlhgkDtP9aXwuCVixRr+CP/2Ftg5l6NnQyteQc=
Received: from mail-pb0-f47.google.com (mail-pb0-f47.google.com [209.85.160.47]) (using TLSv1 with cipher RC4-SHA (128/128 bits)) (No client certificate requested) (Authenticated sender: nico@cryptonector.com) by homiemail-a30.g.dreamhost.com (Postfix) with ESMTPSA id D350521DE71 for <json@ietf.org>; Thu, 20 Feb 2014 10:38:24 -0800 (PST)
Received: by mail-pb0-f47.google.com with SMTP id rp16so2273606pbb.20 for <json@ietf.org>; Thu, 20 Feb 2014 10:38:23 -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=f8vnFPVCYW+fbn1lFDODBaesO+vT+7c4JIJCawpSU54=; b=NVcFayvXXkSL4tiZc86KBIzf4M28QhiUWejskEpwoMmm/Ft35F//wr7vsGjE+3TjjU fHUIALXqZwPzPUK9TKBHtV2iMcUUqbsmbRMl/xfeonbF9gg7kuHWXCsPsMKw/FAII8gv UgTtPyZhfyDbI/nD4HZoVeXtFDCtRyf+/0QmMgWTyOklya+R3kGFR6ihEabSD0/htq1i BoWhftu4DfHCI5IMQ/Vy5xA9uvxS5jCR9fa2YWn9su/NYMtpssKni9axa04oWN7fokmr rBuT0TO4HT9BU3Sw56hGJa8tDu0WwXnsD41fvC92Ls84FdprqOX2MWWPcL+MuUH08yfY cpwg==
MIME-Version: 1.0
X-Received: by 10.68.242.68 with SMTP id wo4mr3980752pbc.32.1392921503461; Thu, 20 Feb 2014 10:38:23 -0800 (PST)
Received: by 10.68.36.164 with HTTP; Thu, 20 Feb 2014 10:38:23 -0800 (PST)
In-Reply-To: <CAMm+LwhTprkCHBhK=xxZrqKLR+b3zE3K71MbZt+gTgAC9OxvBA@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> <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> <357740A8AA0F4316BE630917321FAB4D@codalogic> <B1EBE05A69362F001777F807@cyrus.local> <47BB9131737D42218A6382DEF45BBE2C@codalogic> <CAMm+LwgmHjoLu2=zTOERN8LO74hWpp45yy2epd2JzqDRM9oFfg@mail.gmail.com> <AF211B67DB3D453D9DE8F8FA53886F73@codalogic> <CAMm+LwguTBkGQBHN+e2kU6XxECsic9Kcvda+7X6KDNe0TQxq4w@mail.gmail.com> <FE06CD427A4044B995F57C4926A1C8C2@codalogic> <CAK3OfOiogM36fR9oobh3D61ybsV6ZVbTb+WGjD8OZ71ALey5Qw@mail.gmail.com> <CAMm+LwhTprkCHBhK=xxZrqKLR+b3zE3K71MbZt+gTgAC9OxvBA@mail.gmail.com>
Date: Thu, 20 Feb 2014 12:38:23 -0600
Message-ID: <CAK3OfOidhzkRLRpzThUcfdsZQMOcUm4gyMGGYMaLiG+PLOLZsA@mail.gmail.com>
From: Nico Williams <nico@cryptonector.com>
To: Phillip Hallam-Baker <hallam@gmail.com>
Content-Type: text/plain; charset=UTF-8
Archived-At: http://mailarchive.ietf.org/arch/msg/json/o2TbW4ZW6_yDXHw24e0750L6TBc
Cc: Carsten Bormann <cabo@tzi.org>, Pete Cordell <petejson@codalogic.com>, JSON WG <json@ietf.org>
Subject: Re: [Json] Schema Requirements (Was: Re: 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 18:38:57 -0000

On Thu, Feb 20, 2014 at 12:30 PM, Phillip Hallam-Baker <hallam@gmail.com> wrote:
> On Thu, Feb 20, 2014 at 12:22 PM, Nico Williams <nico@cryptonector.com>
> wrote:
>>  - which grammar parsing algorithms we want to support: LR, LALR(1),
>> LALR(k), GLR, ...
>
> I would hope we make the syntax so simple that we don't need the power of LR
> parsers. They are models of human languages rather than computer languages.

Oops, I meant left recursive, not LR.  Apologies for the thinko.

> Since the target languages are likely to be C#, JS and Java, I suggest that
> we use dot separated tags and array indexes as path extractors.
>
> Given:
>
> {"first" : {"second" : {"third" : [{ "fourth": 1}, { "fourth": 42}, {
> "fourth": 666}]}}}
>
> first.second.third[1].fourth = 42

Sure, where rules need to be expressed, using something XPath-like for
expressing paths would be nice.

>> The metaphor thing gets to, in part, the purpose of the schema:
>>
>>  - documentation for sure, validation no doubt, but, code generation
>> (into C, Java, JS, C#, ...)?  (IMO: yes)
>
> I have code generation for C# and C. I can add Java without difficulty.
>
> It is not clear to me that code generation is necessary or particularly
> useful for scripting languages with late binding like JS. In those
> situations you can just say

For them the important thing may be to have XPath-like facilities.

>> Finally:
>>
>>  - extensibility (meta: to have it or not; if yes, how)
>
> Hopefully formats are enough.

I'm not sure what you mean.

>>  - modularity (meta: to have it or not; if yes, how)
>
> I am adding a Using directive right now. It seems to do the trick.

What about namespacing?

Nico
--