-
-
Notifications
You must be signed in to change notification settings - Fork 1.6k
glossary: re-introduce "derivation" #12994
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Conversation
a5b1629
to
f3a37d4
Compare
doc/manual/source/glossary.md
Outdated
A derivation can be thought of as a [pure function](https://en.wikipedia.org/wiki/Pure_function) that produces new files from existing files, taking into account how these files refer to each other. | ||
|
||
In Nix, linked files are represented as [store objects][store object]. | ||
Derivations are implemented as [operating system processes that run in a sandbox](@docroot@/store/building.md#builder-execution). |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe this can be phrased more concisely as something like
A derivation can be thought of as a [pure function](https://en.wikipedia.org/wiki/Pure_function) that produces new files from existing files, taking into account how these files refer to each other. | |
In Nix, linked files are represented as [store objects][store object]. | |
Derivations are implemented as [operating system processes that run in a sandbox](@docroot@/store/building.md#builder-execution). | |
A derivation is an operating system process that produces store objects from other store objects. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That's essentially what I started with, but it lacks the distinctive characteristics of derivations (approximate pure functions by memoizing sandboxed execve calls). Otherwise readers will rightfully wonder why one would bother, since makefiles and build scripts also describe how to invoke processes that produce files (and may as well produce store objects if instructed).
Also, before jumping right into store objects we need a bit of context to pick up readers from what they already know: files. But again, the distinctive property of store objects is that they introduce references between these files. I'm trying to avoid the glossary term "reference" though, because that would be skipping ahead.
Most importantly, we're not saying anywhere what exactly it is that makes Nix (the store model) purely functional, but where else would one put it if not here?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If we do this, we should just replace "store derivation". I left it last time as a compromise, but I don't think there is any definition of "derivation" distinct from "store derivation".
@Ericson2314 interesting, I thought store derivations are a certain representation of the abstract notion of a derivation. Nothing says derivations are required to be store objects. |
The store derivation section just sends the reader to |
The "derivation" is one of the key concepts and captures the most distinctive aspect of Nix: that we work with a certain type data (linked files) in a certain manner (using pure functions). Here we finally arrange all the important pieces to show how they belong together, while referring to the respective reference documentation for details. This change also unbreaks downstream links to `//glossary#gloss-derivation`, which had been broken by removing the glossary entry
c8166b2
to
8db8371
Compare
Motivation
The "derivation" is one of the key concepts and captures the most distinctive aspect of Nix:
that we work with a certain type data (linked files) in a certain manner (using pure functions).
Context
Here we finally arrange all the important pieces to show how they belong
together, while referring to the respective reference documentation for details.
This change also unbreaks downstream links to
//glossary#gloss-derivation
,which had been broken by removing the glossary entry
Add 👍 to pull requests you find important.
The Nix maintainer team uses a GitHub project board to schedule and track reviews.