Live data from Hacker News

App::Rak – 21st century grep / find / ack / ag / rg on steroids

github.com

31–40 of 98 posts

Re: App::Rak – 21st century grep / find / ack / ag / rg on steroids

#31
post #28
post #21

Earlier quoted context omitted.

The README seems to make it clear that increased finger exercise is an advantage (steroids are used for increasing muscle mass, after all). Instead of just typing rg '\bfoo\b' you get to type rak '/ > /' and instead of just typing rg -B2 -A2 foo or rg -C2 foo you get to type rak foo --before=2 --after=2 (over double the characters!) and instead of just typing rg 'foo.*bar|bar.*foo' you get to type rak '{.contains("fo…

The examples are all undeniably verbose, but the source shows that many short options are also supported, specifically to copy those you would expect if migrating from the alternatives: https://github.com/lizmat/App-Rak/blob/main/lib/App/Rak.raku... So rak -C2 foo will do what you expect. [Edited to add] Also, the `\b...\b` form is shorter with rak - as the README also states where it documents this pattern form: > §…

> §string

> If the pattern starts with §,

Is it April 1st already?!

Re: App::Rak – 21st century grep / find / ack / ag / rg on steroids

#32
post #22
post #21

Earlier quoted context omitted.

The README seems to make it clear that increased finger exercise is an advantage (steroids are used for increasing muscle mass, after all). Instead of just typing rg '\bfoo\b' you get to type rak '/ > /' and instead of just typing rg -B2 -A2 foo or rg -C2 foo you get to type rak foo --before=2 --after=2 (over double the characters!) and instead of just typing rg 'foo.*bar|bar.*foo' you get to type rak '{.contains("fo…

rg -B2 -A2 foo can be written as rg -C2 foo although this does not underline your point as much.

Perhaps for further emphasis:

  grep -R -C2 foo .

Re: App::Rak – 21st century grep / find / ack / ag / rg on steroids

#33
post #7
post #2

This is my first time hearing about Raku (the language this tool is apparently written in), and after a quick look at the website[1], I am not sure why I would want to use Raku vs any other language in particular. According to the guide[2]: > Raku is a high-level, general-purpose, gradually typed language. Raku is multi-paradigmatic. It supports Procedural, Object Oriented, and Functional programming. That really doe…

I really like this post about Raku: "Raku : A Language for Gremlins" https://buttondown.email/hillelwayne/archive/raku-a-language...

A good bit of Raku looks like a language construction kit: Build your own little language, using Raku as a huge bag of tools.

Re: App::Rak – 21st century grep / find / ack / ag / rg on steroids

#34
post #15

Earlier quoted context omitted.

> raku is perl 6 It used to be, but not anymore. It has grown to be its own thing with some happenstance parenthood through being born from an early attempt at Perl 6, and thus is now only being slightly more related to Perl than e.g Ruby is. Ok I'm pushing it but you get the idea: taking a biological analogy, it has mutated away far enough that it is now considered to be its own strain. And if that helps clear some…

Well right, "perl 6" quickly became a bad name for the project - they should have switched to something like "raku" maybe 20 years ago. Given that, nobody got the memo, so calling it "perl 6" is still a very fast way to orient people as to what it's a neighbor of.

It's what happens when Larry Wall says "Hold My Beer" to ruby?

Re: App::Rak – 21st century grep / find / ack / ag / rg on steroids

#35
post #5

It's not clear from the README what advantages it offers over ripgrep.

> ripgrep Whait what's that? I'm stuck with ag and {a..z}grep.

To me, the two big things about ripgrep are (1) it's much more oriented towards the use case of searching a directory hierarchy full of code, eg by default it's recursive and respects .gitignore, it has a --type flag which knows various kinds of source files (eg --type c will only look at .c and .h files), etc, and (2) it's fast - uses all the lastest and greatest algorithms, and makes heavy use of parallelism. It's also just generally good and sensible.

Re: App::Rak – 21st century grep / find / ack / ag / rg on steroids

#36
post #20

Earlier quoted context omitted.

