!9IQChSjwSHXPPWTa:lix.systems

Lix

1100 Members
Lix user channel. Feel free to discuss on-topic issues here and give each other help. For matrix.to links to the rest of the Lix channels, see: https://wiki.lix.systems/books/lix-organisation/page/matrix-rooms293 Servers

Load older messages


SenderMessageTime
1 Dec 2025
@raitobezarius:matrix.orgraitobezariusyou are doing autocalling as well?11:45:05
@qyriad:katesiria.orgQyriad nix-build, nix-shell, nix develop, and nix build all do autocall, among certainly many others 11:46:37
@qyriad:katesiria.orgQyriad nix-build '<nixpkgs>' -A hello autocalls <nixpkgs/default.nix> { } 11:47:01
@niko:nrab.lolniko ⚡️Honestly though how many users are there of deep auto-calls and auto-calling functors11:49:19
@niko:nrab.lolniko ⚡️I can't imagine there being that many11:49:31
@raitobezarius:matrix.orgraitobezariusyeah, i expect this to be ≤1011:49:34
@raitobezarius:matrix.orgraitobezariusbut we should prove it via large scale evaluations11:49:41
@niko:nrab.lolniko ⚡️And if someone is auto-calling a functor, they're probably doing it on accident11:49:49
@raitobezarius:matrix.orgraitobezariusno one has been accidentally comparing attrsets with functions at all11:50:28
* @niko:nrab.lolniko ⚡️ clueless11:50:48
@raitobezarius:matrix.orgraitobezariusfunction pointer equality11:54:50
@qyriad:katesiria.orgQyriad Autocall does nest but in practice it almost certainly only happens at toplevel or maybe one level deep 90% of the timebu 11:56:10
@k900:0upti.meK900Not function pointer11:56:20
@k900:0upti.meK900Attrset pointer11:56:23
@k900:0upti.meK900
nix-repl> (x: x) == (x: x)
false

nix-repl> { f = x: x; } == { f = x: x; }
false

nix-repl> let f = x: x; in { f = f; } == { f = f; }
true
11:57:16
@qyriad:katesiria.orgQyriad * Autocall does nest but in practice it almost certainly only happens at toplevel or maybe one level deep 90% of the time 11:58:15
@niko:nrab.lolniko ⚡️ Surely a very worth it optimization that never caused anyone any problems 11:58:46
@k900:0upti.meK900Fun fact: if you change this, nixpkgs eval breaks12:00:53
@k900:0upti.meK900(disclaimer: not actually a fun fact)12:01:08
@qyriad:katesiria.orgQyriadIt's worse than that. Determining if two lambdas are "the same" is a Hard Problem, so we simply Don't, but Nix since olden days has let you compare attrsets with functions in them, and so it compares them by pointer to sidestep the function-equality problem12:05:27
@k900:0upti.meK900 @raitobezarius did it bork again 12:07:02
@k900:0upti.meK900https://buildkite.com/lix-project/lix/builds/6543/steps/canvas?sid=019ad9c8-a593-4e9a-a012-fcea9a16f9ee12:07:03
@raitobezarius:matrix.orgraitobezariusi just think this machine is not uptodate12:08:02
@niko:nrab.lolniko ⚡️
In reply to @qyriad:katesiria.org
It's worse than that. Determining if two lambdas are "the same" is a Hard Problem, so we simply Don't, but Nix since olden days has let you compare attrsets with functions in them, and so it compares them by pointer to sidestep the function-equality problem
Being a hard problem is one thing, but it being underspecified is another. Honestly I would expect _:_ == _:_ to return false since frankly comparison by “contents” for functions would be quite insane
12:17:54
@atemu12:matrix.orgAtemu

Wouldn't it be possible to at least do some basic equivalence checking based on the function AST or something like that?

I'd expect that to behave as expected in trivial cases like (x: x) == (y: y) or lib.foo == lib.foo.

12:18:13
@qyriad:katesiria.orgQyriadIt does return false, worry not12:18:41
@niko:nrab.lolniko ⚡️
In reply to @atemu12:matrix.org

Wouldn't it be possible to at least do some basic equivalence checking based on the function AST or something like that?

I'd expect that to behave as expected in trivial cases like (x: x) == (y: y) or lib.foo == lib.foo.

Noooo Please don’t do that never ever
12:19:13
@qyriad:katesiria.orgQyriad I have bad news 🙃 lib.recursiveUpdate == lib.recursiveUpdate is true 12:19:55
@niko:nrab.lolniko ⚡️
In reply to @qyriad:katesiria.org
I have bad news 🙃 lib.recursiveUpdate == lib.recursiveUpdate is true
The questions for the masses - is (import <nixpkgs/lib>).recursiveUpdate equal to itself?
12:20:56
@niko:nrab.lolniko ⚡️ Because I’d expect that to be false too, while lib.recursiveUpdate to be true 12:21:23

Show newer messages


Back to Room ListRoom Version: 10