by nurettin · 7y ago · 0 comments
ripgrep is a Rust version of grep. It's the fastest grep I know and it has better Unicode support than GNU grep (because of Rust language decisions).
Looking at memory safety and portability it might also be a good idea to program them in Rust. There are whole classes of bugs that are excluded in Rust which still pop up every once in a while in some of our basic system tools.
I for one am very happy with tools such as ripgrep and fd which are more or less just rewrites of decades old programs but are much faster and have generally better though out interfaces.
Or doing this:
https://jugad2.blogspot.com/2015/07/no-thanks-we-are-too-bus...
e.g. ripgrep is faster and makes better use of available hardware (concurrency, SIMD) than grep – thanks to Rust.
This seems specious. If I started a grep implementation from scratch in C{,++}, it isn't clear to me that I couldn't achieve the same (or better) results as ripgrep. Comparing a totally rewritten program to one designed decades ago and concluding 'without Rust, we wouldn't have this faster program with better hardware use' doesn't seem quite right.
I have, though, said in the past that I wouldn't have written ripgrep without Rust, which is a very different claim and is opinionated, and mostly a statement about developer productivity and maintenance burden. With Rust, it is very easy to keep ripgrep's trains running across Windows, macOS and Linux.
Exa, ripgrep, fd, bat, broot, ruplacer
And more...
And I'm totally impartial, being the author.
Joke apart, as I've been told broot was being mentioned here, I'm available if you have any question. I'll do a SHOW-HN post some day but I'm currently postponing it because of a bunch of new features in the making.
Reference: https://github.com/Canop/broot
I've got this in my .zshrc:
alias ls='lsd'
alias tree='lsd --tree'Tangent, but man is that a bad name for a CLI tool. Had to add a lot of keywords to not get drugs-related pages.
Though yes, many computer-thing names are bad in the search department.
rg "^SECRET"
Find nothing. Try to contact someone who is asleep for half an hour, then they tell me they put it in there. grep -r "^SECRET" .
yep, it is there, in an .env file. "Uhh yeah sorry I was using ripgrep and it doesn't search hidden files by default but it has a flag for it" "you wut?" "nevermind, thanks bye." <- that is ripgrep. Maybe we got off on the wrong foot.Anyway thanks for listing all the tools you're great.
> Like other tools specialized to code search, ripgrep defaults to recursive directory search and won't search files ignored by your .gitignore files. It also ignores hidden and binary files by default.
nurettin@ ~ () $ mkdir test
nurettin@ ~ () $ echo "TEST SOMETHING" > test/.env
nurettin@ ~ () $ cd test
nurettin@ ~/test () $ rg "TEST"
Why I don't know, because it has grep in the name? Do you now realize where the confusion might be lying?These kinds of claims are much more interesting to me personally.
[1] https://hacks.mozilla.org/2019/02/rewriting-a-browser-compon...
Modularity was not the issue. Complexity combined with concurrency was. Rust’s compile time checks was what made it feasible to be so aggressive without the bugs.