Affiliation:
1. EPFL, Lausanne, Switzerland
2. EPFL, Orable Labs, Lausanne, Switzerland
Abstract
Parsers are ubiquitous in computing, and many applications depend on their performance for decoding data efficiently. Parser combinators are an intuitive tool for writing parsers: tight integration with the host language enables grammar specifications to be interleaved with processing of parse results. Unfortunately, parser combinators are typically slow due to the high overhead of the host language abstraction mechanisms that enable composition.
We present a technique for eliminating such overhead. We use staging, a form of runtime code generation, to dissociate input parsing from parser composition, and eliminate intermediate data structures and computations associated with parser composition at staging time. A key challenge is to maintain support for input dependent grammars, which have no clear stage distinction.
Our approach applies to top-down recursive-descent parsers as well as bottom-up non-deterministic parsers with key applications in dynamic programming on sequences, where we auto-generate code for parallel hardware. We achieve performance comparable to specialized, hand-written parsers.
Funder
European Research Council
Publisher
Association for Computing Machinery (ACM)
Subject
Computer Graphics and Computer-Aided Design,Software
Reference38 articles.
1. The Apache HTTP server project. http://httpd.apache.org/. The Apache HTTP server project. http://httpd.apache.org/.
2. Synthesising graphics card programs from DSLs
3. Accelerating the Nussinov RNA folding algorithm with CUDA/GPU
4. Stream fusion
5. Dyna
Cited by
4 articles.
订阅此论文施引文献
订阅此论文施引文献,注册后可以免费订阅5篇论文的施引文献,订阅后可以查看论文全部施引文献
1. Daedalus: Safer Document Parsing;Proceedings of the ACM on Programming Languages;2024-06-20
2. Oregano: staging regular expressions with Moore Cayley fusion;Proceedings of the 15th ACM SIGPLAN International Haskell Symposium;2022-09-06
3. Multi-stage programming in the large with staged classes;Proceedings of the 19th ACM SIGPLAN International Conference on Generative Programming: Concepts and Experiences;2020-11-16
4. Staged selective parser combinators;Proceedings of the ACM on Programming Languages;2020-08-02