Re: [Json] JSL: Clarifying purpose, and renaming it to JDDF

John Cowan <cowan@ccil.org> Sun, 01 September 2019 23:14 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 53F611200C5 for <json@ietfa.amsl.com>; Sun, 1 Sep 2019 16:14:45 -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 z5CoEIRAOwsJ for <json@ietfa.amsl.com>; Sun, 1 Sep 2019 16:14:43 -0700 (PDT)
Received: from mail-wm1-x336.google.com (mail-wm1-x336.google.com [IPv6:2a00:1450:4864:20::336]) (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 D21AF120074 for <json@ietf.org>; Sun, 1 Sep 2019 16:14:42 -0700 (PDT)
Received: by mail-wm1-x336.google.com with SMTP id p13so12755620wmh.1 for <json@ietf.org>; Sun, 01 Sep 2019 16:14:42 -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=598G2BABrSf6ZLQlwLt4lZS4gVA/5/bhjHJvvQbWHz0=; b=BCnIn6vyDyKDOzXhHxjXsAosRZAEnz/Pl70WF6d2JgYiDjtUE5hZ478y9xaSYFzOUa rjcdv2Mgx3Ek+N5JKH4FBFViNzOb64kXJEta2Y+RaYtLFnKTFAjuX3nJdqpyVDagJPRg gF7tbQMX1NVqcPn4xTVimGvwhIQ3kP9wchOd5k/7vDCDkw14a7OS4VlRkhYhilNefbx8 SLBphx1dhQh9VQJy7nL4f8GACt8y8xD6l+44zjKKfN7YGe5XeKapG9m43H74+eqBRo0g CbBG08j87DRwUHZs6UitsXrJuCL/PSLqwNiyMCtXExPm8bgUs4qBIL3l/c9QUeBgYvhE FNjg==
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=598G2BABrSf6ZLQlwLt4lZS4gVA/5/bhjHJvvQbWHz0=; b=TbykJbI0k6JnG4B9XSthJfrdgw6VQQOXMghHFwG2L3k1RWMRUc9PacMM4weN9jfVmS mGjA4ul4cKzZ2S9B/jLOw254NRSeRNzAQfkZA8Ca7UnJviTDE62pDpS7Yk2XEeSacwLh XkdfvVBIRy+QL/4bFlnaecndDecpnSRSVEpFYD5gwN0Ofg5nyH2h2CELxaWW3/JTE6PY yDr6DDiVFYtQU7n9OLZbhjuF7y3QfTFEywUC1MRLAuQEIeHCBhyf9zO7ZPLLXQ4xH+hD nZG1AlxO0NaGkGkzMtEtaBLt5R67DfSX1egY+uBgyccSusceX6jlmOsNFFF4E5fQP34i lMsA==
X-Gm-Message-State: APjAAAVon4fTw/2jtbeSEct9f6+T59EvK7nv7R571/fhEkUo2wol6PPf Dcjnq32jICWMl50igaAnzOyByqFty35oJhegiRceAPlqspI=
X-Google-Smtp-Source: APXvYqwvVHnjZiPoCxHtpClQb8OLQvm2YfkLxul8of6A0gx4TO5/3j1dlfnRT7K5+IQAd4Qo+WdN8qeRbnV0ev0uHsg=
X-Received: by 2002:a1c:96c6:: with SMTP id y189mr24642871wmd.160.1567379681343; Sun, 01 Sep 2019 16:14:41 -0700 (PDT)
MIME-Version: 1.0
References: <CAJK=1Rj6zW_MffKvsOiQh28KY5yDeoALGSYqve+vGj52s1Owag@mail.gmail.com> <CAD2gp_Qw2=J8vuimyVAta=cZEos9qmzLd-RsK3czkM5LvFSi7g@mail.gmail.com> <CAJK=1Rh927YqLgqhewT+EOEjtbpFsVvUnE=9cr+ng0+CY-7rSg@mail.gmail.com> <CAD2gp_SS3yvk4TMXAuuhKmjv1wucycOp9MKS+vKwn4tj1oqp0Q@mail.gmail.com> <CAJK=1Riir-7bGODo3rSnTZrh2tvxTR4Kbs56ic0sGfAwZHL7YQ@mail.gmail.com>
In-Reply-To: <CAJK=1Riir-7bGODo3rSnTZrh2tvxTR4Kbs56ic0sGfAwZHL7YQ@mail.gmail.com>
From: John Cowan <cowan@ccil.org>
Date: Sun, 01 Sep 2019 19:14:28 -0400
Message-ID: <CAD2gp_SJ1+CkVtUsctGpLnk35fOrZUHeojv6q_DGv1u_y7cPLQ@mail.gmail.com>
To: Ulysse Carion <ulysse@segment.com>
Cc: JSON WG <json@ietf.org>
Content-Type: multipart/alternative; boundary="000000000000229bab05918605bd"
Archived-At: <https://mailarchive.ietf.org/arch/msg/json/O2LtBZpoQi-oKbzeLVVXT6xNYmw>
Subject: Re: [Json] JSL: Clarifying purpose, and renaming it to JDDF
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: Sun, 01 Sep 2019 23:14:45 -0000

The argument for it is precisely in situations where static allocation is
required along with static typing.  If you know the (maximum) length, you
can safely allocate a fixed amount of memory for your internal
representation, which you cannot do otherwise.   Languages with static
types and garbage collection (allowing dynamic allocation) are just one
particular kind of languages, and I think you need to accommodate all
widely used kinds of languages.  I wouldn't object to skipping bounded
arrays and strings in favor of just fixed-length ones.

See < http://www.catb.org/esr/microjson/>, a JSON-subset parser written in
C that imposes exactly this restriction so that it can run safely on
embedded systems with only small amounts of RAM.


On Sun, Sep 1, 2019 at 7:03 PM Ulysse Carion <ulysse@segment.com> wrote:

> Sure -- but you could use the length validation as a hint to code
> generators, and a warning to data producers that the application will,
> post JDDF-level validation, do additional length checks.
>
> I'm not sure the need for length validation is strong enough to merit
> its inclusion in this version of the spec.
>
> On Sun, Sep 1, 2019 at 3:42 PM John Cowan <cowan@ccil.org> wrote:
> >
> > Section 2.3 says that extensions can't be validation-related, so a
> length limitation would most certainly be a matter of validation.
> >
> > On Sun, Sep 1, 2019 at 6:28 PM Ulysse Carion <ulysse@segment.com> wrote:
> >>
> >> Fixed-length strings and arrays both sound like things one could
> >> implement with extensions, no?
> >>
> >> Tuples are a very sensible suggestion. But I wonder if we can live
> >> without them? I very much want to keep JDDF as small as possible.
>