Re: [Json] A minimal examplotron-style JSON validation language.

John Cowan <cowan@ccil.org> Thu, 30 May 2019 13:08 UTC

Return-Path: <cowan@ccil.org>
X-Original-To: json@ietfa.amsl.com
Delivered-To: json@ietfa.amsl.com
Received: from localhost (localhost [127.0.0.1]) by ietfa.amsl.com (Postfix) with ESMTP id DB3571200F6 for <json@ietfa.amsl.com>; Thu, 30 May 2019 06:08:57 -0700 (PDT)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: -1.898
X-Spam-Level:
X-Spam-Status: No, score=-1.898 tagged_above=-999 required=5 tests=[BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, HTML_MESSAGE=0.001, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, URIBL_BLOCKED=0.001] autolearn=ham autolearn_force=no
Authentication-Results: ietfa.amsl.com (amavisd-new); dkim=pass (2048-bit key) header.d=ccil-org.20150623.gappssmtp.com
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 usAzTznnO3mP for <json@ietfa.amsl.com>; Thu, 30 May 2019 06:08:56 -0700 (PDT)
Received: from mail-ot1-x32e.google.com (mail-ot1-x32e.google.com [IPv6:2607:f8b0:4864:20::32e]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by ietfa.amsl.com (Postfix) with ESMTPS id 049C81200B5 for <json@ietf.org>; Thu, 30 May 2019 06:08:55 -0700 (PDT)
Received: by mail-ot1-x32e.google.com with SMTP id u11so5517444otq.7 for <json@ietf.org>; Thu, 30 May 2019 06:08:55 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ccil-org.20150623.gappssmtp.com; s=20150623; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=sHd9pZ6qB/viA+B2LzkowTVyZULbf24hrit+VJWAldQ=; b=gGInIpivE1Z0hclOSObYUZHnahfNwJTJDJbM3kg94NddjypkUlMOXLU0uv9w2NFN0q lQsze34wxebgNBbtMXh8oGSb6aZDlgjSwm5pScbaF5mbtKFCaYHbqkgAMam/4fUVVNGW rbkRjMrSbaAYU+a2u4GNzFf3rr++qbnn5m/YgLFogO/XvKGpawJW3Obtk/NwNhXzaaJz bfSwjJnuYt8oS1pmil45WYsSrTDq8ghWZa7X8wj9OIiPNSME2mSvk3uB23gEyvUu6FUI rtxT0c2Onht+yJ+KjhhCEFYy9hMmTqDj/90TQpxVpn9sz3XjECin6n3w7YWchQeuxlBb 6fOw==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=sHd9pZ6qB/viA+B2LzkowTVyZULbf24hrit+VJWAldQ=; b=eEspiD6DtpWM0xKQutKKquH9nYHZcyv6Vej02w2ELrUCpFburjmA6mYBcE5xWoW/a0 IAfa1ccbJF4rrbD8zpf55itZ4hNff/jM92d04Z8DkUolyi7JRHvf+FWoKteFkZGdn9kG 5/QcfW1xCUUxSJVee727GjfpgjZ+VZXCzQgMyU1R1pLva8mDyufYqGFJwED1hopPzlgn 6bhO+06WlRB/y3+EQRTTZm2ktSdXTYfVIN1DhuG82+5hqNluF4LWg521QX0BxjBk+xGg eQyF0RNwDHM37Kkps0/jexx8Z/Fp7Ari5LdMzJ+NIPTKwsY2BRJKNV4tuW76sl39OAEb /Yww==
X-Gm-Message-State: APjAAAWOf1Lmr31Wo7tTKVMmrt6TdhdC07pW45FaEzAt7+IVi3F7HHVk r4I5EjdD7uXvI83jeEgdDRd2SVoqoEFjGdZsXEhcDw==
X-Google-Smtp-Source: APXvYqxb+792MoOn27u/2+vfGQqI+91ZDNRz3ZrcliLmRGW21o+1E2DwcsdGgA6VCLJeZI7OpjkH9/SueGeVMEi6dRw=
X-Received: by 2002:a9d:538b:: with SMTP id w11mr2615122otg.154.1559221735241; Thu, 30 May 2019 06:08:55 -0700 (PDT)
MIME-Version: 1.0
References: <8224451C-F21B-41E5-A834-A9005050CB1F@tzi.org> <CAJK=1RjdYD6TZCNrw=H3d9ZLKLxZZOwVCOYYPwfbP+1ETDDz1Q@mail.gmail.com> <11CDA7F6-30BB-40E4-8926-2EDCBCFD785B@tzi.org> <CAHBU6iv8ZsFM5yco5gi+gcyU8d=u3bOSgiKaF6-hv-GARgNh9w@mail.gmail.com> <CAChr6SwNvG4Z7TKUxAVeH7HMVWiPsEBNb12K9zVkjaGt2_v0fw@mail.gmail.com> <CAHBU6ivTD_v7L-wQ+P9TmSfBY=5N+k-caaZ0TZhg6yZ_SWR_aA@mail.gmail.com> <CAChr6SzD8qdETafQKKU41BcYayTWf+C4GENd9FNzy5JYOv5jRQ@mail.gmail.com> <CAHBU6isx5aB94U-vn_t6GGoQ9W+ATDNYR6_+CtXgOhFho5Qh-g@mail.gmail.com> <20190529144005.GC11773@localhost> <CAD2gp_QELt-3=wqA1gRafNim8Y6fsxZ6hcQmTsoOxCSxU8eM1Q@mail.gmail.com> <20190529201716.GD11773@localhost> <DD0F8B7F-3D78-43B0-9A92-9D02FFBDC516@tzi.org>
In-Reply-To: <DD0F8B7F-3D78-43B0-9A92-9D02FFBDC516@tzi.org>
From: John Cowan <cowan@ccil.org>
Date: Thu, 30 May 2019 09:08:44 -0400
Message-ID: <CAD2gp_S4aYTv0j66=Nb3HoLmoJfirVVXLejH_7RhiDBd-oQxYg@mail.gmail.com>
To: Carsten Bormann <cabo@tzi.org>
Cc: Nico Williams <nico@cryptonector.com>, Tim Bray <tbray@textuality.com>, JSON WG <json@ietf.org>, Ulysse Carion <ulysse@segment.com>, Rob Sayre <sayrer@gmail.com>
Content-Type: multipart/alternative; boundary="000000000000a7d6b5058a1a9987"
Archived-At: <https://mailarchive.ietf.org/arch/msg/json/f3H6GuJLS9l_42IPJ4XhSWLlV0A>
Subject: Re: [Json] A minimal examplotron-style JSON validation language.
X-BeenThere: json@ietf.org
X-Mailman-Version: 2.1.29
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: <https://mailarchive.ietf.org/arch/browse/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, 30 May 2019 13:08:58 -0000

On Wed, May 29, 2019 at 5:15 PM Carsten Bormann <cabo@tzi.org> wrote:


> While it is certainly enjoyable to design another language,


I cheerfully admit to that motive.


>  I’m not sure why this should not be done in an ABNF-like syntax

such as CDDL (which, by the way, is in AUTH48 and will soon be RFC 8610).

Keeping your names (even the snake case, where I’d be using kebab case):
>

My effort with this schema language is not to show that it can do something
that other proposals cannot, but that it is the simplest thing that can
possibly
work for both dynamically and statically typed programming languages,
and that everything else can and should be left to higher (inner) layers
that do general-purpose validation.  (Another example: a field that
must be a "dictionary word" in the sense that it appears in a particular
dictionary, whose contents may change over time.  Implementing this
in the schema language will require a database lookup capability oe
perhaps the ability to call a web-services API.)

 Antoine St.-Exupery said: "A designer knows he has achieved perfection
not when there is nothing left to add, but when there is nothing left to
take away."
("Il semble que la perfection soit atteinte non quand il n'y a plus rien à
ajouter,
mais quand il n'y a plus rien à retrancher.")  That's what I'm striving for.
My design has the advantage of being easy to implement in any programming
language, even Fortran.  It is also "obvious", with nothing to debate
except the syntax,
because the answer to "Shall we include this or that feature?" is almost
always "No."

Another amendment:  [] is the type definition of a polymorphic array, as {}
is the
type signature of a polymorphic object.