parboiled2: a macro-based approach for effective generators of parsing expressions grammars in Scala
Alexander A. Myltsev

TL;DR
parboiled2 is a Scala library that uses macros and a Scala DSL to generate efficient PEG parsers, widely adopted in various Scala projects for parsing tasks.
Contribution
It introduces a macro-based approach with a Scala DSL for creating effective PEG parsers, enhancing syntax, semantics, and runtime performance.
Findings
Used in popular Scala libraries like akka-http and Sangria
Extensively leverages Scala typing for DSL integrity
Expands grammars with Scala Macros for runtime efficiency
Abstract
In today's computerized world, parsing is ubiquitous. Developers parse logs, queries to databases and websites, programming and natural languages. When Java ecosystem maturity, concise syntax, and runtime speed matters, developers choose parboiled2 that generates grammars for parsing expression grammars (PEG). The following open source libraries have chosen parboiled2 for parsing facilities: - akka-http is the Streaming-first HTTP server/module of Lightbend Akka - Sangria is a Scala GraphQL implementation - http4s is a minimal, idiomatic Scala interface for HTTP - cornichon is Scala DSL for testing HTTP JSON API - scala-uri is a simple Scala library for building and parsing URIs The library uses a wide range of Scala facilities to provide required functionality. We also discuss the extensions to PEGs. In particular, we show the implementation of an internal Scala DSL that features…
Peer Reviews
No public reviews on file for this paper yet. If you reviewed it on a platform where reviews are public (OpenReview, ICLR, NeurIPS, ICML), you can paste yours below so the community can read it here.
Videos
No videos yet. Explain this paper in a talk, walkthrough, or lecture? Add one.
Taxonomy
TopicsLogic, programming, and type systems · Natural Language Processing Techniques · Software Engineering Research
