Skip to content

Commit bf65bc7

Browse files
Nix language reference: highlight characteristic features
Nix shipping with Yet Another Programming Language is often questioned among beginners. This change highlights distinctive aspects of the Nix language to ease the learning curve and better orient readers around what really matters for using Nix. Since it's on topic, this change also polishes the wording on the motivation for string contexts.
1 parent 3f3cc6f commit bf65bc7

File tree

2 files changed

+10
-3
lines changed

2 files changed

+10
-3
lines changed

doc/manual/source/language/index.md

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,14 @@ The language is:
1111

1212
- *domain-specific*
1313

14-
It comes with [built-in functions](@docroot@/language/builtins.md) to integrate with the Nix store, which manages files and performs the derivations declared in the Nix language.
14+
The Nix language is purpose-built for working with text files.
15+
Its most characteristic features are:
16+
17+
- [File system path primitives](@docroot@/language/types.md#type-path), for accessing source files
18+
- [Indented strings](@docroot@/language/string-literals.md) and [string interpolation](@docroot@/language/string-interpolation.md), for creating file contents
19+
- [Strings with contexts](@docroot@/language/string-context.md), for transparently linking files
20+
21+
It comes with [built-in functions](@docroot@/language/builtins.md) to integrate with the [Nix store](@docroot@/store/index.md), which manages files and enables [realising](@docroot@/glossary.md#gloss-realise) derivations declared in the Nix language.
1522

1623
- *declarative*
1724

doc/manual/source/language/string-context.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,8 @@ The purpose of string contexts is to collect non-string values attached to strin
1313
[string concatenation](./operators.md#string-concatenation),
1414
[string interpolation](./string-interpolation.md),
1515
and similar operations.
16-
The idea is that a user can combine together values to create a build instructions for derivations without manually keeping track of where they come from.
17-
Then the Nix language implicitly does that bookkeeping to efficiently obtain the closure of derivation inputs.
16+
The idea is that a user can reference other files when creating text files through Nix expressions, without manually keeping track of the exact paths.
17+
Nix will ensure that the all referenced files are accessible – that all [store paths](@docroot@/glossary.md#gloss-store-path) are [valid](@docroot@/glossary.md#gloss-validitiy).
1818

1919
> **Note**
2020
>

0 commit comments

Comments
 (0)