| 1 Dec 2025 |
raitobezarius | you are doing autocalling? | 11:44:49 |
raitobezarius | if you do nix-build nixos/tests/zfs.nix | 11:45:01 |
raitobezarius | you are doing autocalling as well? | 11:45:05 |
Qyriad | nix-build, nix-shell, nix develop, and nix build all do autocall, among certainly many others | 11:46:37 |
Qyriad | nix-build '<nixpkgs>' -A hello autocalls <nixpkgs/default.nix> { } | 11:47:01 |
niko ⚡️ | Honestly though how many users are there of deep auto-calls and auto-calling functors | 11:49:19 |
niko ⚡️ | I can't imagine there being that many | 11:49:31 |
raitobezarius | yeah, i expect this to be ≤10 | 11:49:34 |
raitobezarius | but we should prove it via large scale evaluations | 11:49:41 |
niko ⚡️ | And if someone is auto-calling a functor, they're probably doing it on accident | 11:49:49 |
raitobezarius | no one has been accidentally comparing attrsets with functions at all | 11:50:28 |
| * niko ⚡️ clueless | 11:50:48 |
raitobezarius | function pointer equality | 11:54:50 |
Qyriad | 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 | Not function pointer | 11:56:20 |
K900 | Attrset pointer | 11:56:23 |
K900 | 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 | * 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 ⚡️ | Surely a very worth it optimization that never caused anyone any problems | 11:58:46 |
K900 | Fun fact: if you change this, nixpkgs eval breaks | 12:00:53 |
K900 | (disclaimer: not actually a fun fact) | 12:01:08 |
Qyriad | 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 | 12:05:27 |
K900 | @raitobezarius did it bork again | 12:07:02 |
K900 | https://buildkite.com/lix-project/lix/builds/6543/steps/canvas?sid=019ad9c8-a593-4e9a-a012-fcea9a16f9ee | 12:07:03 |
raitobezarius | i just think this machine is not uptodate | 12:08:02 |
niko ⚡️ | 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 |
Atemu | 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 | It does return false, worry not | 12:18:41 |
niko ⚡️ | 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 | I have bad news 🙃 lib.recursiveUpdate == lib.recursiveUpdate is true | 12:19:55 |