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

John Cowan <cowan@ccil.org> Fri, 31 May 2019 03:54 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 DAFFC120025 for <json@ietfa.amsl.com>; Thu, 30 May 2019 20:54:01 -0700 (PDT)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: -1.899
X-Spam-Level:
X-Spam-Status: No, score=-1.899 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] 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 a8Z1pf77IQvm for <json@ietfa.amsl.com>; Thu, 30 May 2019 20:53:59 -0700 (PDT)
Received: from mail-ot1-x32a.google.com (mail-ot1-x32a.google.com [IPv6:2607:f8b0:4864:20::32a]) (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 B2B00120019 for <json@ietf.org>; Thu, 30 May 2019 20:53:59 -0700 (PDT)
Received: by mail-ot1-x32a.google.com with SMTP id g18so7804437otj.11 for <json@ietf.org>; Thu, 30 May 2019 20:53:59 -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=jOBoe3lLQvRPyorcBCLrgbc/LXMVw/kgZqIP5DDOy/Y=; b=ULImT4y/SDsJ1bpCf14Q2pNJscH3jBwSiQHtcRP4X0/TiSJH2DmfoEmLowXuIuwZJt hguuLx1Ncmcr1sXG9pFK7PWn9Hsk5B1odPE46ElwLY0WI9RGcqyYh75x6Pd6jcuRoU4P jJvoSn3oUZiHXXlkKs31e5yG0EgqBjdvtxaCVwbiHMhOIm8l4pxy3ZOHioDCuGxOtxYp QPEC63/RedAMt00ufx7EoMpp3dSjKXCjjz5DyRauF++NXpVa+tPupqbFIdzD4xKfxPPv gxS3gifAM2LsqnKt+T894ThrLP/jN0rZbZu8bTNHqxbbod+ZhcH33KNO/dmWkVGUarZx 1ubw==
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=jOBoe3lLQvRPyorcBCLrgbc/LXMVw/kgZqIP5DDOy/Y=; b=jBOJY6ALEz8OCIHcEqmOweNhPb4B37S6R8CxBRedldtoUbnqnEuSLmI7i4WwME5+tE nxrrcdfYp359bPXf9wKIjnYKUtSUlWSBy+/WkBk0XayYo6GtpTkzkjIDcG/9Qf8pmfIx Kmjm9O0b4fAA8O43uUKGmrm9a14t3GzdbJSAzTGwQWlJenOAcqBNSn9J7JKOToM94+N3 3hvNbfp/loWzbUm1rXoxhoP84AnFrPvsqTb6ky92axyjaUEWBcod7wFcX9gH2gURcsTf aIwlr39vCfFyB3uNThHu1eGdHAQPpBgAQ4HDbEzPzq7hZGw4p4YCdB+j09BaJkESBQiV sRxw==
X-Gm-Message-State: APjAAAV033nSquk0NI11nDyCsnTKcVXMRovrBjo5WYWm5wG6VekWYUrV OhoH/LZEAwydlOgsPu9+SikXf6JjBnMf+tFXLDtJAw==
X-Google-Smtp-Source: APXvYqxZlGyPKrycdiMzu7rILrBr+wRHcc20ozVBk3YuluOQK3RWOpRc5oHPKR9tzxkjr4js1Viq1dYeegT2ZNwsy5U=
X-Received: by 2002:a9d:5c8d:: with SMTP id a13mr102910oti.327.1559274839002; Thu, 30 May 2019 20:53:59 -0700 (PDT)
MIME-Version: 1.0
References: <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> <CAD2gp_RmOgea63LeVr36=++nkALa34cvqHbMKXqR7HyzEioBcg@mail.gmail.com> <20190530181650.GE11773@localhost>
In-Reply-To: <20190530181650.GE11773@localhost>
From: John Cowan <cowan@ccil.org>
Date: Thu, 30 May 2019 23:53:48 -0400
Message-ID: <CAD2gp_Q2X-JvSYjy+=wU8FDaxAyZ7qGZ5DyU76vJ29T0C_TXtw@mail.gmail.com>
To: Nico Williams <nico@cryptonector.com>
Cc: Tim Bray <tbray@textuality.com>, JSON WG <json@ietf.org>, Carsten Bormann <cabo@tzi.org>, Ulysse Carion <ulysse@segment.com>, Rob Sayre <sayrer@gmail.com>
Content-Type: multipart/alternative; boundary="000000000000e2ea0a058a26f618"
Archived-At: <https://mailarchive.ietf.org/arch/msg/json/KG8igwtYFIaQaMUwb0xqtTYJmkg>
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: Fri, 31 May 2019 03:54:02 -0000

On Thu, May 30, 2019 at 2:28 PM Nico Williams <nico@cryptonector.com> wrote:


> And dynamic typing sucks.
>

I certainly don't think so.  Not that I think static typing sucks either.
Dynamically typed languages are statically typed languages with only one
static type.


> You start with what you need and add new constraints as you discover
> they would be useful.
>

Okay, I'm proposing starting with *no* scalar constraints, only constraints
on the types of array elements and object elements.


> Again, if we have consensus for such a contraint, we should include it,
> and if not, not.


It's needed because essentially all statically typed languages treat ints
and floats as disjoint types.  That's not a good thing, but we are stuck
with it de facto.


> The point about defining types is that you can express recursive
> nesting, which is harder to do with by-example schemas.
>

Without conditional types, there can be no finite recursion.


John Cowan          http://vrici.lojban.org/~cowan        cowan@ccil.org
De plichten van een docent zijn divers, die van het gehoor ook.
      --Edsger Dijkstra