Subject: [art] ABNF vs. ABNF vs. BNF

From: Dave Crocker <[email-masked]>
Date: Mon, 29 Mar 2021 06:29:21 -0700

https://trac.ietf.org/trac/art/wiki/TypicalARTAreaIssues:

>
>     ABNF and BNF
>
> Although the majority of specifications use ABNF (RFC 5234 
> <http://tools.ietf.org/html/rfc5234>), there are many exceptions. Some 
> older email and web specifications use BNF as specified in RFC 822 
> <http://tools.ietf.org/html/rfc822> (or similar). The latter allows 
> for free insertion of folding whitespaces between different BNF 
> productions. So it is very important to state which version of BNF is 
> used.
>

There's a bit of a nomenclature challenge, here.

The reference to RFC 822 needs to be ABNF, also.

ABNF was first created in RFC 733 and I believe the RFC 822 version made 
no significant changes. (A quick comparison of the two documents, 
covering it, does show that I played around with the text.  But I don't 
recall any substantive changes.)

Backus-Naur Form (BNF)(*) was a popular tool in doing syntax 
specifications, but in its pure form it was cumbersome.

By the mid-1970s, it was common for documents using it to create a 
tailored version,  which is what we did for RFC 733.  For the most part, 
this was a classic exercise of balancing expressive power with human 
factors usability.  I'd like to claim that the variant we produced 
became popular as a result of our deep understanding of the right 
balance, but we weren't nearly that knowledgeable or diligent, just lucky.

Anyhow, the wiki entry is making a useful distinction between versions, 
but it needs better labeling. I think there is no established naming 
convention for the versions, so we need to create one.  Lacking any 
creativity, I'll suggest:

ABNF and BNF

Although the majority of specifications use ABNF-5234 (RFC 5234), there 
are many exceptions. Some older email and web specifications use 
ABNF-822 (RFC 822, or similar). The latter allows for free insertion of 
folding whitespaces between different BNF productions. So it is very 
important to state which version of BNF is used.

I hadn't known about RFC5511, written by an old dog, for routing.  I 
vaguely recall there are others.  This suggests that it might be good 
for the text here to acknowledge a larger world of BNF-derivatives?

d/

(*) https://en.wikipedia.org/wiki/Backus%E2%80%93Naur_form

-- 
Dave Crocker
Brandenburg InternetWorking
bbiw.net

---

From: Julian Reschke <[email-masked]>
Date: Mon, 29 Mar 2021 16:22:04 +0200

Am 29.03.2021 um 15:29 schrieb Dave Crocker:
> ...

HTTP uses ABNF-5234 plus an extension construct for lists, see
<https://greenbytes.de/tech/webdav/rfc7230.html#abnf.extension> (but
ship a standard variant in an appendix as well).

BEst regards, Julian