643 karma · joined July 20, 2008
We think that there's something weird about his Perl installation that is making it so slow, but we haven't been able to figure it out.
Here's the ticket: https://github.com/beyondgrep/ack3/issues/42
If you have any insight, we'd love to have it. We've been stumped, as you'll see if you read through the issue history.
Abundance vs. scarcity has nothing to do with “Believe and you shall receive... somehow”.
Scarcity thinking means that you fear giving people credit, and letting others have success. You fear that praising others makes you seem weak. You think that if someone uses a different open source project than yours, that you or your project suffers. You might not even be aware of the thinking. You might just feel it reflexively.
Abundance thinking says that there is more than enough praise to go around. It says that your success doesn't hurt me in mine (unless in some tangible way it does). It says that you can use ag and I can use ack and Susan can use ripgrep and it's all good.
In this specific case, abundance says that I, as the creator of ack, don't need to own the "market". In fact, the creation of other tools only helps ack. It gives the ack team ideas for things we can implement in ack. Who am I to think that I'm the only one with good ideas?
It gives our users a wider choice of tools. I put my work out there publicly to help people. Why would I not want them to have a variety to choose from?
That's abundance vs. scarcity.
Right now we're keeping all the data in a JSON file that we massage into a chart. Massaging it into a true feature comparison chart, along with a rosetta stone, should be a simple matter of programming. Same thing with the GNU/POSIX/BSD rosetta stone we're working on.
https://github.com/beyondgrep/website/blob/dev/comparison.js...
For me, raw speed is not as important as a rich feature set to support my code spelunking.
We're also working on a GNU grep vs. POSIX grep vs. BSD grep phrasebook.
Most importantly, that doesn't mean he's going to make Google a better place, or that his skills will be usable at Google.
One of the things I'm working on right now is a cookbook that will ship with ack 3, currently about thisclose from going to beta. I want to show examples of the magic powers and see how powerful it can be. Your comment reinforces in my mind that it's an important thing to have.
> I’m very glad that ack existed; it led the way with better tools, and I used it heavily for some years. Thanks for making it!
You're very welcome. I'm continually pleased to see what's come out after it. A search tool arms race is a good thing.
It's interesting how git grep makes the ack feature of "ignore your VCS dirs" not so important any more. I wonder how the grep-alike tool world would look if git weren't so dominant, and/or git didn't include its own grep.
I'm glad to see that ripgrep lets you define your own types. That ripgrep does it with globbing vs. the ways that ack allows is just another of the differences between the tools that people have to decide about.
Other reasons that you may want to use ack:
* You want to define your own filetypes
* You want to define your own output using Perl regexes
* You need the portability of an uncompiled tool in a single source file that you can drop into your ~/bin when you can't install or compile anything on the box.
* You don't want to have to deal with a Rust runtime.
If it does less work, and takes less time, then isn't that faster?
The three biggest reasons to use grepalikes is not necessarily the time to execute the search, but
1) The reduced amount of typing. It's much faster to type "ack foo --ruby" than it is to type "find . -name '* .rb' | xargs grep foo"
2) Better filetype matching, because ack and ag check things beyond just file extensions. ack's --ruby flag checks for *.rb and Rakefile and "ruby" appearing in the shebang line, for example.
3) More features that grep doesn't include, like better highlighting and grouping, or full Perl regular expressions (in ack) and a ton of other features.
Here's a command line to find all the header files in your C source. It takes advantage of the ability to use Perl's regular expressions to specify output:
ack --cc '#include <(.+?)>' -H --output='$1' | sort -u
Here's an article I wrote a while ago on comparing the features of ack and ag. https://blog.newrelic.com/2015/01/28/grep-ack-ag/
Even though I created ack, I don't care which tool you use, so long as it suits your needs and makes you happy, but if all you're using your grep/ack/ag for is "grep -R function_name ." then you're only scratching the surface of what the tools can do for you.
For most of the common ack flags, they are the same as grep. -i, -l, -v, -w, -A, -B, -C, etc. That was intentional, to minimize that whiplash.
One other suggestion is that you drop ack into your ~/bin directory that you sync between machines. It's a single Perl file, and that portability is a feature. As long as your machine has a Perl on it, you can use ack.
-i, --ignore-case
-v, --invert-match
-w, --word-regexp
-l, --files-with-matches
-L, --files-without-matches
-o
-m, --max-count=NUM
-H, --with-filename
-h, --no-filename
-c, --count
-A NUM, --after-context=NUM
-B NUM, --before-context=NUM
-C [NUM], --context[=NUM]That's one of the big features of ack that the find/grep combo can't replicate is checking the shebang of the file to detect type. In ack's case, Perl and shell programs are detected both by extension:
--type-add=perl:ext:pl,pm,pod,t,psgi
--type-add=shell:ext:sh,bash,csh,tcsh,ksh,zsh,fish
And by checking the shebang: --type-add=perl:firstlinematch:/^#!.*\bperl/
--type-add=shell:firstlinematch:/^#!.*\b(?:ba|t?c|k|z|fi)?sh\b/
Run `ack --dump` to see a list of all the definitions.I suggest that you need not limit yourself to only one tool for your code searching. Toolboxes FTW.
Exactly. There's no reason that you can't have grep AND ack AND ag in your toolbox to choose from.
That's not a knock on ag at all, and if ag fits your needs, then by all means use it.