7 ms·
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" project
by Crespyl 11mo 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.
- oncallthrow 11mo 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.
- ajkjk 11mo agodoes... it... get a lot of hate? I've only ever heard of it positively.
- DonaldPShimoda 11mo agoIf you hang around certain spaces of the internet (here, Reddit, etc), any sufficiently popular post about a Rust-related project is bound to accrue some comments along the lines of "Rust is actually not that great", "rewriting is bound to gain new bugs that won't be caught", "the borrow checker is practically byzantine and not worth the trouble", "C is perfectly adequate", "more advanced type systems are less useful than writing more tests", etc. I would even say that comments of this nature constituted a good chunk of the discussion around the US government's C-to-Rust initiative (a very popular post with a lot of comments).
- lenkite 11mo agoThe Rust Blowback had some reasons: People arbitrarily opening bug-tickets on various projects saying they should be Rewritten in Rust for Safety. This became a Meme.
- burntsushi 11mo agoJust like some highly publicized cases of child kidnapping led to "stranger danger." Reasons, yes. But not very good ones and blown way out of proportion.
- DonaldPShimoda 11mo agoIn my experience, the majority of negative responses are rooted in fundamental misunderstandings of type systems and expressive power. The vast majority of everyday programmers are pretty much only familiar with Java or TypeScript when it comes to statically typed languages, and it can be hard to get people with that background to understand or appreciate the substantial increase in capability that systems like Rust's provide. (The issue is further exacerbated, in my opinion, by the prevailing notion that test-driven development is superior to — or at least generally more than adequate for — anything and everything that could be desired. Years ago there was a tense Twitter exchange between Bob Martin [of "Clean Code" note] and Shriram Krishnamurthi [a prominent programming languages researcher and professor at Brown University] on this topic, Martin seemingly unwilling to move past a TDD-oriented worldview at that time.)
- ajkjk 11mo agoAh maybe it's an another example of people using Twitter and the conflating the brainrot on there with reality.
- nine_k 11mo agoIt's often framed as useless monkey business, rewriting working software to produce a copy of it but in another language, for questionable benefits. I'd say that rewriting anything in any language (even in the same language) would remove large amounts of cruft, and add long-missing neat things that are easier to add when you build from scratch, and with a good understanding which the original authors lacked. Often it also can afford using a better architecture, see rg vs grep: grep has many brilliant technical solutions, but making it multithreaded would be a major rewrite anyway.
- pityJuke 11mo agoAlong with everything else mentioned, there is a certain group of people who consider the language “woke”. Usually that’s not the critique you see on HN, but be wary of it.
- ajkjk 11mo agoWell that's laughable so probably not worth thinking about.
- hnlmorg 11mo agoPeople 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.
- sureglymop 11mo agoI have no issue with rewriting the coreutils in rust technically but I also don't think it's that interesting. They work just fine as they are. However what I truly don't understand is using a different license. For something so fundamental, please just let that be the same. But I think there are a lot more great examples. I have used pandas and I like polars. I have used latex but I like typst. People are creating generally valuable tools that bring something new to the table. More competition and diversity is rarely a bad thing.
- steveklabnik 11mo agoMIT/Apache2 is the default in the Rust ecosystem, and so the authors selected it because they didn’t care that much, and so going with the community default makes sense. In practice, even if they’d chosen the GPL for their own code, they’d be including dependencies that weren’t GPL’d, so unless they were committing to doing everything from scratch (including the Rust standard library!) some parts of the codebase would be non-GPL’d.
- em-bee 11mo agoso unless they were committing to doing everything from scratch (including the Rust standard library!) some parts of the codebase would be non-GPL’d. that doesn't matter. the point of the GPL is to protect the application. that still happens even if libraries used are not GPL. the LGPL would not exist if that were an issue, so using a different more restrictive license for applications, and a less restrictive one for libraries is done intentionally.
- soraminazuki 11mo agobat 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?
- 3836293648 11mo agoBat just pipes itself into less, it doesn't peimplement any paging
- soraminazuki 11mo agolesspipe.sh isn't a pager but a preprocessor for less that does syntax highlighting among other things. https://github.com/wofr06/lesspipe https://github.com/wofr06/lesspipe
- tetris11 11mo agoI 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 11mo agothe --wrap options don't do it for you?
- baby 11mo agoCheck exa
- Olshansky 11mo ago100%. I'd add fd to the list as well.
- rossant 11mo agoIs there a list somewhere of these nice, modern drop-in replacements for standard bash tools?
- kermatt 11mo agoThe "awesome" lists on Github can be useful for discovery. Ex.: https://github.com/agarrharr/awesome-cli-apps https://github.com/agarrharr/awesome-cli-apps