A lightweight parser combinator library for Idris, inspired by Parsec, with backtrack-by-default behavior.
Lightyear is a parser combinator library for the Idris programming language, enabling developers to construct parsers by combining smaller parsing functions. It solves the problem of building robust and efficient parsers for custom formats or languages within Idris, offering a Parsec-inspired API with a backtrack-by-default approach.
Idris developers who need to implement parsers for domain-specific languages, data formats, or compiler frontends, especially those familiar with parser combinators from Haskell or similar ecosystems.
Developers choose Lightyear for its lightweight design, explicit control over backtracking via commitment operators, and seamless integration with Idris's strict evaluation model through lazy branching combinators.
Parser combinators for Idris
Open-Awesome is built by the community, for the community. Submit a project, suggest an awesome list, or help improve the catalog on GitHub.
Parsers automatically backtrack on failure, eliminating the need for explicit `try` wrappers required in Parsec, leading to cleaner and more intuitive code.
Combinators like `commitTo` and operators such as `>!` allow developers to commit to parsing branches after consuming input, preventing unnecessary backtracking and improving efficiency.
Operators like `<|>|` and `<*>|` handle recursion safely in Idris's strict evaluation environment, enabling robust parser definitions without infinite recursion issues.
Organized into focused modules (e.g., Core, Combinators, Char) and offers a Parsec-inspired syntax, easing adoption for those experienced with parser combinators.
The necessity of operators like `<|>|` and `<*>|` for recursion adds cognitive overhead and potential for errors, especially in complex mutual recursion scenarios.
As an Idris-only library, it lacks the extensive community, documentation, and tooling found in more popular parsing libraries like Haskell's Parsec.
Tied to Idris, which has a smaller user base, making it less suitable for projects that require integration with broader software ecosystems or team expertise.