logo

blog

My website can't be that messy, right? git clone https://hacktivis.me/git/blog.git

utils-std-announce.xml (4598B)


  1. <entry>
  2. <title>Announcing utils-std: A collection of commonly available Unix tools</title>
  3. <link rel="alternate" type="text/html" href="/articles/utils-std-announce"/>
  4. <!--<published>2024-06-23T10:18:22Z</published>
  5. <updated>2024-06-23T10:18:22Z</updated>-->
  6. <!--<link rel="external replies" type="application/activity+json" href="https://queer.hacktivis.me/objects/7d2cd28e-7550-475c-ba13-28288a705297" />
  7. <link rel="external replies" type="text/html" href="https://queer.hacktivis.me/objects/7d2cd28e-7550-475c-ba13-28288a705297" />-->
  8. <content type="xhtml">
  9. <div xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en" class="h-entry">
  10. <p>
  11. Many years ago after being annoyed at both BusyBox and GNU coreutils, I started replacing few utilities like <code>true(1)</code>/<code>false(1)</code>, as well as <code>date(1)</code>.
  12. This was rather slow paced, merely replacing utilities when I wanted a better version of them.
  13. </p>
  14. <p>
  15. Then I picked up the pace after looking into full-source system bootstrapping.
  16. As I thought it would be pretty cool to get proper utilities easily, most importantly not require old versions for this kind of ordeal.
  17. Otherwise we could easily end up locking ourselves to both old operating systems and old CPU architectures/platforms.
  18. </p>
  19. <h2>Links</h2>
  20. <ul>
  21. <li><a href="https://hacktivis.me/git/utils-std/">Git repository</a></li>
  22. <li><a href="https://hacktivis.me/git/utils-std.mdoc/">Webview of the manpages</a></li>
  23. <li><a href="https://hacktivis.me/releases/utils-std/">Tarballs</a> (only snapshots for now)</li>
  24. </ul>
  25. <h2>The problems with GNU coreutils</h2>
  26. <p>
  27. Frankly I find GNU coreutils to be horrible.
  28. Yes, it's <code>cat(1)</code> and <code>yes(1)</code> implementations are so long and weird they became meme material but they're at least somewhat acceptable. The true pains are:
  29. <ul>
  30. <li><code>true --help &gt;/dev/full</code> and <code>true --version &gt;/dev/full</code> fails, so you can't rely on true as a no-op utility</li>
  31. <li>The <code>--date</code> option of GNU date is based on natural language processing, don't rely on it, you'll end up with nonsense results that at first sight could look fine instead of errors</li>
  32. <li><code>cut -c</code> doesn't works with multibytes codepoints (aka character runes). Working with characters rather than bytes (<code>-b</code>) is the whole reason <code>-c</code> exists…</li>
  33. <li>Awful manpages: <a href="https://manned.org/join.1">join(1)</a> and <a href="https://manned.org/paste.1">paste(1)</a> are barely described at all, <a href="https://manned.org/tsort.1">tsort(1)</a> is essentially a placeholder</li>
  34. <li><code>rm(1)</code> implementation is a mess, you end up with massive functions shared between utilities dealing with options logic and user-prompt parsing instead of separating functions per-fonctionality and having logic like user-prompts being their own functions</li>
  35. </ul>
  36. </p>
  37. <h2>Is utils-std entirely from scratch?</h2>
  38. <p>
  39. Nah. I picked up few utilities from FreeBSD/OpenBSD/NetBSD. I picked sha{1,256,…}sum from sbase, …<br />
  40. In fact part of why utils-std default license is the MPL-2.0 and not a GPL license is to be able to easily pick up code from other projects without some kind of license incompatibility problem.
  41. </p>
  42. <h2>But why not use BusyBox/Toybox/sbase/chimera-utils/… ?</h2>
  43. <h3>BusyBox/Toybox</h3>
  44. <ul>
  45. <li>Buildsystem heavily depends on GNU Make and GNU Bash</li>
  46. <li>Severely lacking. It's typical to install coreutils on Alpine systems to simply get POSIX fonctionality</li>
  47. <li>Stuck on reimplementing everything, specially ToyBox due to it's 0BSD licensing</li>
  48. <li>While there is a busybox manpage, it's equivalent to concatenated <code>--help</code> output, and a single manpage with 100+ utilities isn't easy to browse</li>
  49. </ul>
  50. <h3>sbase</h3>
  51. <ul>
  52. <li>Pretty good in terms of dependencies</li>
  53. <li>Also seems severely lacking, including against POSIX fonctionality</li>
  54. </ul>
  55. <p>
  56. I also don't really vibe with suckless.org ethos: Minimalistic to a degree where usability suffers, and code that I find lacking when it comes to error handling.
  57. </p>
  58. <h3>chimera-utils</h3>
  59. <ul>
  60. <li>Depends on at least meson/ninja, flex, byacc, libxo</li>
  61. <li>Soft-fork of FreeBSD utilities so even better than the baseline of POSIX fonctionality (although that can mean BSD-isms vs. GNU-isms)</li>
  62. </ul>
  63. <p>
  64. I would use it if the dependencies wouldn't mean breaking bootstrapping from source, and I would recommend it as an alternative, specially against BusyBox/Toybox/sbase.
  65. </p>
  66. </div>
  67. </content>
  68. </entry>