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

Carsten Bormann <cabo@tzi.org> Sun, 19 November 2017 21:08 UTC

Return-Path: <cabo@tzi.org>
X-Original-To: abnf-discuss@ietfa.amsl.com
Delivered-To: abnf-discuss@ietfa.amsl.com
Received: from localhost (localhost [127.0.0.1]) by ietfa.amsl.com (Postfix) with ESMTP id ED73A126B6E for <abnf-discuss@ietfa.amsl.com>; Sun, 19 Nov 2017 13:08:29 -0800 (PST)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: -4.2
X-Spam-Level:
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 mail.ietf.org ([4.31.198.44]) by localhost (ietfa.amsl.com [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id 0Zi-jpA1UtRs for <abnf-discuss@ietfa.amsl.com>; Sun, 19 Nov 2017 13:08:28 -0800 (PST)
Received: from mailhost.informatik.uni-bremen.de (mailhost.informatik.uni-bremen.de [IPv6:2001:638:708:30c9::12]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ietfa.amsl.com (Postfix) with ESMTPS id E7E161241F5 for <abnf-discuss@ietf.org>; Sun, 19 Nov 2017 13:08:27 -0800 (PST)
X-Virus-Scanned: amavisd-new at informatik.uni-bremen.de
Received: from submithost.informatik.uni-bremen.de (submithost.informatik.uni-bremen.de [134.102.201.11]) by mailhost.informatik.uni-bremen.de (8.14.5/8.14.5) with ESMTP id vAJL8O1S020365; Sun, 19 Nov 2017 22:08:24 +0100 (CET)
Received: from [192.168.217.119] (p5DC7FC78.dip0.t-ipconnect.de [93.199.252.120]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by submithost.informatik.uni-bremen.de (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 <cabo@tzi.org>
In-Reply-To: <c10a79f2-5e42-fc00-ed5a-4459064b5af4@gmail.com>
Date: Sun, 19 Nov 2017 22:08:23 +0100
Cc: Sean Leonard <dev+ietf@seantek.com>, ABNF-Discuss <abnf-discuss@ietf.org>
X-Mao-Original-Outgoing-Id: 532818502.899273-d83bac1fd58dab57000da39c1ebe3628
Content-Transfer-Encoding: quoted-printable
Message-Id: <6BF6E482-7EAD-4564-B273-44ADC13E7375@tzi.org>
References: <97E6D6C0-7010-46D6-8641-670F10A2504C@seantek.com> <3fbd228d-c6cf-be73-c7f2-f6b15979b852@gmail.com> <477FA5E8-FBAA-47D4-98A6-79DBAE4498C7@tzi.org> <7db503ef-3db4-9a72-6d14-001831742600@gmail.com> <62B9A765-E6EE-4C20-9A4E-58ADA9FDE975@seantek.com> <c10a79f2-5e42-fc00-ed5a-4459064b5af4@gmail.com>
To: Dave Crocker <dcrocker@gmail.com>
X-Mailer: Apple Mail (2.3273)
Archived-At: <https://mailarchive.ietf.org/arch/msg/abnf-discuss/Rjsp6nc6r6qLKJsf1jyO9Bzsedc>
Subject: Re: [abnf-discuss] ABNF colloquialism for end-of-line
X-BeenThere: abnf-discuss@ietf.org
X-Mailman-Version: 2.1.22
Precedence: list
List-Id: "General discussion about tools, activities and capabilities involving the ABNF meta-language" <abnf-discuss.ietf.org>
List-Unsubscribe: <https://www.ietf.org/mailman/options/abnf-discuss>, <mailto:abnf-discuss-request@ietf.org?subject=unsubscribe>
List-Archive: <https://mailarchive.ietf.org/arch/browse/abnf-discuss/>
List-Post: <mailto:abnf-discuss@ietf.org>
List-Help: <mailto:abnf-discuss-request@ietf.org?subject=help>
List-Subscribe: <https://www.ietf.org/mailman/listinfo/abnf-discuss>, <mailto:abnf-discuss-request@ietf.org?subject=subscribe>
X-List-Received-Date: Sun, 19 Nov 2017 21:08:30 -0000

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

+10k.

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