[Cbor] Re: Consensus call on EDN literals single ABNF

Pete Resnick <resnick@episteme.net> Tue, 23 July 2024 23:31 UTC

Return-Path: <resnick@episteme.net>
X-Original-To: cbor@ietfa.amsl.com
Delivered-To: cbor@ietfa.amsl.com
Received: from localhost (localhost [127.0.0.1]) by ietfa.amsl.com (Postfix) with ESMTP id DC983C169437 for <cbor@ietfa.amsl.com>; Tue, 23 Jul 2024 16:31:04 -0700 (PDT)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: -2.104
X-Spam-Level:
X-Spam-Status: No, score=-2.104 tagged_above=-999 required=5 tests=[BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, HTML_MESSAGE=0.001, RCVD_IN_DNSWL_BLOCKED=0.001, RCVD_IN_ZEN_BLOCKED_OPENDNS=0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01, URIBL_BLOCKED=0.001, URIBL_DBL_BLOCKED_OPENDNS=0.001, URIBL_ZEN_BLOCKED_OPENDNS=0.001] autolearn=ham autolearn_force=no
Authentication-Results: ietfa.amsl.com (amavisd-new); dkim=pass (1024-bit key) header.d=episteme.net
Received: from mail.ietf.org ([50.223.129.194]) by localhost (ietfa.amsl.com [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id jMqt_EAn_r_d for <cbor@ietfa.amsl.com>; Tue, 23 Jul 2024 16:30:59 -0700 (PDT)
Received: from mail.episteme.net (episteme.net [216.169.5.102]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by ietfa.amsl.com (Postfix) with ESMTPS id AD03EC1F6FB3 for <cbor@ietf.org>; Tue, 23 Jul 2024 16:30:59 -0700 (PDT)
Received: from [31.133.154.242] (dhcp-9af2.meeting.ietf.org [31.133.154.242]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.episteme.net (Postfix) with ESMTPSA id 4WTD0x1hM1zXLyh; Tue, 23 Jul 2024 18:30:57 -0500 (CDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=episteme.net; s=mail; t=1721777458; bh=vyd+DQHg7iv8bpNPnDwGNuzMEK1fov9OKzjChaR4KEI=; h=From:To:Cc:Subject:Date:In-Reply-To:References; b=ekaGk5MZeLZekc7PFagYlOzL9dblzxPQiK4v5/RSbjcXFLFzyWKvk0ErKu/bMF1jK kZOd8lL+7AzwTUNEMH6u9mloYG0mceO8MtdviFdIe6g4+4Qy4tqJTpKz52lxMK7JCV 6QIwPxbiRKHgRz5Lti4qxhL3wDlJXJG/BWb2HmO8=
From: Pete Resnick <resnick@episteme.net>
To: Christian Amsüss <christian@amsuess.com>
Date: Tue, 23 Jul 2024 16:30:53 -0700
Message-ID: <C1687DF2-9200-48EC-8482-96665C49475A@episteme.net>
In-Reply-To: <Zp1JaqTsOmD2lqd4@hephaistos.amsuess.com>
References: <ZpxlWGAC9UMLqd9c@hephaistos.amsuess.com> <CAN40gSudKn5NyD+5J5j59V1fvt2e+f_iAXO9FmmH6Mu8Q823RA@mail.gmail.com> <CAKoiRuZZ4UCjUwwUbVuM0_JqXefmrU23YG_3d-JmJEznh7ASQw@mail.gmail.com> <Zp1JaqTsOmD2lqd4@hephaistos.amsuess.com>
MIME-Version: 1.0
Content-Type: multipart/alternative; boundary="=_MailMate_CD1C26EA-C448-4587-A264-89930D8EC73F_="
Content-Transfer-Encoding: 8bit
X-Synology-Spam-Status: score=2.41, required 6, ARC_NA 0, SUSPICIOUS_RECIPS 2.51, MID_RHS_MATCH_FROM 0, FROM_HAS_DN 0, RCPT_COUNT_THREE 0, FREEMAIL_ENVRCPT 0, TO_MATCH_ENVRCPT_ALL 0, TAGGED_RCPT 0, __THREADED 0, TO_DN_SOME 0, MIME_GOOD -0.1, HTML_MISSING_CTYPE 0, HTML_MESSAGE 0.001, RCVD_COUNT_ZERO 0, FROM_EQ_ENVFROM 0, MIME_TRACE 0, __NOT_SPOOFED 0, FREEMAIL_CC 0, __HDRS_LCASE_KNOWN 0, NO_RECEIVED -0.001
X-Synology-Spam-Flag: no
Message-ID-Hash: O7RWXNCN3AAE7ATB3WQQPXMAFCLFWCM5
X-Message-ID-Hash: O7RWXNCN3AAE7ATB3WQQPXMAFCLFWCM5
X-MailFrom: resnick@episteme.net
X-Mailman-Rule-Misses: dmarc-mitigation; no-senders; approved; emergency; loop; banned-address; member-moderation; header-match-cbor.ietf.org-0; nonmember-moderation; administrivia; implicit-dest; max-recipients; max-size; news-moderation; no-subject; digests; suspicious-header
CC: Rohan Mahy <rohan.mahy@gmail.com>, Ira McDonald <blueroofmusic@gmail.com>, cbor@ietf.org
X-Mailman-Version: 3.3.9rc4
Precedence: list
Subject: [Cbor] Re: Consensus call on EDN literals single ABNF
List-Id: "Concise Binary Object Representation (CBOR)" <cbor.ietf.org>
Archived-At: <https://mailarchive.ietf.org/arch/msg/cbor/hKUucQjCZmuc1EJdvmoWITdf6vQ>
List-Archive: <https://mailarchive.ietf.org/arch/browse/cbor>
List-Help: <mailto:cbor-request@ietf.org?subject=help>
List-Owner: <mailto:cbor-owner@ietf.org>
List-Post: <mailto:cbor@ietf.org>
List-Subscribe: <mailto:cbor-join@ietf.org>
List-Unsubscribe: <mailto:cbor-leave@ietf.org>

Rohan asked me about this, so I thought I'd pipe up on the list. 
Overall, I don't see this as a "two-layer" or "two-pass" issue; the ABNF 
as described is simply not complete. To respond directly to Christian:

On 21 Jul 2024, at 10:46, Christian Amsüss wrote:

> There is a large risk of the special cases to diverge from the general
> cases. Whenever an extension point is specified (be it in ABNF or 
> CBOR)
> as
>
> item = key1 value1 /
>        key2 value2 /
>        extkey extvalue
>
> then implementors get no guarantee that the processing of the 
> originally
> defined keys and values is consistent with the processing of 
> extensions.

I agree that the above is not a great idea, but that wouldn't be the way 
I suggest to make the change. In the current top-level syntax in 4.1, 
you have:

````
    app-prefix      = lcalpha *lcalnum ; including h and b64
                    / ucalpha *ucalnum ; tagged variant, if defined
    app-string      = app-prefix sqstr
    sqstr           = "'" *single-quoted "'"
    bstr            = app-string / sqstr / embedded
                      ; app-string could be any type
````

With this syntax, bstr can never be parsed to anything that results in 
"app-string-h" or "app-string-dt", etc. That's (I believe) not what you 
want. Try this instead:

````
    app-string      = app-string-h
                    / app-string-b64
                    / app-string-dt
                    / app-string-ip
                    / app-string-gen

    app-string-gen  = app-prefix sqstr ; generic app-string
    app-prefix      = lcalpha *lcalnum ; including h and b64
                    / ucalpha *ucalnum ; tagged variant, if defined
    sqstr           = "'" *single-quoted "'"
    bstr            = app-string / sqstr / embedded
````

Then leave everything in 4.2 exactly as it is now. That will allow all 
of the current possibilities, and if you add a new app-string type in a 
later document, you can simply say:

````
    app-string      =/ app-string-new
````

Correct ABNF requires something like the above AFAICT.

pr
-- 
Pete Resnick https://www.episteme.net/
All connections to the world are tenuous at best