Extra strictness for constants #746

Open
opened 2025-03-18 11:46:15 +00:00 by raito · 2 comments
Owner

CppNix decided to adopt extra strictness for constants, usually, it can create some issues but here, the idea is to have:

({ foo ? bar, bar ? 12 }: [ foo ]) { }

be stricter in the 12 constant, i.e. the result should be [ 12 ] instead of [ <thunked 12>].

Describe the solution you'd like

Adopting this behavior.

Describe alternatives you've considered

Having a behavior difference here which is fine. It's only visible for people working on Nix implementations that tries to measure how lazy they are for correctness, e.g. Snix.

Additional context

cc @roberth @flokli

## Is your feature request related to a problem? Please describe. CppNix decided to adopt extra strictness for constants, usually, it can create some issues but here, the idea is to have: ``` ({ foo ? bar, bar ? 12 }: [ foo ]) { } ``` be stricter in the `12` constant, i.e. the result should be `[ 12 ]` instead of `[ <thunked 12>]`. ## Describe the solution you'd like Adopting this behavior. ## Describe alternatives you've considered Having a behavior difference here which is fine. It's only visible for people working on Nix implementations that tries to measure how lazy they are for correctness, e.g. Snix. ## Additional context cc @roberth @flokli
Owner

does this provide a performance advantage? otherwise nack. the evaluator is a garbage fire and changing user-invisible semantics to make test suites of other projects simpler is foolish at best.

does this provide a performance advantage? otherwise nack. the evaluator is a garbage fire and changing user-invisible semantics to make test suites of other projects simpler is foolish at best.
raito changed title from Extra laziness for constants to Extra strictness for constants 2025-03-18 12:30:23 +00:00

It's not to accomodate the Snix test suite, see the commit message in https://cl.snix.dev/c/snix/+/30090. We updated our test (which tests something else) to not run into this corner case.

does this provide a performance advantage? otherwise nack.

Robert mentioned that's probably the reason. Also see https://github.com/NixOS/nix/issues/12666.

It's not to accomodate the Snix test suite, see the commit message in https://cl.snix.dev/c/snix/+/30090. We updated our test (which tests something else) to not run into this corner case. > does this provide a performance advantage? otherwise nack. Robert mentioned that's probably the reason. Also see https://github.com/NixOS/nix/issues/12666.
Sign in to join this conversation.
No milestone
No project
No assignees
3 participants
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference: lix-project/lix#746
No description provided.