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

Ulysse Carion <ulysse@segment.com> Sun, 01 September 2019 23:24 UTC

Return-Path: <ulysse@segment.com>
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 45EF01200BA for <json@ietfa.amsl.com>; Sun, 1 Sep 2019 16:24:38 -0700 (PDT)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: -1.999
X-Spam-Level:
X-Spam-Status: No, score=-1.999 tagged_above=-999 required=5 tests=[BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, 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 (1024-bit key) header.d=segment.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 ZMwj6Oi1nRXx for <json@ietfa.amsl.com>; Sun, 1 Sep 2019 16:24:35 -0700 (PDT)
Received: from mail-io1-xd2e.google.com (mail-io1-xd2e.google.com [IPv6:2607:f8b0:4864:20::d2e]) (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 D55F5120074 for <json@ietf.org>; Sun, 1 Sep 2019 16:24:35 -0700 (PDT)
Received: by mail-io1-xd2e.google.com with SMTP id r4so10466584iop.4 for <json@ietf.org>; Sun, 01 Sep 2019 16:24:35 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=segment.com; s=google; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc:content-transfer-encoding; bh=0be5OsPz6HRQK44CDE2qvZkfnp/zSf6C8XZihCbs3jQ=; b=lq6tOJsqIgYHryzTS3cetHilnXlEwV7xnog3uaGBorx9zUI6YzHQUyaprWej80OB+Y H7izokYY76oNcwPTJhdnKiGEgSvdkvHWlPSA1dHCmUdSlHJAeYUiMZKJrevkoBwexoqs 2qhzDUTcFZyYFAqOHOuo1q69/Q6bxF8qfwfBY=
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:content-transfer-encoding; bh=0be5OsPz6HRQK44CDE2qvZkfnp/zSf6C8XZihCbs3jQ=; b=tm9IMU/463Beb3ZoIa9RPfxaOw9ebt8DXAa4LR2G2yi9u4kc51pPA4IdUtNGbHEHD1 hgJX92FX9rcjmsTIDnh4S46pMSKxwMhsE3Gh1DEPOOVQODZD1uQ69pRDh0giLbNbDdvO YYBazlY8Y8l0MDJPzWLi0jxi1XaiBHn2PGw5stPyaeWNqbkjC4KYJzo//2oLfFBMTZ74 aVYQGz2M5uGFruyqUjI4TOzYgPTF0KXwofEliDJ5qsKoHyddhAdANHYFs4sgfBfMsyoG WueVfC68oJniWh+PLIOKyKq9nVmAPW9i8TK40r2tvFZoHwFtzl6zLOERz21UOYmNgWZq gIuQ==
X-Gm-Message-State: APjAAAX6x9YkUkQZpTLl2Kk39lsmni51gG2JLcRkk1mSTpsG3ddIG4aD Q5qWG4bEx+6sV4ohAEtOKIk8uahs9TlQD6FpEyBgPg==
X-Google-Smtp-Source: APXvYqy7SDV/5FX7rqxqq9injBH2gcOAfd1d/3MBl2J8Rebizlz8gkZZsTv7OLXSqeXs00zJG+KCiSGXFfALpjdzwRw=
X-Received: by 2002:a6b:7503:: with SMTP id l3mr3048295ioh.244.1567380275032; Sun, 01 Sep 2019 16:24:35 -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>
In-Reply-To: <CAD2gp_SJ1+CkVtUsctGpLnk35fOrZUHeojv6q_DGv1u_y7cPLQ@mail.gmail.com>
From: Ulysse Carion <ulysse@segment.com>
Date: Sun, 01 Sep 2019 16:24:24 -0700
Message-ID: <CAJK=1RgQwmM=BN=irvc0tuq=oE9HByAyh5uCE=+Dgg--ksxv0g@mail.gmail.com>
To: John Cowan <cowan@ccil.org>
Cc: JSON WG <json@ietf.org>
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable
Archived-At: <https://mailarchive.ietf.org/arch/msg/json/wqn3UFFOpTwekDIWyIWkthBj0nM>
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:24:38 -0000

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.