News for hackers. Stuff that matters.
Re:Show HN: A simple, fast and user-friendly alternative to ... by burntsushi on Sunday October 08, 2017 @04:45PM (#15429915)
> When I'm sshing into a box to figure out whats going on, my toolset is mostly limited to top, find, xargs, awk, grep, df, du etc.

I wrote some of the tools on coldtea's list, and I'm pretty much the same way in that I stick to distro tooling in vanilla setups. But I spend enough time on my local workstation that having "better" (read: creature comforts) is worth it there! But yeah, if you spend most of your time in vanilla setups, then tools not in the standard distro repos are a hard sell.

Re:Show HN: A simple, fast and user-friendly alternative to ... by jorvi on Sunday October 08, 2017 @06:16PM (#15430314)
What's strange to me is that some of these new incarnations use different syntax and/or flags. If those were the same you get the advantage of migraters not having to relearn anything. It also allows for the beauty of aliasing the new tool to the old name!
Re:Show HN: A simple, fast and user-friendly alternative to ... by burntsushi on Sunday October 08, 2017 @07:43PM (#15430643)
There is a very simple response to this: if ripgrep were a 100% drop-in replacement for something like GNU grep, then there would be basically no point for it to exist in the first place. The whole point is that it is very similar but does some things differently that a lot of people consider "better." I imagine this is truish for the other tools mentioned in this thread as well. (And still other tools, like xsv, have no pre-existing standard. Standard UNIX tooling doesn't work on CSV.)
Re:Show HN: A simple, fast and user-friendly alternative to ... by yorwba on Sunday October 08, 2017 @08:15PM (#15430746)
Have you considered making a "grep mode" for ripgrep? If it's triggered by the name of the binary, it could provide both the traditional flags as well as its own.
Re:Show HN: A simple, fast and user-friendly alternative to ... by burntsushi on Sunday October 08, 2017 @08:23PM (#15430770)
A couple of people have asked for it, but the ROI isn't worth it. Think about all the various POSIX compatibilities, locale support, subtle differences in flag meanings, supporting the different flavors of regex (BREs, EREs) and of course, all the various differences in the regex engine itself, such as leftmost-first vs leftmost-longest matching, and subcapture match locations as well.

I feel like people significantly underestimate the difficulty of being 100% compatible with another tool. Not even GNU grep is strictly POSIX compatible, for example. To get POSIX compatibility, you need to set the POSIXLY_CORRECT environment variable.

And then what do I gain from this? Do you think distros are going to start throwing away GNU grep for ripgrep? No, I don't think so. So what then? A few people will have the pleasure of using ripgrep with grep's flags, even though they are already significantly similar? Not. Worth. It.

Now... If someone does think it's worth it, then they are more than welcome to start that journey. Most of ripgrep is factored out into libraries, so in theory there is a lot of reuse possible. But if you want to support compatibility all the way down into the regex engine, then you might be hosed.

Re:Show HN: A simple, fast and user-friendly alternative to ... by SOLAR_FIELDS on Monday October 09, 2017 @05:32AM (#15432481)
Is POSIXLY_CORRECT supposed to be a play on “politically correct”? If so that’s pretty amusing.
Re:Show HN: A simple, fast and user-friendly alternative to ... by thristian on Monday October 09, 2017 @06:28AM (#15432692)
RMS' original convention for requesting GNU tools be compatible with questionable legacy behaviour was POSIX_ME_HARDER, but he toned it down as a gesture of goodwill to the other members of the POSIX committee.
Re:Show HN: A simple, fast and user-friendly alternative to ... by SOLAR_FIELDS on Monday October 09, 2017 @09:04AM (#15433430)
That’s so great and puts the variable name into even better context
Re:Show HN: A simple, fast and user-friendly alternative to ... by nitrogen on Monday October 09, 2017 @12:13AM (#15431534)
You could write yourself a wrapper that translates supported flags for you, then falls back to grep for anything weird.
Re:Show HN: A simple, fast and user-friendly alternative to ... by geezerjay on Wednesday October 11, 2017 @03:59AM (#15448031)
> if ripgrep were a 100% drop-in replacement for something like GNU grep, then there would be basically no point for it to exist in the first place.

That seems to miss a huge lesson: backward compatibility eases transition, new features retain users.

Therefore, your assertion makes only sense if there would be no point in attracting existing users to use a tool whose added value is entirely irrelevant.

Re:Show HN: A simple, fast and user-friendly alternative to ... by burntsushi on Wednesday October 11, 2017 @07:14AM (#15448800)
It doesn't miss any lesson. It's a trade off. The headline feature involves a default mode of operation that's fundamentally incompatible with GNU grep. Full stop.

ripgrep is an evolution on ag, which in turn is an evolution on ack. All three tools have similar defaults, so in fact, ripgrep preserves some amount of backward compatibility with previously established tools in terms of the default mode of operation. Just not GNU grep.

This goes further in that the intersection between ripgrep's features/flags and GNU grep's features is quite large---certainly much larger than the differences between them, which is just another form of preserving backward compatibility. This was done on purpose for exactly the lesson you're claiming I missed: backward compatibility eases transition.

(The context of this conversation was a 100% backward compatible version of ripgrep with GNU grep. See my other comments on ROI. Just because I can argue against 100% backward compatibility doesn't mean I've missed the importance of backward compatibility.)

Re:Show HN: A simple, fast and user-friendly alternative to ... by coldtea on Sunday October 08, 2017 @06:47PM (#15430467)
>If those were the same you get the advantage of migraters not having to relearn anything.

You'd also loose the ability to improve upon arcane/ad-hoc and obsolete flags and syntax choices though too.

And for the "same flags" to make any sense, you'd also be constrained to produce the same output and even recreate the same quirks.

At which point, might as well just use the originals.

Re:Show HN: A simple, fast and user-friendly alternative to ... by bm1362 on Sunday October 08, 2017 @09:39PM (#15431076)
I agree with you, the reason these new tools are useful is they’re much more intuitive than the esoteric flags that have built up over the last 30 years.
Re:Show HN: A simple, fast and user-friendly alternative to ... by j2kun on Sunday October 08, 2017 @05:44PM (#15430171)
Who makes the decision on what gets standardized into the distro?
Re:Show HN: A simple, fast and user-friendly alternative to ... by burntsushi on Sunday October 08, 2017 @05:45PM (#15430177)
The people in charge of the distro. Governance structures vary. And sometimes it's not just about who gets to decide, but also, the technical work required to do it. People need to put in the work to make Rust applications packageable according to the distro's standards. YMMV.
Re:Show HN: A simple, fast and user-friendly alternative to ... by IgorPartola on Sunday October 08, 2017 @08:24PM (#15430774)
This. And at some point enough of these alternatives might accumulate that a new distro will form using only the new tools. The issue is that most people don’t realize just how entrenched the existing tools are. They are a part of cross distro standards because often times they are used for scripting. Imagine a distro that decided to not ship ls in favor of exa. Ok it’s own this isn’t a problem at all. But combined with the overwhelming amount of FOSS you might want to install on top of your distro, you would suddenly need ls anyways.
Re:Show HN: A simple, fast and user-friendly alternative to ... by marcosdumay on Monday October 09, 2017 @09:34AM (#15433625)
Debian in particular has an entire alternatives system. Nothing stops somebody from creating the packages `nice_tools` and `select_nice_tools` that will install those tools and make them the default binaries for the commands.
Re:Show HN: A simple, fast and user-friendly alternative to ... by geezerjay on Wednesday October 11, 2017 @04:02AM (#15448045)
I would add that if a distro aims for Unix compliance, it's obvious that there is no alternative to include certain utils.