Live data from Hacker News

Bsdutils: Alternative to GNU coreutils using software from FreeBSD

github.com

41–50 of 85 posts

Re: Bsdutils: Alternative to GNU coreutils using software from FreeBSD

#41
post #3

There’s a Rust coreutils too.

Some utils are faster already, and they are working on cp and mv progress bars. From the fosdem 2023 presentation: https://sylvestre.ledru.info/presentations/coreutils-fosdem-...

== Example #1:

$ hyperfine -r 10 \ "target/release/coreutils sort -R shakespeare.txt > shakespeare.txt.rand; \ target/release/coreutils sort shakespeare.txt.rand > /dev/null" \ "sort -R shakespeare.txt > shakespeare.txt.rand; \ sort shakespeare.txt > /dev/null" é [...] Summary 'target/release/coreutils sort -R shakespeare.txt > shakespeare.txt.rand; target/release/coreutils sort shakespeare.txt.rand > /dev/null' ran 4.63 ± 0.19 times faster than 'sort -R shakespeare.txt > shakespeare.txt.rand; sort shakespeare.txt > /dev/null'

To be fair, we can be slower too

Example #3:

$ hyperfine "seq 18446744073708551615 18446744073709551615 | factor" \ "./target/release/coreutils seq 18446744073708551615 18446744073709551615| ./target/release/coreutils factor" [...] 'seq 18446744073708551615 18446744073709551615 | factor' ran 5.08 ± 0.01 times faster than './target/release/coreutils seq 18446744073708551615 18446

===

Redox-OS is rewriting the BSD coreutils in Rust for their own OS. https://github.com/redox-os/coreutils

I wonder what the most efficient and usable alternative operating system tradeoff choice tradeoff would be, perhaps mesalock (a linux with userspace tools compiled with rust)

syllable, haiku, redox, menuet64/kolibri, serenity, icaros desktop, postmarketos, drauger, mesalock

Re: Bsdutils: Alternative to GNU coreutils using software from FreeBSD

#43
post #7

If I was going to replace coreutils, I think I'd do it with the ones rewritten in rust.

I tried some of those but I'm not a fan of the frilly stuff they add by default to the outputs. I was having a hard time with the output of one of these rust tools (I think it was an ls replacement) that was pretty printing and tabulating stuff. Its nice to read I agree but it was a pain to copy and paste outputs and the option for a normal output was not default.

I think you’re conflating different projects.

There are projects that aim for a better user experience, with better command line interface, defaults, performance and UI. These are of course breaking changes and the programs can’t be used as drop in replacements. Some examples are

