top | item 45508141

(no title)

Crespyl | 4 months ago

I've been using bat for several years and it's been a really nice drop-in replacement for cat/less/etc.

Like rg, it's one of those "rewrite it in rust" projects that turned out to actually be quite well thought through.

discuss

order

oncallthrow|4 months ago

"rewrite it in rust" gets a lot of hate, but generally the people rewriting things in Rust actually give a shit, which tends to pay dividends. I say this as someone who doesn't use Rust and doesn't particularly like it or its community.

hnlmorg|4 months ago

People who wrote the coreutils give a shit too.

The reason “rewrite in Rust” gets a lot of hate is because it’s often a poorer replica in that it supports a subset of features and sometimes so littered with unsafe blocks that it’s barely any safer than their C counterparts.

Ripgrep and bat are the exceptions in that they’re modernisations in every sense of the term. They’re safer, have more modern features, and better defaults. Even if you don’t give a crap about memory safety, there’s a reason to use ripgrep and bat.

Personally I really don’t see the benefit in rewriting stuff unless you’re bringing other modernisations to the table too. But I suspect for some people, it’s more of an exercise to learn Rust than it is an ambition to displace a particular coreutil.

soraminazuki|4 months ago

bat isn't really a rewrite though. It complements cat and less rather than replace them, and it even uses less. Or maybe it's a rewrite of lesspipe.sh?

ajkjk|4 months ago

does... it... get a lot of hate? I've only ever heard of it positively.

tetris11|4 months ago

I use it on and off, but for the life of me can't get over the issue that line wrapping is the default behaviour with no easy switch

rascul|4 months ago

the --wrap options don't do it for you?

Olshansky|4 months ago

100%. I'd add fd to the list as well.

baby|4 months ago

Check exa

stouset|4 months ago

The original author appears to have abandoned exa, but it has continued life as eza.

KerrAvon|4 months ago

yeah, exa is a very convincing argument

it replaces default `ls` in interactive shells on some distros, which is where I encountered it