Re: [abnf-discuss] ABNF colloquialism for end-of-line

Carsten Bormann <> Sun, 19 November 2017 21:08 UTC

Return-Path: <>
Received: from localhost (localhost []) by (Postfix) with ESMTP id ED73A126B6E for <>; Sun, 19 Nov 2017 13:08:29 -0800 (PST)
X-Virus-Scanned: amavisd-new at
X-Spam-Flag: NO
X-Spam-Score: -4.2
X-Spam-Status: No, score=-4.2 tagged_above=-999 required=5 tests=[BAYES_00=-1.9, RCVD_IN_DNSWL_MED=-2.3] autolearn=ham autolearn_force=no
Received: from ([]) by localhost ( []) (amavisd-new, port 10024) with ESMTP id 0Zi-jpA1UtRs for <>; Sun, 19 Nov 2017 13:08:28 -0800 (PST)
Received: from ( [IPv6:2001:638:708:30c9::12]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by (Postfix) with ESMTPS id E7E161241F5 for <>; Sun, 19 Nov 2017 13:08:27 -0800 (PST)
X-Virus-Scanned: amavisd-new at
Received: from ( []) by (8.14.5/8.14.5) with ESMTP id vAJL8O1S020365; Sun, 19 Nov 2017 22:08:24 +0100 (CET)
Received: from [] ( []) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by (Postfix) with ESMTPSA id 3yg4Fg5tC5zDXGK; Sun, 19 Nov 2017 22:08:23 +0100 (CET)
Content-Type: text/plain; charset=utf-8
Mime-Version: 1.0 (Mac OS X Mail 10.3 \(3273\))
From: Carsten Bormann <>
In-Reply-To: <>
Date: Sun, 19 Nov 2017 22:08:23 +0100
Cc: Sean Leonard <>, ABNF-Discuss <>
X-Mao-Original-Outgoing-Id: 532818502.899273-d83bac1fd58dab57000da39c1ebe3628
Content-Transfer-Encoding: quoted-printable
Message-Id: <>
References: <> <> <> <> <> <>
To: Dave Crocker <>
X-Mailer: Apple Mail (2.3273)
Archived-At: <>
Subject: Re: [abnf-discuss] ABNF colloquialism for end-of-line
X-Mailman-Version: 2.1.22
Precedence: list
List-Id: "General discussion about tools, activities and capabilities involving the ABNF meta-language" <>
List-Unsubscribe: <>, <>
List-Archive: <>
List-Post: <>
List-Help: <>
List-Subscribe: <>, <>
X-List-Received-Date: Sun, 19 Nov 2017 21:08:30 -0000

> On Nov 19, 2017, at 19:56, Dave Crocker <> wrote:
> Computers are not the target audience for computer languages.  Human readers are.  


This is so obvious once one starts to think about why we need these languages in the first place.
Unfortunately, considerations about implementation dominate the literature about formal languages.

(Computer history aficionados will remember Algol68, a ground-breaking, highly innovative, but also very practical computer language.  Unfortunately, the theoretically brilliant, but an unusable for humans, two-level Van Wijngaarden grammar was used to specify it.  This completely destroyed adoption of Algol 68.)

> Subtle effects (nevermind side-effects) are very easily missed by human readers.

This is one of the reasons why context-free grammars are so practical.
(In reality they are usually a bit of whitewashing because symbol tables are invariably used to add some context-sensitivity, but that can be considered to be on the semantic level, even if it sometimes isn’t.)

Cuts were initially invented to limit the decision space of Prolog programs to fit the memory available.
When Parse Expression Grammars became implementable, the same approach was useful to limit their memory requirements as well.
Two implementation concerns.

Cuts also have been used to improve error messages from Parse Expression Grammars.  
Now this is about usability of a tool (such as a compiler or validator) for humans and thus highly relevant.

In CDDL, we have discussed cuts also for improving error messages, which maybe is something that can be left for a CDDL 2.0.  However, it recently became clear that CDDL users actually do want some context-sensitive properties for the grammar — being context-free is counter-intuitive in certain limited situations (the “map” container CBOR inherited from JSON also is inherently context sensitive).  Hence our renewed interest in cuts here, for actually obtaining those limited forms of context sensitivity.  (We are still discussing how to do this without turning CDDL into a monster; certainly we don’t want another van Wijngaarden effect.)

Grüße, Carsten