[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"project-5819":3},{"id":4,"name":5,"fullName":6,"owner":7,"repo":5,"description":8,"homepage":9,"htmlUrl":10,"language":11,"languages":10,"totalLinesOfCode":10,"stars":12,"forks":13,"watchers":14,"openIssues":15,"contributorsCount":16,"subscribersCount":16,"size":16,"stars1d":17,"stars7d":17,"stars30d":18,"stars90d":16,"forks30d":16,"starsTrendScore":19,"compositeScore":20,"rankGlobal":10,"rankLanguage":10,"license":21,"archived":22,"fork":23,"defaultBranch":24,"hasWiki":22,"hasPages":23,"topics":25,"createdAt":10,"pushedAt":10,"updatedAt":34,"readmeContent":35,"aiSummary":36,"trendingCount":16,"starSnapshotCount":16,"syncStatus":37,"lastSyncTime":38,"discoverSource":39},5819,"chumsky","zesterer\u002Fchumsky","zesterer","[Chumsky has moved to Codeberg!] Write expressive, high-performance parsers with ease.","https:\u002F\u002Fcodeberg.org\u002Fzesterer\u002Fchumsky",null,"Rust",4543,209,18,109,0,1,7,3,62.17,"MIT License",true,false,"main",[26,27,28,29,30,31,32,33],"context-free-grammar","errors","lexing","parser","parser-combinators","parsing","peg","recursive-descent-parser","2026-06-12 04:00:27","[![crates.io](https:\u002F\u002Fimg.shields.io\u002Fcrates\u002Fv\u002Fchumsky.svg)](https:\u002F\u002Fcrates.io\u002Fcrates\u002Fchumsky)\n[![crates.io](https:\u002F\u002Fdocs.rs\u002Fchumsky\u002Fbadge.svg)](https:\u002F\u002Fdocs.rs\u002Fchumsky)\n[![License](https:\u002F\u002Fimg.shields.io\u002Fcrates\u002Fl\u002Fchumsky.svg)](https:\u002F\u002Fgithub.com\u002Fzesterer\u002Fchumsky)\n[![actions-badge](https:\u002F\u002Fgithub.com\u002Fzesterer\u002Fchumsky\u002Factions\u002Fworkflows\u002Frust.yml\u002Fbadge.svg)](https:\u002F\u002Fgithub.com\u002Fzesterer\u002Fchumsky\u002Factions)\n\nChumsky is a parser library for Rust that makes writing expressive, high-performance parsers easy.\n\n\u003Ca href = \"https:\u002F\u002Fwww.github.com\u002Fzesterer\u002Ftao\">\n    \u003Cimg src=\"https:\u002F\u002Fraw.githubusercontent.com\u002Fzesterer\u002Fchumsky\u002Fmaster\u002Fmisc\u002Fexample.png\" alt=\"Example usage with my own language, Tao\"\u002F>\n\u003C\u002Fa>\n\n*Note: Error diagnostic rendering in this example is performed by [Ariadne](https:\u002F\u002Fgithub.com\u002Fzesterer\u002Fariadne)*\n\nAlthough chumsky is designed primarily for user-facing parsers such as compilers, chumsky is just as much at home\nparsing binary protocols at the networking layer, configuration files, or any other form of complex input validation\nthat you may need. It also has `no_std` support, making it suitable for embedded environments.\n\n## Features\n\n- 🪄 **Expressive combinators** that make writing your parser a joy\n- 🎛️ **Fully generic** across input, token, output, span, and error types\n- 📑 **Zero-copy parsing** minimises allocation by having outputs hold references\u002Fslices of the input\n- 🚦 **Flexible error recovery** strategies out of the box\n- ☑️ **Check-only mode** for fast verification of inputs, automatically supported\n- 🚀 **Internal optimiser** leverages the power of [GATs](https:\u002F\u002Fsmallcultfollowing.com\u002Fbabysteps\u002Fblog\u002F2022\u002F06\u002F27\u002Fmany-modes-a-gats-pattern\u002F) to optimise your parser for you\n- 📖 **Text-oriented parsers** for text inputs (i.e: `&[u8]` and `&str`)\n- 👁️‍🗨️ **Context-free grammars** are fully supported, with support for context-sensitivity\n- 🔄 **Left recursion and memoization** have opt-in support\n- 🪺 **Nested inputs** such as token trees are fully supported both as inputs and outputs\n- 🏷️ **Pattern labelling** for dynamic, user-friendly error messages\n- 🗃️ **Caching** allows parsers to be created once and reused many times\n- ↔️ **Pratt parsing** support for simple yet flexible expression parsing\n- 🪛 **no_std** support, allowing chumsky to run in embedded environments\n- 🔬**Debugging** utilities, including automatic generation of parser [railroad diagrams](https:\u002F\u002Fen.wikipedia.org\u002Fwiki\u002FSyntax_diagram)\n\n## Example\n\nSee [`examples\u002Fbrainfuck.rs`](https:\u002F\u002Fgithub.com\u002Fzesterer\u002Fchumsky\u002Fblob\u002Fmain\u002Fexamples\u002Fbrainfuck.rs) for a full\n[Brainfuck](https:\u002F\u002Fen.wikipedia.org\u002Fwiki\u002FBrainfuck) interpreter\n(`cargo run --example brainfuck -- examples\u002Fsample.bf`).\n\n```rust,ignore\nuse chumsky::prelude::*;\n\n\u002F\u002F\u002F An AST (Abstract Syntax Tree) for Brainfuck instructions\n#[derive(Clone)]\nenum Instr {\n    Left, Right,\n    Incr, Decr,\n    Read, Write,\n    Loop(Vec\u003CSelf>), \u002F\u002F In Brainfuck, `[...]` loop instructions contain any number of instructions\n}\n\n\u002F\u002F\u002F A function that generates a Brainfuck parser\nfn brainfuck\u003C'a>() -> impl Parser\u003C'a, &'a str, Vec\u003CInstr>> {\n    \u002F\u002F Brainfuck syntax is recursive: each instruction can contain many sub-instructions (via `[...]` loops)\n    recursive(|bf| choice((\n        \u002F\u002F All of the basic instructions are just single characters\n        just('\u003C').to(Instr::Left),\n        just('>').to(Instr::Right),\n        just('+').to(Instr::Incr),\n        just('-').to(Instr::Decr),\n        just(',').to(Instr::Read),\n        just('.').to(Instr::Write),\n        \u002F\u002F Loops are strings of Brainfuck instructions, delimited by square brackets\n        bf.delimited_by(just('['), just(']')).map(Instr::Loop),\n    ))\n        \u002F\u002F Brainfuck instructions appear sequentially, so parse as many as we need\n        .repeated()\n        .collect())\n}\n\n\u002F\u002F Parse some Brainfuck with our parser\nbrainfuck().parse(\"--[>--->->->++>-\u003C\u003C\u003C\u003C\u003C-------]>--.>---------.>--..+++.>----.>+++++++++.\u003C\u003C.+++.------.\u003C-.>>+.\")\n```\n\nYou can find more examples [here](https:\u002F\u002Fgithub.com\u002Fzesterer\u002Fchumsky\u002Ftree\u002Fmain\u002Fexamples).\n\n## Guide and documentation\n\nChumsky has an extensive [guide](https:\u002F\u002Fdocs.rs\u002Fchumsky\u002Flatest\u002Fchumsky\u002Fguide) that walks you through the library: all\nthe way from setting up and basic theory to advanced uses of the crate. It includes technical details of chumsky's\nbehaviour, examples of uses, a handy index for all of the combinators, technical details about the crate, and even a\ntutorial that leads you through the development of a fully-functioning interpreter for a simple programming language.\n\nThe crate docs should also be similarly useful: most important functions include at least one contextually-relevant\nexample, and all crate items are fully documented.\n\nIn addition, chumsky comes with a suite of fully-fledged\n[example projects](https:\u002F\u002Fgithub.com\u002Fzesterer\u002Fchumsky\u002Ftree\u002Fmain\u002Fexamples). These include:\n\n- Parsers for existing syntaxes like Brainfuck and JSON\n- Integration demos for third-party crates, like [`logos`](https:\u002F\u002Fcrates.io\u002Fcrates\u002Flogos)\n- Parsers for new toy programming languages: a Rust-like language and a full-on lexer, parser, type-checker, and\n  interpreter for a minature ML-like language.\n- Examples of parsing non-trivial inputs like token trees, `impl Read`ers, and zero-copy, zero-alloc parsing.\n\n## Cargo features\n\nChumsky contains several optional features that extend the crate's functionality.\n\n- `bytes`: adds support for parsing types from the [`bytes`](https:\u002F\u002Fdocs.rs\u002Fbytes\u002F) crate.\n\n- `either`: implements `Parser` for `either::Either`, allowing dynamic configuration of parsers at run-time\n\n- `extension`: enables the extension API, allowing you to write your own first-class combinators that integrate with\n  and extend chumsky\n\n- `lexical-numbers`: Enables use of the `Number` parser for parsing various numeric formats\n\n- `memoization`: enables [memoization](https:\u002F\u002Fen.wikipedia.org\u002Fwiki\u002FMemoization#Parsers) features\n\n- `nightly`: enable support for features only supported by the nightly Rust compiler\n\n- `pratt`: enables the [pratt parsing](https:\u002F\u002Fmatklad.github.io\u002F2020\u002F04\u002F13\u002Fsimple-but-powerful-pratt-parsing.html)\n  combinator\n\n- `regex`: enables the regex combinator\n\n- `serde`: enables `serde` (de)serialization support for several types\n\n- `stacker` (enabled by default): avoid stack overflows by spilling stack data to the heap via the `stacker` crate\n\n- `std` (enabled by default): support for standard library features\n\n- `unstable`: enables experimental chumsky features (API features enabled by `unstable` are NOT considered to fall\n  under the semver guarantees of chumsky!)\n\n## *What* is a parser combinator?\n\nParser combinators are a technique for implementing parsers by defining them in terms of other parsers. The resulting\nparsers use a [recursive descent](https:\u002F\u002Fen.wikipedia.org\u002Fwiki\u002FRecursive_descent_parser) strategy to transform a stream\nof tokens into an output. Using parser combinators to define parsers is roughly analogous to using Rust's\n[`Iterator`](https:\u002F\u002Fdoc.rust-lang.org\u002Fstd\u002Fiter\u002Ftrait.Iterator.html) trait to define iterative algorithms: the\ntype-driven API of `Iterator` makes it more difficult to make mistakes and easier to encode complicated iteration logic\nthan if one were to write the same code by hand. The same is true of parser combinators.\n\n## *Why* use parser combinators?\n\nWriting parsers with good error recovery is conceptually difficult and time-consuming. It requires understanding the\nintricacies of the recursive descent algorithm, and then implementing recovery strategies on top of it. If you're\ndeveloping a programming language, you'll almost certainly change your mind about syntax in the process, leading to some\nslow and painful parser refactoring. Parser combinators solve both problems by providing an ergonomic API that allows\nfor rapidly iterating upon a syntax.\n\nParser combinators are also a great fit for domain-specific languages for which an existing parser does not exist.\nWriting a reliable, fault-tolerant parser for such situations can go from being a multi-day task to a half-hour task\nwith the help of a decent parser combinator library.\n\n## Classification\n\nChumsky's parsers are [recursive descent](https:\u002F\u002Fen.wikipedia.org\u002Fwiki\u002FRecursive_descent_parser) parsers and are\ncapable of parsing [parsing expression grammars (PEGs)](https:\u002F\u002Fen.wikipedia.org\u002Fwiki\u002FParsing_expression_grammar), which\nincludes all known context-free languages. However, chumsky doesn't stop there: it also supports context-sensitive\ngrammars via a set of dedicated combinators that integrate cleanly with the rest of the library. This allows it to\nadditionally parse a number of context-sensitive syntaxes like Rust-style raw strings, Python-style semantic\nindentation, and much more.\n\n## Error recovery\n\nChumsky has support for error recovery, meaning that it can encounter a syntax error, report the error, and then\nattempt to recover itself into a state in which it can continue parsing so that multiple errors can be produced at once\nand a partial [AST](https:\u002F\u002Fen.wikipedia.org\u002Fwiki\u002FAbstract_syntax_tree) can still be generated from the input for future\ncompilation stages to consume.\n\n## Performance\n\nChumsky allows you to choose your priorities. When needed, it can be configured for high-quality parser errors. It can\nalso be configured for *performance*.\n\nIt's difficult to produce general benchmark results for parser libraries. By their nature, the performance of a parser\nis intimately tied to exactly how the grammar they implement has been specified. That said, here are some numbers for a\nfairly routine JSON parsing benchmark implemented idiomatically in various libraries. As you can see, chumsky ranks\nquite well!\n\n| Ranking | Library                                              | Time (smaller is better) | Throughput |\n|---------|------------------------------------------------------|--------------------------|------------|\n| 1       | `chumsky` (check-only)                               | 140.77 µs                | 797 MB\u002Fs   |\n| 2       | [`winnow`](https:\u002F\u002Fgithub.com\u002Fwinnow-rs\u002Fwinnow)      | 178.91 µs                | 627 MB\u002Fs   |\n| 3       | `chumsky`                                            | 210.43 µs                | 533 MB\u002Fs   |\n| 4       | [`sn`](https:\u002F\u002Fgithub.com\u002FJacherr\u002Fsn) (hand-written) | 237.94 µs                | 472 MB\u002Fs   |\n| 5       | [`serde_json`](https:\u002F\u002Fgithub.com\u002Fserde-rs\u002Fjson)     | 477.41 µs                | 235 MB\u002Fs   |\n| 6       | [`nom`](https:\u002F\u002Fgithub.com\u002Frust-bakery\u002Fnom)          | 526.52 µs                | 213 MB\u002Fs   |\n| 7       | [`pest`](https:\u002F\u002Fgithub.com\u002Fpest-parser\u002Fpest)        | 1.9706 ms                | 57 MB\u002Fs    |\n| 8       | [`pom`](https:\u002F\u002Fgithub.com\u002FJ-F-Liu\u002Fpom)              | 13.730 ms                | 8 MB\u002Fs     |\n\nWhat should you take from this? It's difficult to say. 'Chumsky is faster than X' or 'chumsky is slower than Y' is too\nstrong a statement: this is just one particular benchmark with one particular set of implementations and one\nparticular workload.\n\nThat said, there is something you can take: chumsky isn't going to be your bottleneck. In this benchmark, chumsky is\nwithin 20% of the performance of the 'pack leader' and has performance comparable to a hand-written parser. The\nperformance standards for Rust libraries are already far above most language ecosystems, so you can be sure that\nchumsky will keep pace with your use-case.\n\nBenchmarks were performed on a single core of an AMD Ryzen 7 3700x.\n\n## Notes\n\nMy apologies to Noam for choosing such an absurd name.\n\n## License\n\nChumsky is licensed under the MIT license (see `LICENSE` in the main repository).\n\n## Provenance\n\nThis software is proudly and fondly written, maintained, used - and most crucially - **understood** by real human beings.\nWhile we can't personally attest to the provenance of every line of code ever contributed, the vast majority of the\ncodebase has certainly been developed without the aid of large language models and other stochastic 'intelligence'.\n\nWhile the license may not guarantee warranty 'of any kind', you can at least use this software in the comforting knowledge\nthat its veracity and coherence is vouched for by sentient intelligence with skin in the game and a reputation to uphold.\n\n## Contribution guidelines\n\nWe expect contributors to adhere to the ethos of the project.\n\nSource code is not an artifact, an intermediate representation, nor a bothersome annoyance whose creation is to be\noffloaded to metal and transistors. Source code is a **source of truth** - the only source of truth that constitutes this\nsoftware project - and it deserves to be understood and curated by the *accountable* and *reasoned* mind of a human being.\n\nPlease refrain from contributing changes that you have not personally understood and instigated the authorship of. We do\nnot expect perfection, but we do expect you to personally understand your own motivations and decisions.\n","Chumsky 是一个用于 Rust 的解析器库，旨在简化高性能解析器的编写。它提供了丰富的组合子来构建解析逻辑，支持零拷贝解析、灵活的错误恢复策略以及上下文无关文法等功能。Chumsky 适用于多种场景，如编译器前端开发、二进制协议解析、配置文件处理等复杂输入验证需求，并且由于其对 `no_std` 环境的支持，也非常适合嵌入式系统中的应用。此外，该库还具备内部优化器、模式标签等特性，帮助开发者创建高效且易于维护的解析器。",2,"2026-06-11 03:05:06","top_language"]