At a recent #BCTechSummit HyperLedger Indy developer bootcamp event in Vancouver, I was fortunate to be part of a conversation where Sam Curren (@telegramsam) was talking to a small group of developers about the importance, over the course of history, for Internet protocols to not only be open, but more importantly, open to innovation …innovations that might succeed as well as innovations that might fail.
“If you look at important Internet protocols like TCP-IP that enable packets on a network to carry any type of data including text, email messages, web pages, etc, and, later on, streaming audio and streaming video, who could have imagined it? It’s vitally important for Internet protocols to not only be open but open to innovation …innovations that might succeed as well as innovations that might fail. No one can foretell how the specifications we’re creating today will be used in the future.” Sam Curren, March 11, 2019
At one level, the Augmented BNF (ABNF) notation is simply a convenient textual approach for describing a grammar. In turn, a grammar is a description of the allowable linguistic constructs permitted in a particular language or any other syntactic construction. Examples of common and emerging grammars written using ABNF notation include:
More importantly, a grammar that conforms to the ABNF specification (RFC4234-4) is also an executable program. That is, a grammar is the source code for program (written in the ABNF notation (aka ABNF programming language)) that recognizes and, optionally, processes a piece of text (string of tokens) that conforms to the grammar’s specification (expressed using ABNF notation).
Summary: The “ABNF Principles”
The “ABNF Principles” include:
- “ABNF” is a specification for a notation for describing a grammar.
- “ABNF notation” is the notation described in the ABNF specification for describing a grammar.
- A grammar is a description of the allowable linguistic constructs permitted in a particular language or any other syntactic construction.
- RFC4234-4 is a formal specification for ABNF notation.
- A grammar expressed using ABNF notation is intended to be executable.
- A grammar expressed using ABNF notation is the source code for a program that can be read, interpreted, compiled, and/or executed by a human, interpreter, compiler, or virtual machine, respectively, in a way that conforms to the ABNF formal specification.
Best Practices for Developing Grammars Written using ABNF Notation
- As in any software development project, it is of primary importance to understand the scope of the functionality, inputs, and outputs of the intended software (aka requirements).
- One of the best, commonly accepted ways to understand of the scope of the intended software to be developed is to work through the following series of artifacts:
- User stories, which in turn are decomposed into
- Use cases, and
- Requirements, and
- Use automation together with the use cases to create an automatable testing framework starting early in the project – automatically validating the the grammar against the test cases (derived from the use cases) on an ongoing basis.
NOTE: These artifacts can be developed iteratively using an agile or other type of development framework. It doesn’t require a waterfall approach.