News for hackers. Stuff that matters.
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.