Architecture of burntsushi/ripgrep
burntsushi/ripgrep is 137 source files holding 4,791 symbols across 7 modules, written mainly in Rust, Python, Ruby. The largest module is crates, with 101 files, and 7 files are entry points into the dependency graph.
How ripgrep fits together
Execution begins in crates/core/main.rs, one of the five entry points, and the command-line side is handled in crates/cli/src/lib.rs. The crates directory holds 101 of the 137 files and is split into separate crates with their own Cargo.toml manifests. The ignore and globset crates provide the file filtering that respects gitignore rules. crates/grep/src/lib.rs and crates/matcher/src/lib.rs are entry points for the search and matching layers, and crates/pcre2/src/lib.rs is a separate entry point for the pcre2 crate. Dependencies include memchr, aho-corasick, memmap and encoding_rs.
Largest modules
- crates: 101 files and 33,240 lines of code
- root: 10 files and 3,855 lines of code
- tests: 10 files and 4,154 lines of code
- .github: 6 files and 703 lines of code
- benchsuite: 3 files and 1,132 lines of code
- fuzz: 3 files and 70 lines of code
- pkg: 2 files and 30 lines of code
- .cargo: 1 file and 20 lines of code
Languages
By file count: Rust 94 files, Python 2 files, Ruby 1 file.
More on ripgrep: summary and FAQ, codebase overview, code health.
Related guide: Best dependency graph tools for monorepos