nucleo
A plug-and-play, high-performance, multi-threaded fuzzy matcher library for Rust.
Repository Health
Technical Analysis
nucleo is a fast and convenient fuzzy matcher library for Rust, built by the Helix editor team and used as the fuzzy-matching engine inside Helix. It provides a high-level, plug-and-play API for interactive fuzzy finding: you push items into a matcher, update the search pattern, and get ranked results back, with matching parallelized across worker threads for responsiveness on large lists.
The crate is split into a high-level nucleo matcher that manages concurrency, incremental re-matching, and result ranking, and a lower-level nucleo-matcher crate that implements the core fuzzy-matching and scoring algorithm. Together they deliver the speed and match quality needed for editor-grade fuzzy pickers and command palettes.
What You Get
- A high-level
Nucleomatcher that manages worker threads and incremental matching - Ranked, deduplicated results that update as the search pattern changes
- The lower-level
nucleo-matchercrate for direct, allocation-conscious scoring - Smart-case and configurable matching semantics tuned for interactive use
- The same engine that powers fuzzy finding in the Helix editor
Common Use Cases
- Building interactive fuzzy pickers and command palettes in editors and TUIs
- Fuzzy-filtering large file, symbol, or command lists in real time
- Adding fast fuzzy search to CLI tools and desktop applications
Under The Hood
Architecture - The high-level crate (src/lib.rs) owns a Nucleo struct that fans matching work out to a rayon thread pool via src/worker.rs, storing items in a lock-free boxcar append-only vector (src/boxcar.rs) and ranking results with a parallel sort (src/par_sort.rs). Patterns are parsed and applied through src/pattern.rs, while the actual character-level scoring lives in the separate matcher crate (nucleo-matcher).
Tech Stack - Pure Rust (edition 2021) organized as a Cargo workspace with nucleo, nucleo-matcher, and a bench crate. Concurrency is built on rayon and parking_lot, and the low-level matcher is dependency-light for embeddability.
Code Quality - The workspace separates concerns cleanly between orchestration and scoring, includes an in-repo tests.rs, a dedicated bench crate for performance tracking, tarpaulin coverage configuration, and a typos check, reflecting a maintenance-conscious, editor-grade codebase.
API Design - The high-level API is deliberately plug-and-play: create a Nucleo, inject items, reparse the pattern on each keystroke, and read a ranked snapshot. Applications needing full control can depend on nucleo-matcher directly for a minimal scoring function without the concurrency machinery.