I heard of ripgrep, an amazing twenty-first century revolution that beats grep in the dust.
I have never seen grep source code. I told myself, if I download ripgrep-on-Rust and grep-on-C and find out that ripgrep is doing all it's doing in one-tenth the size of grep source code, or even half the code size, I'd be quite impressed, and be willing to take Rust seriously.
Well guess what, I downloaded the two sources. Grep source code is about 4k LoC. ripgrep? about 24k.
WTF.
I thought maybe I was mistaken. I went into the ripgrep source directory and started going through the individual subdirectories under 'crates'.
- printer: 4664
- core: 4561
- searcher: 4360
- ignore: 4321
If your printing code, and your searching code individually is the size of the whole machinery of grep, I feel sorry for you. If this is the state of the rewrite-everything gang, I can't take those guys and their language seriously. I just can't.
edit: to those who're saying ripgrep is more than grep. First, I know. Second, wouldn't it be great if someone could rewrite ripgrep in C? Now I'm really curious to find out the code-size complexity of all the ripgrep features backported to grep.