Debian discusses vendoring again

This page summarizes the projects mentioned and recommended in the original post on /r/linux

Our great sponsors
  • WorkOS - The modern identity platform for B2B SaaS
  • InfluxDB - Power Real-Time Data Analytics at Scale
  • SaaSHub - Software Alternatives and Reviews
  • getopt

    POSIX getopt() as a portable header library (by skeeto)

  • Not only the GNU, you have an example in this thread where someone suggested to use or roll something similar to https://github.com/skeeto/getopt/blob/master/getopt.h, which, surprise, depends on strchr, a function that solves a much trivial problem than POSIX getopt, to begin with.

  • nixpkgs

    Nix Packages collection & NixOS

  • Even in nix this is awkward, as all dependencies need to be resolved to a fixed-output-derivation. https://github.com/NixOS/nixpkgs/blob/master/pkgs/development/node-packages/node-packages.nix It's awkward to add a node package because it takes a long time for it to pull all the dependencies, and even after creating the PR, you're likely to get merge conflicts with someone else doing a node PR.

  • WorkOS

    The modern identity platform for B2B SaaS. The APIs are flexible and easy-to-use, supporting authentication, user identity, and complex enterprise features like SSO and SCIM provisioning.

    WorkOS logo
  • ripgrep-all

    rga: ripgrep, but also search in PDFs, E-Books, Office documents, zip, tar.gz, etc.

  • Preprocessor hooks, which enables people to build things like ripgrep-all on top of ripgrep.

  • itoa

    Fast function for printing integer primitives to a decimal string (by dtolnay)

  • I see itoa which seems trivial on the surface. The implementation is highly optimized, but it's also covering all the different cases. I'm guessing this is for printing match counts or line numbers, and if this is actually a bottleneck for ripgrep — which seems unlikely — then maybe it's worth it. You know your own needs, and if it was a bottleneck, I bet you could do just as well, if not better, with a custom, smaller, simpler solution inside ripgrep. (i.e. just make sure the power-of-ten denominators are available at compile time so the compiler won't generate divisions.)

  • rust-base64

    base64, in rust

  • I see base64. If the standard library has base64 encoding, go ahead and use it. But as a third-party dependency? Again, base64 encoding and decoding is trivial. I've written this a few times myself. It's not worth a dependency.

  • rust-fnv

    Fowler–Noll–Vo hash function

  • Looking at ripgrep myself, I'm seeing some trivial dependencies. One is fnv. Perhaps you're not aware, but FNV-1a is literally ~4 lines of code. It's about as sophisticated as left-pad. I've written it from scratch a dozen times off the top of my head (the official offset basis and prime are really not special, so you can just generate your own). It would take you about a minute to eliminate it.

  • optparse

    Portable, reentrant, getopt-like option parser

  • This is bug-free and feature complete so it never needs to be updated. When I need argument parsing in a C program, I just copy-paste that into my source and massage it into place. Sometimes I cut the fprintf() stuff, or replace the isalnum, or otherwise adapt it to fit the program's needs. The point is that it becomes wholly owned by the project using it. It's a similar story for long option parsing.

  • InfluxDB

    Power Real-Time Data Analytics at Scale. Get real-time insights from all types of time series data with InfluxDB. Ingest, query, and analyze billions of data points in real-time with unbounded cardinality.

    InfluxDB logo
  • unicode-xid

  • Another is unicode-xid. The entire package is literally a constant lookup table. Again, I've embedded Unicode tables in my own programs a number of time. The original tables are machine-readable, and transforming them into code is so simple I usually don't even bother writing a script to do it, just an on-the-fly editor macro.

  • fst

    Represent large sets and maps compactly with finite state transducers.

  • Good catch. That's a lapse on my part. I typically would not use a crate for something like that. I've implemented fnv several times: here, here and here. Looks like I just didn't do that for globset.

  • ucd-generate

    A command line tool to generate Unicode tables as source code.

  • I've also embedded Unicode tables a number of times. It's very easy to do, and I do it enough that I even have a tool to do it. Having tooling and scripts to do it is important for reasons of provenance and also for when the tables need to be updated (every year or so).

  • perl5

    🐪 The Perl programming language

  • I agree. But just look at the regex crate as a case study. It is the inverse problem here, where it started out with no dependencies but eventually split code out of it into other crates, like regex-syntax and aho-corasick. That increases dependency count. I didn't bring those crates into regex written by other people. I wrote them (or parts of them) inside of regex and split them out so that others can use them. And they have. Should I have not done that? Or should have I just be like GNU grep and keep my aho-corasick implementation bottled up? Perl does it too! But in the Rust ecosystem, I don't have to do this. I can put it in its own crate and let others use it. This actually enables less code use because they might otherwise just use a regex to do what they need.

NOTE: The number of mentions on this list indicates mentions on common posts plus user suggested alternatives. Hence, a higher number means a more popular project.

Suggest a related project

Related posts