nix.dev icon indicating copy to clipboard operation
nix.dev copied to clipboard

nomenclature surrounding derivations

Open tejing1 opened this issue 3 years ago • 1 comments

There's a lot of ambiguity and confusion surrounding the terms "package" and "derivation" currently. It would be good to provide a consistent set of terminology in this book.

The current situation I see in the community:

  • "package" is vaguely used to refer to "derivations" (with all the multiplicity of meaning inherent there) which fit the intuitive notion of a package in more typical package managers.
  • "derivation" is used to refer to many distinct things in my experience:
    • nix files containing nix expressions invoking the derivation keyword or other functions which wrap it. These are further subdivided by the external interface the code in the file conforms to:
      • callPackage /path/to/file.nix { ... }
      • import /path/to/file.nix { ... }
      • import /path/to/file.nix
    • nix expressions invoking the derivation keyword or other functions which wrap it.
    • nix language values produced by the derivation keyword or other functions which wrap it.
    • *.drv files in the nix store generated from those expressions
    • the build process described by the *.drv file
    • the store object produced by the build process
    • the store path of that store object

We need to set some precedents about how we refer to these concepts. Some overloading is probably appropriate, but not this much.

tejing1 avatar Jul 17 '22 17:07 tejing1

  • Packaging/Package:

#292 mention Teaching Tech Together that says: Never hesitate to sacrifice truth for clarity. And Teaching Tech Together mention Hattie Effect Sizes, one of it points are -0.29 for non standard dialect use (that if I get it right is teacher speaking a language uncommon to students) and we usually speak 'academic dialects' where most of our students are more practical (street smart) than academical (book smart)

I wish, I never had to say 'derivation' to anyone.

  • "Derivation":
    • "nix file with derivations output": I have no idea what we could do here, but in fact is a 'different issue', unlike most programming, nix has a single output (there is a term for that?), for this reason we usually refer to the file as what we expect from it, I'm having this problem trying to explain Flake, a flake.nix file expects an attrset, but adding another node make it verbose... image
    • "nix expressions invoking the derivation", I think is the same, at least for console/repl
    • "nix language values", are the derivative?
    • "*.drv files", should be .drv files, like .nix files aren't nix', I would change to .lock
    • "the build process" should be the build process, but I think derivation make sense here.
    • "the store object" is the derivative?
    • the store path of that store object (that resemble to the first problem now would be derivative)

hugosenari avatar Nov 18 '23 02:11 hugosenari