News for hackers. Stuff that matters.
Re:Show HN: Tuc – When cut doesn’t cut it by shreve on Monday June 13, 2022 @12:04PM (#31727377)
I am in love with this trend of replacing old school unix utilities with new rust projects that stay just as fast or faster, but increase the usability or feature set tenfold. rg, fd, exa, bat, and now tuc.
Re:Show HN: Tuc – When cut doesn’t cut it by layer8 on Monday June 13, 2022 @12:25PM (#31727712)
The problem I see is that I don’t see those consolidating anytime soon into a new set of ubiquitous “core” utilities that can be expected to be available everywhere.
Re:Show HN: Tuc – When cut doesn’t cut it by humanwhosits on Monday June 13, 2022 @12:35PM (#31727873)
I guess it's just up to someone to set up the package on debian that contains all of these
Re:Show HN: Tuc – When cut doesn’t cut it by michaelmior on Monday June 13, 2022 @12:57PM (#31728210)
That doesn't solve the "available everywhere" problem. It potentially would make the tools easier to install on Debian-based systems, if you have root access. I'm not sure any new set of tools will ever be available with the ubiquity of coreutils in the next handful of years, if ever.
Re:Show HN: Tuc – When cut doesn’t cut it by jarbus on Monday June 13, 2022 @01:09PM (#31728387)
I agree. If these could be made installable without root, and independent of the current version of glibc, then there is huge potential to replace the older tools. I’d love to use things like fd, but they don’t work on older servers without root and a newer version of glibc
Re:Show HN: Tuc – When cut doesn’t cut it by tomjakubowski on Monday June 13, 2022 @01:17PM (#31728510)
They're already installable without root. Just put them in ~/.local/bin. Most Rust binaries are portable and only dynamically link libc.
Re:Show HN: Tuc – When cut doesn’t cut it by layer8 on Monday June 13, 2022 @01:55PM (#31728992)
Local installation is still not really a practical solution when you work e.g. on customer machines, on machines of another team, or generally if you work on many different machines. You still need to be aware of the standard tools and know how to use them when needed.

I mean, I get it — I used to locally install vim on machines that only had vi, to make my muscle memory be functional when editing files. But it’s not the same as a core tool just being available by default so you don’t have to ever concern yourself with any alternatives.

Re:Show HN: Tuc – When cut doesn’t cut it by jarbus on Monday June 13, 2022 @01:32PM (#31728692)
That’s what I initially tried for fd, but unfortunately glibc is required for it, and probably other utilities as well.
Re:Show HN: Tuc – When cut doesn’t cut it by homarp on Monday June 13, 2022 @02:00PM (#31729065)
Re:Show HN: Tuc – When cut doesn’t cut it by roey2009 on Monday June 13, 2022 @01:46PM (#31728872)
What would prevent us from adding those to a docker file?
Re:Show HN: Tuc – When cut doesn’t cut it by jarbus on Monday June 13, 2022 @01:52PM (#31728954)
Docker not being installed on remote
Re:Show HN: Tuc – When cut doesn’t cut it by moondev on Monday June 13, 2022 @04:49PM (#31731586)
This is why I like that you can "go run" golang programs without installing them. Anywhere golang is installed it will automatically build cache and run the binary for whatever platform you are on.

For example

   go run sigs.k8s.io/kind@latest create cluster
I wonder if something like this exists for rust
Re:Show HN: Tuc – When cut doesn’t cut it by PaulDavisThe1st on Monday June 13, 2022 @06:23PM (#31732515)
Absolute no possible exploit path there at all
Re:Show HN: Tuc – When cut doesn’t cut it by taftster on Monday June 13, 2022 @08:13PM (#31733288)
Unless you are reviewing the source of everything and compiling it all yourself, then you're executing someone else's binary.
Re:Show HN: Tuc – When cut doesn’t cut it by naniwaduni on Monday June 13, 2022 @07:21PM (#31732955)
Is it really an exploit when you're explicitly running code that you expressly trust (even if you probably shouldn't necessarily)?
Re:Show HN: Tuc – When cut doesn’t cut it by _carbyau_ on Monday June 13, 2022 @07:47PM (#31733120)
Isn't an exploit explicitly a subversion of trust?

If you shouldn't trust it but you do anyway and someone uses that against you - they exploited your trust.

Re:Show HN: Tuc – When cut doesn’t cut it by michaelmior on Tuesday June 14, 2022 @03:01AM (#31735626)
That is nice, but it still requires installation of golang which is obviously something that can't be guaranteed.
Re:Show HN: Tuc – When cut doesn’t cut it by steveklabnik on Monday June 13, 2022 @10:12PM (#31734051)
“cargo install” is the Rust equivalent.
Re:Show HN: Tuc – When cut doesn’t cut it by fragmede on Monday June 13, 2022 @03:58PM (#31730948)
There’s moreutils for an older rethink of the same set of utilities. I don’t see why an evenmoreutils wouldn’t eventually become popular enough to take hold? Probably not as quickly as you’d like in today’s world of instant gratification, but we’ll get there, eventually.
Re:Show HN: Tuc – When cut doesn’t cut it by michaelmior on Wednesday June 15, 2022 @04:14AM (#31750372)
moreutils is still nowhere near as ubiquitous as coreutils. For me it's not about gratification. It would be more satisfying to make use of the most modern tools available. It's about making sure stuff works and I find sticking to coreutils is the easiest way to do that most of the time.
Re:Show HN: Tuc – When cut doesn’t cut it by sitkack on Monday June 13, 2022 @11:02PM (#31734288)
Install rustup from https://rustup.rs/

    cargo install broot exa miniserve ripgrep tuc xh xsv zellij
Cargo is the package manager you are looking for.
Re:Show HN: Tuc – When cut doesn’t cut it by michaelmior on Tuesday June 14, 2022 @03:00AM (#31735617)
I use Cargo regularly and rustup it does make it easy to install. That's not the point. I'm not looking for a package manger. I want to be able to write scripts that make use of tools I can pretty much guarantee are already installed.
Re:Show HN: Tuc – When cut doesn’t cut it by sitkack on Tuesday June 14, 2022 @03:15PM (#31744557)
So we aren't talking past each other, how do you delineate between cargo and a package manager? Does anaconda, pip (pypi) or homebrew also qualify?

Your scripts could have a prolog that installs rustup and calls cargo.

There is also https://github.com/ryankurte/cargo-binstall

Even after 20 years of bashing, my bash skills still suck. So many corner cases!

But if you include this, and call install_utils at the head of your scripts. It should install the tools on demand.

    #!/bin/bash

    RUST_PACKAGE_LIST='rg xsv tuc broot du-dust dutree'
    RUST_UTIL_LIST='rg xsv tuc broot dust dutree'


    function is_cargo {
        cargo > /dev/null
    }


    function is_utils {
        eval "which $RUST_UTIL_LIST" > /dev/null
    }


    function install_utils {
        if ! is_utils ; then
            if ! is_cargo; then
                curl https://sh.rustup.rs -sSf | sh -s -- -y
            fi
            eval "cargo install --locked $RUST_PACKAGE_LIST" > /dev/null
        fi
    }
I don't recommend using this, it is just illustrative.
Re:Show HN: Tuc – When cut doesn’t cut it by michaelmior on Wednesday June 15, 2022 @03:55AM (#31750259)
My primary point is that if I stick to coreutils, I don't have to worry about any of this. I can reasonably expect anything in coreutils to already be installed and available. Your functions seem like they'll work just fine, but either requires build tools to be installed, or the package to support binstall. For me, thinking about all these things and maintaining something like that isn't worth it when I can just use coreutils.
Re:Show HN: Tuc – When cut doesn’t cut it by sitkack on Thursday June 16, 2022 @02:06AM (#31762899)
I totally understand. My .vimrc has shrunk from over a hundred lines to 4 lines in the last years. But I really think you are doing yourself a disservice. It is easier than ever (homebrew, nix, cargo, pip) to get nice software everywhere.
Re:Show HN: Tuc – When cut doesn’t cut it by throwamon on Monday June 13, 2022 @01:57PM (#31729012)
Have you tried running them with Nix? I believe you can use most things from it without root, but I'm not sure.
Re:Show HN: Tuc – When cut doesn’t cut it by michaelmior on Monday June 13, 2022 @02:40PM (#31729683)
I suppose I shouldn't have said only Debian. But having tools easily installable is still quite different from being able to reasonably assume they are already installed.
Re:Show HN: Tuc – When cut doesn’t cut it by GuB-42 on Monday June 13, 2022 @10:05PM (#31734015)
I wonder how well Rust project get along with Debian packaging tools.

"Modern" dev environments are often tied to their own package manager. JS has Npm, Rust has Cargo, etc... These have their own dependency managers, version systems, etc... and they don't always get along with the way Linux package managers work.

IIRC, you don't even need Cargo to do Rust, so it should be possible to compile Rust projects like you compile C projects and essentially mirroring crates.io but with .deb packages but it looks like a lot of work.

Re:Show HN: Tuc – When cut doesn’t cut it by steveklabnik on Monday June 13, 2022 @10:11PM (#31734045)
Debian packages individual cargo packages/crates as their own Debian packages, and also applications that then depend on them.

https://packages.debian.org/stable/rust/

https://crates.io/crates/cargo-deb exists but I don’t know if Debian uses it or something else.

Re:Show HN: Tuc – When cut doesn’t cut it by krylon on Monday June 13, 2022 @02:05PM (#31729120)
coreutils-ng? It would be nice to have a bunch of these in one package.
Re:Show HN: Tuc – When cut doesn’t cut it by smartmic on Monday June 13, 2022 @05:34PM (#31732076)
It's easy to fall in love with someone who is young, hip and all that. When it comes done to work on my loved UNIX systems though, I still prefer to stay with the old-school tools given by coreutils et. al. They are a quasi-standard, I can rely on them and I always know what to expect. Better yet, I will find them on every system and can reduce my mental load to learn and internalize something new. Sure, they're not perfect, but these advantages trump the disadvantages, and it's all worked out pretty well for decades. Here, I don't have to chase the next bride.
Re:Show HN: Tuc – When cut doesn’t cut it by hinkley on Monday June 13, 2022 @06:20PM (#31732497)
And yet, bash eventually replaced bourne shell (by having an sh-compatibility mode), and vim has replaced vi.

If you get anywhere in the neighborhood of a proper superset of the old application, we do occasionally retire the old ones.

Re:Show HN: Tuc – When cut doesn’t cut it by pdimitar on Monday June 13, 2022 @07:00PM (#31732809)
I can say exactly the opposite and I have the collection of shell scripts to prove it -- the newish tools work better for me when doing a ton of scripting tasks.

So maybe don't project about "hip" or "young" because it does your otherwise decent argument a disservice.

Re:Show HN: Tuc – When cut doesn’t cut it by tambourine_man on Monday June 13, 2022 @06:50PM (#31732737)
>It's easy to fall in love with someone who is young, hip and all that

>Here, I don't have to chase the next bride.

Who hurt you? :)

Re:Show HN: Tuc – When cut doesn’t cut it by carlhjerpe on Monday June 13, 2022 @12:08PM (#31727455)
I use rg, exa, bat, and zellij as my "rust replaced old stuff". Zellij isn't yet as polished as I'd like it, but it's way more intuitive than tmux.
Re:Show HN: Tuc – When cut doesn’t cut it by hultner on Monday June 13, 2022 @12:44PM (#31728022)
Oh god, is tmux considered “old stuff” now? I barely finished replacing my screens.
Re:Show HN: Tuc – When cut doesn’t cut it by carlhjerpe on Monday June 13, 2022 @05:33PM (#31732053)
I actually started with screen, but I only used it for daemonising some foreground processes, I work in Zellij daily.
Re:Show HN: Tuc – When cut doesn’t cut it by tomjakubowski on Monday June 13, 2022 @01:19PM (#31728535)
It happens to all of us. Did you know Interstellar came out eight years ago?
Re:Show HN: Tuc – When cut doesn’t cut it by apgwoz on Monday June 13, 2022 @05:25PM (#31731968)
The names of these utilities are bad. I have literally no idea what any of them do. The same could be said for standard unix utilities, true, but they have 50+ years (in some cases) of brain bake in, and have the advantage of names that have _some_ relation to their function (ls : list files :: exa : “extract the list of files from a dirent?”)
Re:Show HN: Tuc – When cut doesn’t cut it by mcronce on Monday June 13, 2022 @09:41PM (#31733870)
At some point you have to accept that if you want to know something, you have to learn it. At one point, you didn't know grep, awk, sed, etc... And then you learned them.

Or you can just stick with the old tools if you prefer not learning a new thing - that's a perfectly valid option.

Re:Show HN: Tuc – When cut doesn’t cut it by carlhjerpe on Monday June 13, 2022 @05:31PM (#31732034)
Does it really matter though? You can just alias them over the originals or something close-by.
Re:Show HN: Tuc – When cut doesn’t cut it by apgwoz on Monday June 13, 2022 @08:15PM (#31733300)
Yes, you can do that. But that exasperates the system portability problem. The real solution is for some distro to, gasp, decide that POSIX compatibility can be done with utilities in /opt/posix (or something) and do widespread replacement by default. But that’ll never happen…
Re:Show HN: Tuc – When cut doesn’t cut it by carlhjerpe on Tuesday June 14, 2022 @03:18AM (#31735737)
In your scripts you can use "/usr/bin/env cat" to get whichever version of cat is first in your PATH. NixOS abuses this to an almost silly level :)
Re:Show HN: Tuc – When cut doesn’t cut it by tomjakubowski on Monday June 13, 2022 @01:19PM (#31728530)
Usually you have to install tmux on a remote machine anyway, so Zellij seems like a good one of these to try.
Re:Show HN: Tuc – When cut doesn’t cut it by krylon on Monday June 13, 2022 @02:07PM (#31729139)
OpenBSD ships tmux in the base system. I would be very pleased if more systems did this.
Re:Show HN: Tuc – When cut doesn’t cut it by jeppesen-io on Monday June 13, 2022 @06:05PM (#31732375)
You can say that again. After using rg for a few years now, I can't imagine not having this tool, that I use weekly, if not daily
Re:Show HN: Tuc – When cut doesn’t cut it by memorable on Monday June 13, 2022 @08:33PM (#31733431)
Same here with `exa` and `bat`