Narcissus: correct-by-construction derivation of decoders and encoders from binary formats

It is a neat result from functional programming that libraries ofparser combinatorscan support rapid construc-tion of decoders for quite a range of formats. With a little more work, the same combinator program can denoteboth a decoder and an encoder. Unfortunately, the real world is full of gnarly f...

Full description

Bibliographic Details
Main Authors: Pit-Claudel, Clement Francois (Author), Chlipala, Adam (Author)
Other Authors: Massachusetts Institute of Technology. Department of Electrical Engineering and Computer Science (Contributor)
Format: Article
Language:English
Published: Association for Computing Machinery (ACM), 2021-02-26T16:02:49Z.
Subjects:
Online Access:Get fulltext
LEADER 01852 am a22001813u 4500
001 130006
042 |a dc 
100 1 0 |a Pit-Claudel, Clement Francois  |e author 
100 1 0 |a Massachusetts Institute of Technology. Department of Electrical Engineering and Computer Science  |e contributor 
700 1 0 |a Chlipala, Adam  |e author 
245 0 0 |a Narcissus: correct-by-construction derivation of decoders and encoders from binary formats 
260 |b Association for Computing Machinery (ACM),   |c 2021-02-26T16:02:49Z. 
856 |z Get fulltext  |u https://hdl.handle.net/1721.1/130006 
520 |a It is a neat result from functional programming that libraries ofparser combinatorscan support rapid construc-tion of decoders for quite a range of formats. With a little more work, the same combinator program can denoteboth a decoder and an encoder. Unfortunately, the real world is full of gnarly formats, as with the packetformats that make up the standard Internet protocol stack. Most past parser-combinator approaches cannothandle these formats, and the few exceptions require redundancy - one part of the natural grammar needs tobe hand-translated into hints in multiple parts of a parser program. We show how to recover very naturaland nonredundant format specifications, covering all popular network packet formats and generating bothdecoders and encoders automatically. The catch is that we use the Coq proof assistant to derive both kinds ofartifacts using tactics, automatically, in a way that guarantees that they form inverses of each other. We usedour approach to reimplement packet processing for a full Internet protocol stack, inserting our replacementinto the OCaml-based MirageOS unikernel, resulting in minimal performance degradation. 
546 |a en 
655 7 |a Article 
773 |t 10.1145/3341686 
773 |t Proceedings of the ACM on Programming Languages