Live data from Hacker News

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

github.com

21–30 of 98 posts

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

#21
post #5

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

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("foo") && .contains("bar")}'
which has double the characters and also has the advantage of writing each pattern only once.

Okay, I haven't actually tried it (and the README doesn't say how to), and rak does have a bunch of features and capabilities ripgrep doesn't have, but those first examples are not very inspiring after the big initial claim.

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

#22
post #21
post #5

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

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.

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

#23
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.

It's phenomenal, is what it is. An extremely fast, recursive-by-default, general-purpose `grep` clone in Rust.

Alongside `fzf` and `fd` (a similar project for `find`) `rg` was what finally convinced me to put together a few shell scripts to bootstrap getting all my favorite modern command line tools on a new Ubuntu VM [1]. I'm working on an interactive playground you'll be able to SSH into to try it out yourself without even having to spin up your own, so you can see the difference with your own two eyes, no VM required.

[1]: https://github.com/hiAndrewQuinn/shell-bling-ubuntu

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

#24
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.

Yep, edited that in as you were commenting.

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

#25
post #4
post #3

Earlier quoted context omitted.

RegEx probably, since raku is perl 6 afaik.

Yeah it’s basically a language purpose made for matching text

It has evolved to be much, much more. It is a somewhat pragmatic, powerful, malleable multi-paradigm language that can be (has been) applied to many use cases beyond text processing. I am only vaguely familiar with the language, but I'm often impressed by examples of it's power and expressiveness.

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

#27
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.

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.

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

#28
post #21
post #5

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

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 §, then it indicates that the string should occur as a word (with word-boundaris on both ends) in the item. Basically a shortcut to specifying string --type=words. Any --smartcase, --smartmark, --ignorecase or --ignoremark arguments will be honoured.

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

#29
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: > §…

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

Post reply on HN