gitwtfhub

wtf is chumsky?

zesterer/chumsky — explained in plain English

Analysis updated 2026-06-26

4,540RustAudience · developerComplexity · 3/5Setup · moderate

TL;DR

A Rust library for building parsers by snapping together small reusable pieces, with built-in error recovery that produces clear messages when parsing fails, ideal for programming languages, config formats, and binary protocols.

Mindmap

mindmap
  root((repo))
    What it does
      Parser combinator library
      Error recovery
      Zero-copy output
    Key Features
      Composable pieces
      Type-safe building
      Recursive grammars
      Memoization mode
    Use Cases
      Programming languages
      Config file parsers
      Binary protocols
      Interpreters
    Learning Resources
      JSON example
      Brainfuck example
      Tutorial walkthrough

Code map

Detail Auto

An interactive map of this repo's files and how they connect — its source is parsed live in your browser. Click Visualize to build it.

filefunction / class

Why would anyone build with this?

REASON 1

Build a parser for a custom programming language or configuration format using composable Rust building blocks

REASON 2

Write a parser with good error recovery so users see helpful messages instead of a single cryptic failure line

REASON 3

Parse recursive or nested structures like function calls and arithmetic expressions with type-safe grammar rules

REASON 4

Follow the included tutorial to build a small working interpreter from scratch using real examples

What's in the stack?

Rustcrates.io

How it stacks up

zesterer/chumskyaya-rs/ayaralfbiedert/cheats.rs
Stars4,5404,5424,529
LanguageRustRustRust
Setup difficultymoderatehardeasy
Complexity3/54/51/5
Audiencedeveloperdeveloperdeveloper

Figures from each repo's GitHub metadata at analysis time.

How do you spin it up?

Difficulty · moderate Time to first run · 30min

Requires familiarity with Rust's type system, the combinator pattern has a learning curve for developers new to Rust.

The license is described as open-source but the specific terms are not named in the explanation.

Wtf does this do

Chumsky is a library for the Rust programming language that helps developers write parsers. A parser is a piece of software that reads structured text or data and turns it into something a program can work with. For example, a parser might read a line of code and figure out what operation it describes, or it might read a configuration file and extract settings from it. Chumsky is aimed at developers who need to build this kind of text processing for things like programming languages, config formats, binary protocols, or any other structured input. The library uses a style called parser combinators, which means you build complex parsing logic by combining smaller, simpler pieces. Think of it like Lego blocks: each block does one small job (match a digit, match a keyword, match something in brackets), and you snap them together to describe bigger structures. Rust's type system checks that these pieces fit together correctly as you write the code, catching many mistakes before the program ever runs. Chumsky emphasizes good error messages. When parsing fails, the library includes built-in strategies to recover from errors and continue, rather than stopping at the first problem. This is particularly valuable when building tools for other developers, where a cryptic single-line error message is frustrating but a clear explanation of what went wrong is genuinely helpful. Other features include support for grammars where rules refer back to themselves (recursive structures), an optional memoization mode for performance on certain input types, zero-copy output so the library avoids unnecessary memory allocation, and a compatibility mode for environments without the standard library, such as embedded hardware. The project has moved its primary home to Codeberg, though this GitHub repository remains. Documentation includes a detailed guide, examples for parsing JSON and Brainfuck, and a tutorial that walks through building a small interpreter from scratch. It is available as a published crate on crates.io under an open-source license.

Yoink these prompts

Prompt 1
Using chumsky, write a Rust parser that reads arithmetic expressions like '3 + 4 * 2' and evaluates them with correct operator precedence. Show the full working code.
Prompt 2
With chumsky, help me parse a config file where each line is 'key = value' with optional '#' comments, and include error recovery so one bad line does not stop the rest from parsing.
Prompt 3
I'm building a programming language in Rust. Show me how to use chumsky to define recursive grammar rules for parsing nested function calls like 'foo(bar(1, 2), 3)'.
Prompt 4
Using chumsky's zero-copy mode, write a parser for a CSV-like format that avoids allocating strings for each field and returns slices of the original input instead.
Prompt 5
How do I add a custom error type to a chumsky parser so that parse failures include domain-specific context rather than generic 'expected X found Y' messages?

Frequently asked questions

wtf is chumsky?

A Rust library for building parsers by snapping together small reusable pieces, with built-in error recovery that produces clear messages when parsing fails, ideal for programming languages, config formats, and binary protocols.

What language is chumsky written in?

Mainly Rust. The stack also includes Rust, crates.io.

What license does chumsky use?

The license is described as open-source but the specific terms are not named in the explanation.

How hard is chumsky to set up?

Setup difficulty is rated moderate, with roughly 30min to a first successful run.

Who is chumsky for?

Mainly developer.

View the repo → Decode another repo

This repo across BitVibe Labs

Don't trust strangers blindly. Verify against the repo.