aboutsummaryrefslogtreecommitdiff
path: root/doc
diff options
context:
space:
mode:
authoreldritch horrors <pennae@lix.systems>2024-03-04 07:37:45 +0100
committereldritch horrors <pennae@lix.systems>2024-03-04 07:37:45 +0100
commit6b279cd10ea82813decc4451fd3842b49ee9deea (patch)
treea88746796944a0d17294995bf54481f3ed6ad426 /doc
parentcd326a2aa4a5ad9118a56d2eff459c73b2ec9226 (diff)
Merge pull request #9658 from pennae/env-diet
reduce the size of Env by one pointer (cherry picked from commit 83f5622545a2fc31eb7e7d5105f64ed6dd3058b3) Change-Id: I5636290526d0165cfc61aee1e7a5b94db4a26cef
Diffstat (limited to 'doc')
-rw-r--r--doc/manual/rl-next/env-size-reduction.md7
-rw-r--r--doc/manual/rl-next/with-error-reporting.md31
2 files changed, 38 insertions, 0 deletions
diff --git a/doc/manual/rl-next/env-size-reduction.md b/doc/manual/rl-next/env-size-reduction.md
new file mode 100644
index 000000000..40a58bc28
--- /dev/null
+++ b/doc/manual/rl-next/env-size-reduction.md
@@ -0,0 +1,7 @@
+---
+synopsis: Reduce eval memory usage and wall time
+prs: 9658
+---
+
+Reduce the size of the `Env` struct used in the evaluator by a pointer, or 8 bytes on most modern machines.
+This reduces memory usage during eval by around 2% and wall time by around 3%.
diff --git a/doc/manual/rl-next/with-error-reporting.md b/doc/manual/rl-next/with-error-reporting.md
new file mode 100644
index 000000000..10b020956
--- /dev/null
+++ b/doc/manual/rl-next/with-error-reporting.md
@@ -0,0 +1,31 @@
+---
+synopsis: Better error reporting for `with` expressions
+prs: 9658
+---
+
+`with` expressions using non-attrset values to resolve variables are now reported with proper positions.
+
+Previously an incorrect `with` expression would report no position at all, making it hard to determine where the error originated:
+
+```
+nix-repl> with 1; a
+error:
+ … <borked>
+
+ at «none»:0: (source not available)
+
+ error: value is an integer while a set was expected
+```
+
+Now position information is preserved and reported as with most other errors:
+
+```
+nix-repl> with 1; a
+error:
+ … while evaluating the first subexpression of a with expression
+ at «string»:1:1:
+ 1| with 1; a
+ | ^
+
+ error: value is an integer while a set was expected
+```