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

John Cowan <cowan@ccil.org> Sun, 01 September 2019 23:38 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 7A650120074 for <json@ietfa.amsl.com>; Sun, 1 Sep 2019 16:38:49 -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 coJrW01nKInC for <json@ietfa.amsl.com>; Sun, 1 Sep 2019 16:38:47 -0700 (PDT)
Received: from mail-wr1-x436.google.com (mail-wr1-x436.google.com [IPv6:2a00:1450:4864:20::436]) (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 B5A051200BA for <json@ietf.org>; Sun, 1 Sep 2019 16:38:46 -0700 (PDT)
Received: by mail-wr1-x436.google.com with SMTP id c3so12138740wrd.7 for <json@ietf.org>; Sun, 01 Sep 2019 16:38:46 -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=JAvvJBFF3Zteu/G64IsMi4+GfUWLWXeYFoYB2ihzU0g=; b=Ntp8A9k529aECE2VhnIgNa1W0gpu6dldirp4+HbAz2yAsci0H8Vmt2ATUg+r/HLD8w QXb5W8Pnq1Ccuf2iotFADB6HYtCkejQLMo/pODxWCfHytjurh1ag30Yqli0xg2keyJ9K UziNq4Fy8/ZBrdepIRJRLN2EQstI+VvSN8/MYqFdCEiHUhoX3LO6AziWER15S/h9sYwq hUa5XfSnWRbjerhYBKnqtLyjd5S4cucSN6BiQ9/CfQxJpKRVN0WMMV1E6dI/uusUA952 dqXgCfyDWQdWTLeXFlOWk5Ak4twNpSBGAis9+0b9QJUpGe9mlRsBK5DK/df1zTIrHc1X /bzA==
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=JAvvJBFF3Zteu/G64IsMi4+GfUWLWXeYFoYB2ihzU0g=; b=hWOwzgn/8aB271XTo5LOU5WiW/oTLzRSRvd8vh4hj8oq4kwmUtbSLIuv0iZG1Wq+0Q SAwc/zO8KTK4T4cwKp1dvAkR9zZ+O+OJLKEjB439/pH6l2YDvwLu6h0gxP0l03IlSnfg tX2ELRzbdE/c/yM9GiRMywiBtBUwAV5Rw2uNn7iUE2PPa4hmOdKa7chOcPJ/dtw/H2SP mlAF/H2oSpDguj/MJlaEM5QTmnUR79QedSDEMY+FEXWLCzmptd+mDu9t/X/dcjVFfzzh buVnrab4/3mzM3uZvCV7k/ErGJpYMUN5dSQt3nXCwnAZwswobUOUP3Y1i/lM10f68Kiv R8Yg==
X-Gm-Message-State: APjAAAVEJ7KvlaipSxg7aMw+UtgSWi81xz3V3pcHvgTAkPNoOJ/IO9qa KaCcqGAYuAzWAPpakP0QiO0576nYTVG6lgS+GTEcDcbI
X-Google-Smtp-Source: APXvYqwGBwy5UYuSdV47Y9+ItiVkeRGDTkW/SeyfZjFeI8ECfpdxGIL3uVdD2YaHQmUPbuEaG29KztEcSedBEv1bm+0=
X-Received: by 2002:a5d:678d:: with SMTP id v13mr24218130wru.133.1567381125231; Sun, 01 Sep 2019 16:38:45 -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> <CAD2gp_SJ1+CkVtUsctGpLnk35fOrZUHeojv6q_DGv1u_y7cPLQ@mail.gmail.com> <CAJK=1RgQwmM=BN=irvc0tuq=oE9HByAyh5uCE=+Dgg--ksxv0g@mail.gmail.com>
In-Reply-To: <CAJK=1RgQwmM=BN=irvc0tuq=oE9HByAyh5uCE=+Dgg--ksxv0g@mail.gmail.com>
From: John Cowan <cowan@ccil.org>
Date: Sun, 01 Sep 2019 19:38:33 -0400
Message-ID: <CAD2gp_SZHKJ5_kfsvyQ30NvPorG=ufdqtR38odjQcGWa0M6+9Q@mail.gmail.com>
To: Ulysse Carion <ulysse@segment.com>
Cc: JSON WG <json@ietf.org>
Content-Type: multipart/alternative; boundary="000000000000328d180591865b52"
Archived-At: <https://mailarchive.ietf.org/arch/msg/json/v3GbyxsAc6_W2Jf8Pkv2--aYf8U>
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:38:50 -0000

I agree that that is somewhat arbitrary, but I'd say the length of a string
is its length in bytes in UTF-8 encoding, given that UTF-8 is the standard
encoding of JSON.

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

> How is such a thing supposed to work portably? What is the "length" of
> a JSON string, and does this have any correspondence to the memory
> representation of that string, post-parsing?
>
> On Sun, Sep 1, 2019 at 4:14 PM John Cowan <cowan@ccil.org> wrote:
> >
> > 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.
>