A Clojure library of parser combinators for implementing recursive-descent parsers with unlimited look-ahead.
Kern is a parser combinators library for Clojure that enables developers to implement recursive-descent parsers based on predictive LL(1) grammars with unlimited look-ahead. It provides a rich set of combinators for parsing text, programming languages, and data formats like JSON and EDN, allowing code to closely mirror grammar structure.
Clojure developers working on domain-specific languages, program extensions, or needing to parse custom data formats and programming languages.
Developers choose Kern for its high productivity, compositional approach that makes parsers resemble grammar structure, and support for detailed error messages and configurable lexers, despite not being optimized for maximum performance.
A Parser Combinators Library for Clojure
Open-Awesome is built by the community, for the community. Submit a project, suggest an awesome list, or help improve the catalog on GitHub.
Uses a custom state monad to enable parsers that closely mirror grammar structure through abstraction and composition, boosting developer productivity as highlighted in the README.
Provides lexer combinators for various language styles like C, Java, Haskell, and Shell, with customizable features for whitespace, comments, and identifiers.
Generates accurate error messages with a simple i18n scheme, improving debugging and user feedback, as noted in the features section.
Includes support for parsing and evaluating expressions out of the box, reducing boilerplate code for language implementations.
Explicitly designed for productivity over speed, with benchmarks showing it parses JSON at 350K per second compared to 4MB per quarter second for libraries like data.json.
Based on predictive LL(1) grammars with unlimited look-ahead, which may require workarounds for complex or ambiguous grammars, limiting flexibility in some use cases.
Requires understanding of functional programming concepts like monads, which can be a barrier for developers not familiar with this paradigm, despite the productivity gains.