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

Ulysse Carion <ulysse@segment.com> Sun, 01 September 2019 23:47 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 26F14120122 for <json@ietfa.amsl.com>; Sun, 1 Sep 2019 16:47:47 -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 QC0K2gbJnK69 for <json@ietfa.amsl.com>; Sun, 1 Sep 2019 16:47:44 -0700 (PDT)
Received: from mail-io1-xd2a.google.com (mail-io1-xd2a.google.com [IPv6:2607:f8b0:4864:20::d2a]) (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 B20AE1200F1 for <json@ietf.org>; Sun, 1 Sep 2019 16:47:44 -0700 (PDT)
Received: by mail-io1-xd2a.google.com with SMTP id j5so25712813ioj.8 for <json@ietf.org>; Sun, 01 Sep 2019 16:47:44 -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=zH90GMfWydU+oqQewkU5RT5Gkyq+cdFFDRH3Na8kIw4=; b=dbjcHeP+ih9cwul5FB0cPDLoh2pR3KQrYTngQXYVzLjIiwA+DGcNfFo+qxAJnfFSTv NkBxNOd3ifZL7tgaZhIQdHUC+OBVD/fQBvw6Win/2cs0G8CisyP/M1p3+/cc+XOQLl5H gXnwd8YIMKHKfzzu/1nkahU13cX4dpHD2+8gk=
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=zH90GMfWydU+oqQewkU5RT5Gkyq+cdFFDRH3Na8kIw4=; b=Bvm4fgsnsT8So7zDDuk4w3BQjmExILEzts3p+zqlHa8ANQSTiN9wU6OLJZal7c4eeT L3khMKeQlM5hrYFeolWgGl8mOG7rXhDnSF6Kx97rXim2Miompp9+wwBiDdtptsIZjnQh nbm7RhdixXK8j3qWoZr6pWFu9QRe2+ti8qmqFIZ21X1ReDVApRNbEvUKyEgMZgX2/DQz E4af4pOIvOdvwtStu9MGymHO4zIsYAWR7OcV91aR15g8h8agYPsoBwRk6UlN9/cf4owy pdLDcsDRGjF4rZpgeNITtcQMUDxozyfH8xjDHcYLxMirnMy1RnaIxLvkITaO1sYbX7pi a27A==
X-Gm-Message-State: APjAAAXO0bUgnZXCtJfZKGz8mCZDyT0n16o1XVRZvwl+84tzRRgnk+0w VHUr4bFTjtxYAdjUsEhjTwn+UISYZonWQN4wiTCtig==
X-Google-Smtp-Source: APXvYqzv8tyjYG4LbY1gLrcMzkc0Q3/44xOhoNWTideZ5uBl83ChegDruHyqQS1pNF8ZI0FqIJMlgH7Xjh4hTHFK9to=
X-Received: by 2002:a5d:888a:: with SMTP id d10mr32011929ioo.201.1567381663935; Sun, 01 Sep 2019 16:47:43 -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> <CAD2gp_SZHKJ5_kfsvyQ30NvPorG=ufdqtR38odjQcGWa0M6+9Q@mail.gmail.com>
In-Reply-To: <CAD2gp_SZHKJ5_kfsvyQ30NvPorG=ufdqtR38odjQcGWa0M6+9Q@mail.gmail.com>
From: Ulysse Carion <ulysse@segment.com>
Date: Sun, 01 Sep 2019 16:47:32 -0700
Message-ID: <CAJK=1RgVx-b_UEPa1Zy3mZ6=b92_jb1Q_YqUK=bPdQ4DBhMk9Q@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/MQFhvTQ55n44m0N-zJUNDAx4CTg>
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:47:52 -0000

This seems like another example of a call I'd rather not have to make,
nor insert into the core spec.

Again -- nothing stops folks who have specific limitations to add
specific extensions. And just because something isn't validated in
JDDF itself doesn't mean it can't be validated at all.

On Sun, Sep 1, 2019 at 4:38 PM John Cowan <cowan@ccil.org> wrote:
>
> 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.