lix/src/libexpr
Eelco Dolstra c4ac2a164a * The recent change in nixpkgs of calling `stdenv.mkDerivation'
instead of `derivation' triggered a huge slowdown in the Nix
  expression evaluator.  Total execution time of `nix-env -qa' went up
  by a factor of 60 or so.

  This scalability problem was caused by expressions such as

    (x: y: ... x ...) a b

  where `a' is a large term (say, the one in
  `all-packages-generic.nix').  Then the first beta-reduction would
  produce

    (y: ... a ...) b

  by substituting `a' for `x'.  The second beta-reduction would then
  substitute `b' for `y' into the body `... a ...', which is a large
  term due to `a', and thus causes a large traversal to be performed
  by substitute() in the second reduction.  This is however entirely
  redundant, since `a' cannot contain free variables (since we never
  substitute below a weak head normal form).

  The solution is to wrap substituted terms into a `Closed'
  constructor, i.e.,

    subst(subs, Var(x)) = Closed(e) iff subs[x] = e

  have substitution not descent into closed terms,

    subst(subs, Closed(x)) = Closed(x)

  and otherwise ignore them for evaluation,

    eval(Closed(x)) = eval(x).

* Fix a typo that caused incorrect substitutions to be performed in
  simple lambdas, e.g., `(x: x: x) a' would reduce to `(x: a)'.
2004-03-30 15:05:35 +00:00
..
eval.cc * The recent change in nixpkgs of calling `stdenv.mkDerivation' 2004-03-30 15:05:35 +00:00
eval.hh * Use a map to lookup primops. 2004-02-04 16:03:29 +00:00
lexer.l * Added plain lambdas, e.g., `let { id = x: x; const = x: y: x; }'. 2004-03-28 20:34:22 +00:00
Makefile.am * Allow linking against an external Berkeley DB / ATerm library. 2004-02-16 16:37:16 +00:00
nixexpr.cc * The recent change in nixpkgs of calling `stdenv.mkDerivation' 2004-03-30 15:05:35 +00:00
nixexpr.hh * Use a map to lookup primops. 2004-02-04 16:03:29 +00:00
parser.cc * Extended the `inherit' syntax to optionally select attributes from 2004-02-04 17:23:26 +00:00
parser.hh * Use a map to lookup primops. 2004-02-04 16:03:29 +00:00
parser.y * Added an operator `?' to test for attribute existence, e.g., 2004-03-28 21:15:01 +00:00
primops.cc * Added an operator `~' to select paths within a derivation. E.g., 2004-03-28 20:58:28 +00:00
primops.hh * Use a map to lookup primops. 2004-02-04 16:03:29 +00:00