Skip to content

Float out ExprSelect to larger scope #9592

Open
@roberth

Description

Is your feature request related to a problem? Please describe.

Current evaluator performance slightly favors

let inherit (lib) foo;
in f foo foo foo;

instead of

f lib.foo lib.foo lib.foo

Actually writing out the let binding can be perceived as a chore, and having to think about it, or ask for it in lib maintenance is not ideal.

Describe the solution you'd like

Perhaps perform this transformation behind the scenes.
In some cases, the transformation may be a clear win. What would be the algorithm that determines this? Is it fast enough to perform eagerly?

Describe alternatives you've considered

Keep operational semantics as is. Memory use will be slightly more predictable. File loading remains fast. Code remains simple.

Additional context

Priorities

Add 👍 to issues you find important.

Metadata

Assignees

No one assigned

    Labels

    featureFeature request or proposallanguageThe Nix expression language; parser, interpreter, primops, evaluation, etcperformance

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions