-
-
Notifications
You must be signed in to change notification settings - Fork 1.7k
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
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -31,9 +31,22 @@ | |
|
||
The industry term for storage and retrieval systems using [content addressing](#gloss-content-address). A Nix store also has [input addressing](#gloss-input-addressed-store-object), and metadata. | ||
|
||
- [derivation]{#gloss-derivation} | ||
|
||
A derivation can be thought of as a [pure function](https://en.wikipedia.org/wiki/Pure_function) that produces new [store objects][store object] from existing store objects. | ||
|
||
Derivations are implemented as [operating system processes that run in a sandbox](@docroot@/store/building.md#builder-execution). | ||
This sandbox by default only allows reading from store objects specified as inputs, and only allows writing to designated [outputs][output] to be [captured as store objects](@docroot@/store/building.md#processing-outputs). | ||
Comment on lines
+38
to
+39
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I don't see why need this text here. These details can go in the chapter on derivations. The glossary entry is supposed to be an extremely short description that links to the chapter. |
||
|
||
A derivation is typically specified as a [derivation expression] in the [Nix language], and [instantiated][instantiate] to a [store derivation]. | ||
There are multiple ways of obtaining store objects from store derivatons, collectively called [realisation][realise]. | ||
|
||
[derivation]: #gloss-derivation | ||
|
||
- [store derivation]{#gloss-store-derivation} | ||
|
||
A single build task. | ||
A [derivation] represented as a [store object]. | ||
|
||
See [Store Derivation](@docroot@/store/derivation/index.md#store-derivation) for details. | ||
Comment on lines
46
to
50
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This is not how "store derivation" is defined in that chapter. Rather the thing the glossary now calls "derivation" (the abstract concept) is called "store derivation". We need to make things consistent. I would rather just always say "derivation" and drop the "store " part everywhere, but I am open to other options. |
||
|
||
[store derivation]: #gloss-store-derivation | ||
|
@@ -50,10 +63,7 @@ | |
|
||
- [derivation expression]{#gloss-derivation-expression} | ||
|
||
A description of a [store derivation] in the Nix language. | ||
The output(s) of a derivation are store objects. | ||
Derivations are typically specified in Nix expressions using the [`derivation` primitive](./language/derivations.md). | ||
These are translated into store layer *derivations* (implicitly by `nix-env` and `nix-build`, or explicitly by `nix-instantiate`). | ||
A description of a [store derivation] using the [`derivation` primitive](./language/derivations.md) in the [Nix language]. | ||
|
||
[derivation expression]: #gloss-derivation-expression | ||
|
||
|
Uh oh!
There was an error while loading. Please reload this page.
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.
This is not true because a function maps many possible arguments to results (many possible inputs) but a derivation has a specific set of inputs.
A derivation that depends on the outputs of another derivation is closer to being a function, because we don't know what those outputs are at the time of creating the derivation, but even this needs more explaining.
I think it would be better to say a derivation is a function application than a function. since it is applying a function-in-our-heads to some inputs.