- ls => exa (https://github.com/ogham/exa)

- grep => ripgrep (https://github.com/BurntSushi/ripgrep)

- cat => bat (https://github.com/sharkdp/bat)

- tree => broot (https://github.com/Canop/broot)

The person you’re replying to was speaking of a different project - uutils (https://github.com/uutils/coreutils). These are drop in replacements with identical interfaces (modulo bugs).

Re: Bsdutils: Alternative to GNU coreutils using software from FreeBSD

#44

What would be an advantage of switching from GNU coreutils to BSD coreutils? Doesn't GNU utils have more features?

Stability, readable code and unchanging flags. GNU project code is infamously cluttered and hard to grok (mostly since it's a pretty old codebase and GNU has always favored having too many chefs in the kitchen over fewer, but competent, chefs). FreeBSD code is also usually much more stable than the Linux counterparts; tends to be less buggy from my experience at least. GNU also has gotten in the habit over the years…

> GNU also has gotten in the habit over the years of randomly shifting flags around for no real reason other than to make sure that they stay as the coreutils.

Sounds like they've been studying the works of The Enemy ;)

Re: Bsdutils: Alternative to GNU coreutils using software from FreeBSD

#45
post #30

Earlier quoted context omitted.

GPL v3 is unsable for embedded/locked hardware, e.g. Macbook, Android phones. That's why Mac OS and Android dodged GPL v3 software.

How so? If Apple chose to distribute GNU cat, they'd need to release any modifications to cat under the GPL but the license's vitality would not "infect" the rest of OSX. Plenty of GPL software is available on osx.

Available and used by Apple themselves are two very different things.

Re: Bsdutils: Alternative to GNU coreutils using software from FreeBSD

#46
post #25

Earlier quoted context omitted.

Yeah. Just look what they got from that. Big corps using their work with hardly any upstream contribution (Apple, Sony, etc). At this rate BSDs will be deader than dead within a few years.

I don't know about you, but I can't eat code. That said, some people don't care about outside contributions or reuse, so I guess I find the pro-GPL partisanship more than a little misguided. Some people just have different goals, and that doesn't make them better or worse, just different.

And a project can't survive without the code.

And even then companies are famous for leeching on open source projects, with gpl you at least have some hope of companies leaving you alone or giving back something.

Re: Bsdutils: Alternative to GNU coreutils using software from FreeBSD

#47
post #25

Earlier quoted context omitted.

Yeah. Just look what they got from that. Big corps using their work with hardly any upstream contribution (Apple, Sony, etc). At this rate BSDs will be deader than dead within a few years.

I don't know about you, but I can't eat code. That said, some people don't care about outside contributions or reuse, so I guess I find the pro-GPL partisanship more than a little misguided. Some people just have different goals, and that doesn't make them better or worse, just different.

And that's the reason for their downfall.

Re: Bsdutils: Alternative to GNU coreutils using software from FreeBSD

#48
post #43

Earlier quoted context omitted.

I tried some of those but I'm not a fan of the frilly stuff they add by default to the outputs. I was having a hard time with the output of one of these rust tools (I think it was an ls replacement) that was pretty printing and tabulating stuff. Its nice to read I agree but it was a pain to copy and paste outputs and the option for a normal output was not default.

I think you’re conflating different projects. There are projects that aim for a better user experience, with better command line interface, defaults, performance and UI. These are of course breaking changes and the programs can’t be used as drop in replacements. Some examples are - ls => exa ( https://github.com/ogham/exa ) - grep => ripgrep ( https://github.com/BurntSushi/ripgrep ) - cat => bat ( https://github.com/…

You are right it was exa and I was conflating projects.

Re: Bsdutils: Alternative to GNU coreutils using software from FreeBSD

#49

Earlier quoted context omitted.

>> How is letting me know that apple can use it without contributing back going to affect my decision on which coreutil to use? Apple using those utilities could be a good thing. I've used MS PowerShell and WSL a bit, and their implementations of common CLI software is sometimes incompatible. To work around the incompatibilities you end up using proprietary features or doing something inferior. I would be better if t…

> I've used MS PowerShell and WSL a bit, and their implementations of common CLI software is sometimes incompatible Are you implying that Microsoft would use the common CLI software interfaces if GNU coreutils weren't GPL? Because I deeply believe they wouldn't. Embrace, extend, extinguish.

They already ship curl. In doubt the license is the thing stopping it, but there is some precedent here.

WSL (v2) is just a fancy wrapper around a Linux VM though, so the tools you get there are from the distro, not Windows.

Re: Bsdutils: Alternative to GNU coreutils using software from FreeBSD

#50
post #31

Earlier quoted context omitted.

> MIT license How is letting me know that apple can use it without contributing back going to affect my decision on which coreutil to use?

>> How is letting me know that apple can use it without contributing back going to affect my decision on which coreutil to use? Apple using those utilities could be a good thing. I've used MS PowerShell and WSL a bit, and their implementations of common CLI software is sometimes incompatible. To work around the incompatibilities you end up using proprietary features or doing something inferior. I would be better if t…

> I've used MS PowerShell

I like the idea of setting some variable somewhere, and the Rust Coreutils output JSON, and we can use 'select' and 'where' rather than shaky scraping libraries.

Post reply on HN