News for hackers. Stuff that matters.
Re:Show HN: A simple, fast and user-friendly alternative to ... by bm1362 on Sunday October 08, 2017 @04:41PM (#15429897)
I appreciate all these new incarnations of old school tools but end up sticking with the basics regardless. 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. Even local development now, I'm mostly debugging on a docker container running alpine or ubuntu.

Knowing the right incantations is useful in that context and keeps me from installing better tools until they become part of the distro we deploy with.

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.
Re:Show HN: A simple, fast and user-friendly alternative to ... by coldtea on Sunday October 08, 2017 @04:56PM (#15429951)
>I appreciate all these new incarnations of old school tools but end up sticking with the basics regardless. 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.

That's why I wrote about it being nice to have them all in distros -- perhaps in a single package like coreutils.

Then wherever you are, they'd be just a "package-manager install rustutils" away.

Generally, if one is not an admin of random hodgepodge of systems (e.g. in big enterprises), then you are:

(1) doing work on your own workstation

(2) administering machines you control the provision (e.g. a person administering a startup's Cloud servers)

(3) doing development on some kind of vm

In those cases you can quite easily install a bundle package and make sure those tools are there.

I, for one, don't go out in unknown systems day after day -- even if we have 100s of servers we manage, we DO manage them.

Re:Show HN: A simple, fast and user-friendly alternative to ... by bm1362 on Sunday October 08, 2017 @05:27PM (#15430090)
Just my experience, I'm sure there are other types of organizations. In most of my workplaces, having one developer's preferred tools installed as a build step might not pass review. I would be annoyed if fish was installed on all our prod boxes, for example.

I'm glad these tools work for you and I hope the community keeps making them, I just threw in my perspective.

Re:Show HN: A simple, fast and user-friendly alternative to ... by jhasse on Sunday October 08, 2017 @05:33PM (#15430114)
> I would be annoyed if fish was installed on all our prod boxes, for example.

Why?

Re:Show HN: A simple, fast and user-friendly alternative to ... by bm1362 on Sunday October 08, 2017 @06:01PM (#15430234)
That was just a hyperbolic example, but I can think of a few superficial reasons:

1. Because you end up with a more complex Dockerfile. I've seen curls, clones etc during build - having a remote call for random tools in our build _feels_ like a bad practice.

2. There is also the issue that a fleet of application servers will have different tooling available, which can be frustrating in a pinch. I've done some gnarly things across many hosts, expecting a common set of tools. At AWS, we were responsible for non-nuclear team's services during oncall and would ssh to their boxes. Logging into a box with a different shell would be annoying.

[2] > for i in `cat hosts.txt`; do ssh $i '...'; done

Re:Show HN: A simple, fast and user-friendly alternative to ... by Tyr42 on Monday October 09, 2017 @09:33AM (#15433617)
I mean you wouldn't need to set fish as the default shell. But even if it was, you could `do ssh $i "bash -c '...'";`
Re:Show HN: A simple, fast and user-friendly alternative to ... by giancarlostoro on Sunday October 08, 2017 @05:59PM (#15430226)
Wondering the same when you consider you don't have to login to fish as the default shell, it's all set per user. Even so, they can just turn it on once they log on.
Re:Show HN: A simple, fast and user-friendly alternative to ... by HankB99 on Sunday October 08, 2017 @06:35PM (#15430404)
'fish' I take it is a shell (of which I remain ignorant.) I suppose that at the very least, it increases the attack surface on an installation and either makes security harder or the system less secure.
Re:Show HN: A simple, fast and user-friendly alternative to ... by dozzie on Sunday October 08, 2017 @07:07PM (#15430541)
Why would you run build step on production servers at all?
Re:Show HN: A simple, fast and user-friendly alternative to ... by coldtea on Sunday October 08, 2017 @07:57PM (#15430684)
Production servers can mean a lot of things, not necessarily just "servers running a web service".

For companies whose main activity is processing data, various build pipelines (not necessarily compiles) might be what production servers do all day.

Re:Show HN: A simple, fast and user-friendly alternative to ... by bm1362 on Sunday October 08, 2017 @09:37PM (#15431068)
I think I wasn’t clear, but a lot of people are harping on the specific use case I glibly mentioned.

To answer you, I meant on a Docker image build step- which is where you’d want to install the tool so it’s accessible to people debugging the application during the container run context.

Re:Show HN: A simple, fast and user-friendly alternative to ... by cstrahan on Monday October 09, 2017 @02:13AM (#15431860)
A potential solution that would allow you to have your cake (SSH into wherever) and eat it too (have your favorite tools on hand) would be: use a package manager on your hosts that allows for safe installation of per-user packages (that is, such package installation should have absolutely no effect on the system outside of the user’s environment. A logical implication here is that it should be possible to use multiple versions of each package, both inter- and intra-user) and per-user package installation should not require special privileges (i.e. you shouldn’t need to be root if, as per the previous requirement re: safety, per-user package installation has no effect on the rest of the system). Then you could log in and do your work with the best tools you know, rather than being constrained to what your distro (or your servers’ admins) deems useful enough to be installed by default.

It strikes me as an odd choice to accept the least common denominator of tools. As a technologist, that sounds frustrating. And as someone in leadership, I can’t imagine hamstringing my team by making them work within an environment that won’t let them use the best tools for the task at hand.

Re:Show HN: A simple, fast and user-friendly alternative to ... by foo101 on Sunday October 08, 2017 @10:32PM (#15431218)
What surprises me is that even after 25 years of the Internet, we cannot bring in new tools into our environment (be it a remote box I ssh into or a trimmed down docker image) on the fly.

The popular package management tools rely heavily on FHS and like to install stuff into directories that require root permission.

Imagine if there was a tool that could download binaries of modern tools from a certain repo and install it to our ~/bin. Imagine if we could use new command line tools as easily as we can download a fully functional complex applications securely into a browser tab just by typing its URL!

Re:Show HN: A simple, fast and user-friendly alternative to ... by laumars on Monday October 09, 2017 @02:20AM (#15431887)
You can. There's nothing stopping you adding ~/bin to $PATH. Many compilers allow you to specify the destination location either via a ./configure flag (for example) or an environmental variable. Or there is always the option of doing a `make build` and then manually copying the binaries into your ~/bin directory without doing a `make install`

You can also add ~/lib (for example) to your LD_LIBRARY_PATH path if you wanted to install custom libraries and even have your own man page path too.

All of this is already possibly on Linux and Unix however I'm not sure it's something you actively want to encourage as allowing users to install whatever they want on servers lowers the security to the level of the worst user on that server. If it was really deemed necessary that users should be able to install whatever they want then I'd sooner roll out a dedicated VM per user so at least their damage is self-contained (barring any visible networked infrastructure)

Re:Show HN: A simple, fast and user-friendly alternative to ... by coldtea on Monday October 09, 2017 @04:24AM (#15432262)
>You can. There's nothing stopping you adding ~/bin to $PATH. Many compilers allow you to specify the destination location either via a ./configure flag (for example) or an environmental variable.

Of course you can, technically. The parent laments why it's not easier to achieve. Already you're talking about manually building for example. Where's a package manager that will allow for that too, not just the central repo? (not just asking if such manager exists in some form, asking where it is in modern popular distros).

>All of this is already possibly on Linux and Unix however I'm not sure it's something you actively want to encourage as allowing users to install whatever they want on servers lowers the security to the level of the worst user on that server.

Which also touches the parent's question. Why is it not easier AND safer? It's not like we don't have security models that allow for such things...

Re:Show HN: A simple, fast and user-friendly alternative to ... by hnlmorg on Monday October 09, 2017 @04:06PM (#15437027)
The GP had exampled one easier and safer way of doing this: sandbox each user in their own Linux instance.

Anything short of that would be sacrificing security for the sake of convenience.

Re:Show HN: A simple, fast and user-friendly alternative to ... by foo101 on Monday October 09, 2017 @08:46AM (#15433337)
This is precisely what I am forced to do and I do this very often when I have to setup my environment in a remote box I don't have root-login too. But this is by no means a trivial process compared to how easily we load a complex app into a browser tab just by clicking a URL.

I think it is fair to hope that after 25 years of Internet, it should be easy to bring in new tools from the Internet into our local environment without requiring root access in a safe and trivial manner.

Re:Show HN: A simple, fast and user-friendly alternative to ... by laumars on Monday October 09, 2017 @05:55PM (#15437805)
Firstly the internet is a lot older than 25 years (perhaps you mean web?) and secondly if the last 25 years has taught us anything it's that allowing users to download and install whatever they want usually leads to problems. I mean I do get your point and even sympathise with it, to a point. But if someone needs SSH access and I don't trust them enough to put them in the sudoers file, then I'm not going to trust them enough to even choose what software to install and run from their own local user area. I've been burnt before from intelligent people doing stupid things because they thought they knew what they were doing. So if you're not a sysadmin and you're logging into a shared host, then you don't get install rights. I don't think that's an unreasonable stance to take.
Re:Show HN: A simple, fast and user-friendly alternative to ... by thristian on Monday October 09, 2017 @06:30AM (#15432702)
Nix[1] says hi.

[1]: https://nixos.org/nix/

Re:Show HN: A simple, fast and user-friendly alternative to ... by zzzcpan on Monday October 09, 2017 @06:53AM (#15432803)
Nix now can download and install binaries into a home directory? I thought it would require quite a bit of work on a building process and binary patching post installation, since you know, a lot of things require absolute paths, like an elf interpreter for example.
Re:Show HN: A simple, fast and user-friendly alternative to ... by Sean1708 on Monday October 09, 2017 @09:19AM (#15433520)
As far as I'm aware any user (regardless of whether they have root) can install/update/delete packages when Nix is run in multi-user mode[0].

[0]: https://nixos.org/nix/manual/#ch-nix-security

Re:Show HN: A simple, fast and user-friendly alternative to ... by marcosdumay on Monday October 09, 2017 @09:39AM (#15433656)
The NixOS way would be to install binaries at the system directories, but for your user only.

I don't know if this is possible with plain Nix (not the OS).

Re:Show HN: A simple, fast and user-friendly alternative to ... by marcosdumay on Monday October 09, 2017 @09:38AM (#15433645)
The problem is that after 25 years of the Internet, we have almost completely stopped using multi-user systems.

It even used to be easier to make stuff run from your homedir. We are moving from it, not towards it. It is really a shame for the few multi-user setups out there.

Re:Show HN: A simple, fast and user-friendly alternative to ... by wruza on Sunday October 08, 2017 @11:26PM (#15431391)
sudo chown -R user:user /usr, that’s what you effectively suggest. Also convince tool makers to provide ppas.
Re:Show HN: A simple, fast and user-friendly alternative to ... by on_and_off on Sunday October 08, 2017 @09:23PM (#15431023)
I love exa and have just mapped it to ls (and ll for exa -l ) .

That way I don't even have to learn the new command (or risk forgetting about ls / be frustrated when I can't use it).