Live data from Hacker News

CLI: Improved

remysharp.com

151–160 of 280 posts

Re: CLI: Improved

#151

Noti looks nice, but typically I just do `whatever-long-command && tput bel`. On Macs, the Terminal dock icon bounces and gets a badge whenever the console bell rings and the terminal is in the background. https://apple.stackexchange.com/questions/47801/is-there-any...

This is one of my favorite tricks. The nice thing is that it still works if you’re ssh’ed into a remote host. If I’m feeling nostalgic I’ll do ‘... && say “files done”’ (which only works locally)

Re: CLI: Improved

#152
post #29

Is anyone else impressed with the quality (and speed!) of some of the tools written in Rust? I'm an avid user of fd and bat, the former being ridiculously fast. Often I find something on github, I'm impressed by the quality of the documentation, features, UI etc, then lo and behold it's written in Rust. Another one potentially for this list is tokei[1] I was trying to count the code in our repos at work and used the…

Since we're on the subject, I would ask this question I've been meaning to ask for a while. I love writing command line tools and I've written a few in Python but the performance isn't there. Would you suggest me to learn Rust in order to write CLI programs? I'm also looking at haskell for the same but after this thread, I'm really thinking of going the rust way. Ideas?

I personally would strongly recommend going the rust route having spent a decent amount of time learning Haskell. I think youll spend more time working on real problems and learn more about low level programming, in addition to the code being much faster.

Re: CLI: Improved

#153
post #29

Is anyone else impressed with the quality (and speed!) of some of the tools written in Rust? I'm an avid user of fd and bat, the former being ridiculously fast. Often I find something on github, I'm impressed by the quality of the documentation, features, UI etc, then lo and behold it's written in Rust. Another one potentially for this list is tokei[1] I was trying to count the code in our repos at work and used the…

Since we're on the subject, I would ask this question I've been meaning to ask for a while. I love writing command line tools and I've written a few in Python but the performance isn't there. Would you suggest me to learn Rust in order to write CLI programs? I'm also looking at haskell for the same but after this thread, I'm really thinking of going the rust way. Ideas?

I would say it depends on your goals. If performance is your primary concern, then go with rust, one of rust’s primary focuses is performance.

I don’t think of Haskell as the best language for command line dev, but I’m far from expert in either language.

Re: CLI: Improved

#154
post #53

Earlier quoted context omitted.

ag is made to search code specifically. grep is a more general purpose text search tool and better suited (imho) for handling data (in contrast to code). Also, it’s always installed. I’ve never been on a machine with ag unless if I’ve installed it myself.

Errmm, yes, I'm familiar with the difference in motivations behind the tools. I guess what I'm looking for is specific examples of things that cause you to use grep instead of ag. Ubiquity is a good one. But let's say you have both ag and grep. When do you reach for one and why? (I should have said this in my first comment, but I'm the author of ripgrep, and I'm just generally interested in learning more about the di…

Because ripgrep is the reason I discovered Rust (along with xsv for CSV manipulation) and because Andrew asked:

% grep "die()" * [...results with functions named die()...]

% rg "die()" Error parsing regex

I reach for grep when I need to do non-regex searching. Can't remember how to do an fgrep fixed-pattern style ripgrep.

great tools andrew: I use them every day and install them first thing on a new box. know that your code really helps

Re: CLI: Improved

#156
post #27

At the end of the article csvkit is given an honourable mention. I’m a big fan and I’ve used it a lot in the past, but these days I’d say that xsv > csvkit for working with CSV files on the command-line. https://github.com/BurntSushi/xsv

Totally agree on this. I've build heaps of production code using xsv. Far faster than csvkit and more features.

Re: CLI: Improved

#157
post #81

Earlier quoted context omitted.

Not the gp, but I generally use ripgrep when I want to find something manually, and regular grep in a script.

Why? Does ripgrep not work as well (or better) than grep in a script? And if so, why not? Or is because you deploy your scripts to other machines where ripgrep may not be present, but grep will?

I use rg on all my scripts that I won't be sharing with others. Anything that needs to be used by other people / needs to be run on any machine that I don't control, uses grep instead.

Re: CLI: Improved

#158
post #29

Is anyone else impressed with the quality (and speed!) of some of the tools written in Rust? I'm an avid user of fd and bat, the former being ridiculously fast. Often I find something on github, I'm impressed by the quality of the documentation, features, UI etc, then lo and behold it's written in Rust. Another one potentially for this list is tokei[1] I was trying to count the code in our repos at work and used the…

This could actually be caused by disk caching effects. Have you tried running cloc second time afterwards?

Re: CLI: Improved

#159
post #29

Is anyone else impressed with the quality (and speed!) of some of the tools written in Rust? I'm an avid user of fd and bat, the former being ridiculously fast. Often I find something on github, I'm impressed by the quality of the documentation, features, UI etc, then lo and behold it's written in Rust. Another one potentially for this list is tokei[1] I was trying to count the code in our repos at work and used the…

Since we're on the subject, I would ask this question I've been meaning to ask for a while. I love writing command line tools and I've written a few in Python but the performance isn't there. Would you suggest me to learn Rust in order to write CLI programs? I'm also looking at haskell for the same but after this thread, I'm really thinking of going the rust way. Ideas?

Also try cython.

Re: CLI: Improved

#160
post #106
post #94

Earlier quoted context omitted.

A more generous interpretation might be that Rust has sparked a CLI renaissance, since it lets developers write CLIs that have that satisfying zip that previously was only possible in C. None of PHP, Ruby or Java is responsive enough for a good CLI tool (also, static compilation is a must for wide deployment).

Not to mention you get a language that is enjoyable but also compiles to native code. My first Rust project was a Haml parser and I created a CLI for it too that is similar to the Ruby version. It is nice being able to ship the 8Mb executable and not have to worry about users having the right runtime.

Just like any other compiled language.

GCC's static linking issues with glibc don't apply to other compilers.

Post reply on HN