Earlier quoted context omitted.
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.
App::Rak – 21st century grep / find / ack / ag / rg on steroids
41–50 of 98 posts
Re: App::Rak – 21st century grep / find / ack / ag / rg on steroids
#42Re: App::Rak – 21st century grep / find / ack / ag / rg on steroids
#43Re: App::Rak – 21st century grep / find / ack / ag / rg on steroids
#44Very cool! It looks like Rak has a lot of nice features.
I will say that getting this thing built took some digging. Could you please add install/build instructions to the README? As it is, I had to go sleuthing through your CI setup to figure it out. On Archlinux, here's what I did:
$ yay -S rakudo-bin
$ export PATH="/usr/share/perl6/site/bin:$PATH"
$ git clone https://github.com/lizmat/App-Rak
$ cd App-Rak
$ zef install .
$ export PATH="$HOME/.raku/bin:$PATH"
I realize features and an expressive language is your main goal, but I wanted to see what it looked like from a perf perspective: $ git remote -v
origin git@github.com:rust-lang/rust (fetch)
origin git@github.com:rust-lang/rust (push)
$ git rev-parse HEAD
699f4a637ef382ea0716c72f60d0c1c4cd79df41
$ time rg accelerated --files-with-matches
compiler/rustc_target/src/spec/thumbv7em_none_eabi.rs
src/llvm-project/lldb/source/Plugins/LanguageRuntime/ObjC/AppleObjCRuntime/AppleObjCTrampolineHandler.cpp
src/llvm-project/llvm/docs/PDB/HashTable.rst
real 0.126
user 0.544
sys 0.850
maxmem 22 MB
faults 0
$ time rak accelerated --files-with-matches
compiler/rustc_target/src/spec/thumbv7em_none_eabi.rs
src/llvm-project/lldb/source/Plugins/LanguageRuntime/ObjC/AppleObjCRuntime/AppleObjCTrampolineHandler.cpp
src/llvm-project/llvm/docs/PDB/HashTable.rst
real 17.005
user 2:07.88
sys 8.866
maxmem 1565 MB
faults 0
I'm not totally clear on what kind of filtering `rak` does by default, so I also ran a search on a single plain text file: $ cd /dev/shm
$ curl -LO https://burntsushi.net/stuff/opensubtitles/2018/en/sixteenth.txt.gz
$ gunzip sixteenth.txt.gz
$ time rg 'Sherlock Holmes' sixteenth.txt -c
426
real 0.068
user 0.047
sys 0.020
maxmem 778 MB
faults 0
$ time rg 'Sherlock Holmes' sixteenth.txt -c --no-mmap
426
real 0.089
user 0.026
sys 0.063
maxmem 14 MB
faults 0
$ time rak 'Sherlock Holmes' sixteenth.txt --count-only
426 matches in 1 file
real 48.236
user 48.010
sys 0.334
maxmem 215 MB
faults 0
$ time grep 'Sherlock Holmes' sixteenth.txt -c
426
real 0.297
user 0.233
sys 0.063
maxmem 14 MB
faults 0Re: App::Rak – 21st century grep / find / ack / ag / rg on steroids
#45There is problem with nice modern Linux tools - they are not available on the generic servers and embedded boxes with you will likely use, or in the image someone else has given you etc. Therefore it is pointless (sorry for the strong term) to learn them, because they simply won't be available for when they are most needed. And learning new tools is not a free process, there are costs, mental and time.
Even though I'm the author of ripgrep, believe it or not, I still use grep in those 5% of cases without any kind of fuss.
Re: App::Rak – 21st century grep / find / ack / ag / rg on steroids
#46Earlier quoted context omitted.
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
#47Author of ripgrep here. Very cool! It looks like Rak has a lot of nice features. I will say that getting this thing built took some digging. Could you please add install/build instructions to the README? As it is, I had to go sleuthing through your CI setup to figure it out. On Archlinux, here's what I did: $ yay -S rakudo-bin $ export PATH="/usr/share/perl6/site/bin:$PATH" $ git clone https://github.com/lizmat/App-R…
Re: App::Rak – 21st century grep / find / ack / ag / rg on steroids
#48There is problem with nice modern Linux tools - they are not available on the generic servers and embedded boxes with you will likely use, or in the image someone else has given you etc. Therefore it is pointless (sorry for the strong term) to learn them, because they simply won't be available for when they are most needed. And learning new tools is not a free process, there are costs, mental and time.
Re: App::Rak – 21st century grep / find / ack / ag / rg on steroids
#49We're still busy excising the 90's replacement for awk ...
Re: App::Rak – 21st century grep / find / ack / ag / rg on steroids
#50Earlier 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: > §…
> §string > If the pattern starts with §, Is it April 1st already?!
I wonder if keyboards in the future will settle on a way to provide access to more characters, than is currently common.