> ripgrep Whait what's that? I'm stuck with ag and {a..z}grep.

BurntSushi (dev) built a grep replacement, `rg` (ripgrep), in Rust, that tends to run circles in terms of speed around grep itself and other grep replacements. The UX is also pretty nice. I install it everywhere now. I'm curious (like others here) how `rak` is better than `rg`. https://github.com/BurntSushi/ripgrep

It is "better" in the sense that it uses Raku regexes, which are incredibly powerful, and if that's not enough for you, you can even write code. "rak" is giving you a general-purpose programming language (Raku) that is optimized for text processing, with convenient shortcuts for the most common tasks.

In contrast "rg" only designed to search text files, but it does that really really fast.

I makes sense to have both.

Re: App::Rak – 21st century grep / find / ack / ag / rg on steroids

#37
post #15

Earlier quoted context omitted.

> raku is perl 6 It used to be, but not anymore. It has grown to be its own thing with some happenstance parenthood through being born from an early attempt at Perl 6, and thus is now only being slightly more related to Perl than e.g Ruby is. Ok I'm pushing it but you get the idea: taking a biological analogy, it has mutated away far enough that it is now considered to be its own strain. And if that helps clear some…

Well right, "perl 6" quickly became a bad name for the project - they should have switched to something like "raku" maybe 20 years ago. Given that, nobody got the memo, so calling it "perl 6" is still a very fast way to orient people as to what it's a neighbor of.

Maybe a fast way but is it a fair or even helpful way, if you recognize that it "quickly became a bad name for the project"?

Re: App::Rak – 21st century grep / find / ack / ag / rg on steroids

#38
post #15

Earlier quoted context omitted.

raku is perl 6, it's just called "raku" now. Given that, it's 23 years old and done by Larry Wall so it's not exactly yet another fly-by-night hype language, just something that is not in the top 50.

> raku is perl 6 It used to be, but not anymore. It has grown to be its own thing with some happenstance parenthood through being born from an early attempt at Perl 6, and thus is now only being slightly more related to Perl than e.g Ruby is. Ok I'm pushing it but you get the idea: taking a biological analogy, it has mutated away far enough that it is now considered to be its own strain. And if that helps clear some…

It was Perl 6 from 2000 to 2019. It spent much more time as perl6 than it has as not-perl6.

Re: App::Rak – 21st century grep / find / ack / ag / rg on steroids

#39
post #27

Earlier quoted context omitted.

> ripgrep Whait what's that? I'm stuck with ag and {a..z}grep.

If you grep GB+ sized files, you'll love it. At my previous job I often ended up searching raw log files sized around 5-8GB. Regular grep would grind away for 50-60 seconds, while ripgrep returned the same results in 250ms. I was shocked the first time I used it and have sung it's praises since.

If you can afford it (these products tend to be expensive if they're doing it, and resource hungry if you're doing it, and sometimes both) and you've got logs in files, look at having the logs live in dedicated software.

I have used (at different places) Graylog and Splunk, New Relic is also popular.

Not that ripgrep isn't awesome, but you could have dedicated indexing and a UI that can be shown to non-technical or at least semi-technical people to review logs whereas "Just use ripgrep" really isn't accessible for most users.

Re: App::Rak – 21st century grep / find / ack / ag / rg on steroids

#40
post #29
post #28

Earlier quoted context omitted.

The examples are all undeniably verbose, but the source shows that many short options are also supported, specifically to copy those you would expect if migrating from the alternatives: https://github.com/lizmat/App-Rak/blob/main/lib/App/Rak.raku... So rak -C2 foo will do what you expect. [Edited to add] Also, the `\b...\b` form is shorter with rak - as the README also states where it documents this pattern form: > §…

Yes, I'm mainly complaining at the choice of examples, which don't seem to back up the claim of being "rg on steroids" at all. Typing § is not very easy on most keyboards, and is actually impossible on some keyboard-OS combinations (including mine): https://en.wikipedia.org/wiki/Section_sign#Keyboard_entry

Some diversity doesn't hurt, though. On my keyboard, it's actually easier to type than the backslash for starters.
Post reply on HN