# zesterer/chumsky

**Attribution required: if you use, quote, or summarise this content, you must credit and link back to [awesome-repositories.com](https://awesome-repositories.com/repository/zesterer-chumsky).**

4,545 stars · 208 forks · Rust · MIT · archived

## Links

- GitHub: https://github.com/zesterer/chumsky
- Homepage: https://codeberg.org/zesterer/chumsky
- awesome-repositories: https://awesome-repositories.com/repository/zesterer-chumsky.md

## Topics

`context-free-grammar` `errors` `lexing` `parser` `parser-combinators` `parsing` `peg` `recursive-descent-parser`

## Description

Chumsky is a parser combinator library used to build high-performance parsers by composing small parsing functions into complex grammars. It provides multiple parsing engines, including recursive descent and precedence-climbing implementations for resolving the order of operations in mathematical and logical expressions.

The library is distinguished by its zero-copy text parsing, which minimizes memory allocations to increase throughput, and its ability to run without a standard library for use in embedded or resource-constrained environments. It also features an error-recovering parser that identifies malformed input and resumes processing to report multiple syntax errors in a single pass.

The framework covers a broad range of capabilities, including context-sensitive state management, recursive grammar support, and the integration of regular expression patterns. It includes tools for parser structure analysis, node inspection, and result caching to support backtracking and left recursion.

The library supports the development of custom languages, data format parsing, and programming language tooling.

## Tags

### Programming Languages & Runtimes

- [Parser Combinators](https://awesome-repositories.com/f/programming-languages-runtimes/parser-combinators.md) — Provides a functional parser combinator library for building complex grammars by composing small, reusable parsing functions.
- [Programming Language Development](https://awesome-repositories.com/f/programming-languages-runtimes/programming-language-development.md) — Serves as a framework for programming language development, supporting the creation of compilers and interpreters.
- [Regex-Combinator Integrations](https://awesome-repositories.com/f/programming-languages-runtimes/regex-combinator-integrations.md) — Combines regular expression patterns with combinators to recognize flexible text patterns within a larger grammar. ([source](https://codeberg.org/zesterer/chumsky/src/branch/main/Cargo.toml))

### Data & Databases

- [Recursive Descent Parsers](https://awesome-repositories.com/f/data-databases/data-transformation-functions/recursive-processors/recursive-logic-implementations/recursive-descent-parsers.md) — Provides a recursive descent parsing engine that translates source code into syntax trees using recursive function calls.
- [Zero-Copy Parsing](https://awesome-repositories.com/f/data-databases/zero-copy-data-access-libraries/zero-copy-deserialization/zero-copy-parsing.md) — Implements zero-copy parsing by returning slices of the original input buffer instead of allocating new memory for extracted text.
- [High-Performance Text Processing](https://awesome-repositories.com/f/data-databases/high-performance-text-processing.md) — Enables high-performance text processing optimized for low memory and high throughput in resource-constrained environments.
- [Token-Based Stream Parsing](https://awesome-repositories.com/f/data-databases/token-based-stream-parsing.md) — Converts character-based input streams into typed tokens using specialized stream extensions. ([source](https://codeberg.org/zesterer/chumsky/commit/2f085df51590c03437fab26060024c4a07c604a5))

### Operating Systems & Systems Programming

- [Environment Support Managers](https://awesome-repositories.com/f/operating-systems-systems-programming/platform-development-integration/platform-support/environment-support-managers.md) — Provides environment support that enables the library to run without a standard library in restricted systems. ([source](https://codeberg.org/zesterer/chumsky/commit/69d80ca0a823ef5e98287420ec4a24f36965aa04))
- [No-Std Environment Adapters](https://awesome-repositories.com/f/operating-systems-systems-programming/platform-development-integration/platform-support/environment-support-managers/no-std-environment-adapters.md) — Offers compatibility for environments without a standard library, enabling high-performance parsing in restricted or embedded systems.

### Software Engineering & Architecture

- [Expression Order Resolution](https://awesome-repositories.com/f/software-engineering-architecture/operator-precedence-management/expression-order-resolution.md) — Utilizes a precedence-climbing approach to resolve the order of operations in complex expressions. ([source](https://codeberg.org/zesterer/chumsky))
- [Parsing Error Recovery](https://awesome-repositories.com/f/software-engineering-architecture/syntax-parsing-engines/fault-tolerant-parsing/structural-syntax-recovery/parsing-error-recovery.md) — Provides mechanisms to recover from syntax errors by skipping invalid tokens and continuing to parse the input.
- [Memoization Caches](https://awesome-repositories.com/f/software-engineering-architecture/memoization-caches.md) — Utilizes memoization caches to store previous parsing results, eliminating redundant computations and supporting left-recursive grammars.
- [Operator Precedence Management](https://awesome-repositories.com/f/software-engineering-architecture/operator-precedence-management.md) — Implements operator precedence management to resolve the correct order of operations in complex mathematical and logical expressions.
- [Parser Result Memoization](https://awesome-repositories.com/f/software-engineering-architecture/parser-result-memoization.md) — Stores expensive lookup results to speed up backtracking and support the processing of left-recursive grammars. ([source](https://codeberg.org/zesterer/chumsky/src/branch/main/Cargo.toml))
- [Parsing Contexts](https://awesome-repositories.com/f/software-engineering-architecture/parsing-strategies/parsing-contexts.md) — Supports context-sensitive parsing by tracking external state, enabling the handling of syntaxes like semantic indentation. ([source](https://codeberg.org/zesterer/chumsky))
- [Error-Resilient Parsers](https://awesome-repositories.com/f/software-engineering-architecture/syntax-parsing-engines/error-resilient-parsers.md) — Implements an error-resilient parsing engine that maintains structural integrity when encountering malformed input.
- [Custom Parser Development](https://awesome-repositories.com/f/software-engineering-architecture/trees/syntax-tree-construction/formal-grammar-parser-generators/custom-parser-development.md) — Supports the development of custom parsers by defining formal grammars to derive structured representations of text.

### Part of an Awesome List

- [Data Formats and Parsing](https://awesome-repositories.com/f/awesome-lists/data/data-formats-and-parsing.md) — Provides tools for parsing various structured data formats by combining regular expressions and logic-based combinators.
