| 1 Dec 2025 |
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 |
niko ⚡️ | 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 ⚡️ | Because I’d expect that to be false too, while lib.recursiveUpdate to be true | 12:21:23 |
Rutile (Commentator2.0) feel free to ping | ohno | 12:22:00 |
Qyriad | It is, and not just that, but let lib = import <nixpkgs/lib>; in lib.recursiveUpdate == (import <nixpkgs/lib>).recursiveUpdate is also true | 12:22:16 |
Rutile (Commentator2.0) feel free to ping | fn equality is just cursed and error if not for f-ing cppnix compatibility, though i understand the need for it somehow | 12:22:29 |
niko ⚡️ | In reply to @qyriad:katesiria.org It is, and not just that, but let lib = import <nixpkgs/lib>; in lib.recursiveUpdate == (import <nixpkgs/lib>).recursiveUpdate is also true Oh that’s cursed what | 12:22:48 |
Qyriad | in nixlangv2 the thoughts are to just ban function equality altogether, including attrsets-with-functions | 12:23:14 |
raitobezarius | i think it's really bad to implement a partial procedure | 12:23:57 |
raitobezarius | either we implement the full procedure (bisimulation on the induced lambda term graph) | 12:24:11 |
Rutile (Commentator2.0) feel free to ping | only thing i remember is this exact same disscussion in here, somewhere a few weeks back | 12:24:12 |
raitobezarius | either we don't | 12:24:13 |
raitobezarius | and the full procedure is very complicated for dubious gains | 12:24:21 |
Qyriad | Haskell bans lambda equality iwrc | 12:24:54 |
raitobezarius | that's probably the healthiest thing to pursue | 12:25:22 |
Qyriad | We::Osiria would be in favor of allowing attrsets to define their own equality comparators to be used regardless of the presence of functions | 12:25:42 |
niko ⚡️ | I think properly specifying what constitutes “same instance of a function” would also be feasible, because importing the same file twice (or instantiating the same function twice?) to me doesn’t seem like it should result in the same pointer, just based on vibes | 12:25:55 |
Qyriad | __eq but like. hopefully less cursed | 12:25:55 |
raitobezarius | well it is very related to the concept of maximal sharing | 12:26:21 |
raitobezarius | https://wiki.lix.systems/books/lix-contributors/page/pointer-equality | 12:26:25 |