!9IQChSjwSHXPPWTa:lix.systems

Lix

1103 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-rooms295 Servers

Load older messages


SenderMessageTime
1 Dec 2025
@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
@commentator2.0:elia.gardenRutile (Commentator2.0) feel free to pingohno12:22:00
@qyriad:katesiria.orgQyriad 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
@commentator2.0:elia.gardenRutile (Commentator2.0) feel free to pingfn equality is just cursed and error if not for f-ing cppnix compatibility, though i understand the need for it somehow12:22:29
@niko:nrab.lolniko ⚡️
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:katesiria.orgQyriadin nixlangv2 the thoughts are to just ban function equality altogether, including attrsets-with-functions12:23:14
@raitobezarius:matrix.orgraitobezariusi think it's really bad to implement a partial procedure12:23:57
@raitobezarius:matrix.orgraitobezariuseither we implement the full procedure (bisimulation on the induced lambda term graph)12:24:11
@commentator2.0:elia.gardenRutile (Commentator2.0) feel free to pingonly thing i remember is this exact same disscussion in here, somewhere a few weeks back12:24:12
@raitobezarius:matrix.orgraitobezariuseither we don't12:24:13
@raitobezarius:matrix.orgraitobezariusand the full procedure is very complicated for dubious gains12:24:21
@qyriad:katesiria.orgQyriadHaskell bans lambda equality iwrc12:24:54
@raitobezarius:matrix.orgraitobezariusthat's probably the healthiest thing to pursue12:25:22
@qyriad:katesiria.orgQyriad 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:nrab.lolniko ⚡️ 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:katesiria.orgQyriad __eq but like. hopefully less cursed 12:25:55
@raitobezarius:matrix.orgraitobezariuswell it is very related to the concept of maximal sharing12:26:21
@raitobezarius:matrix.orgraitobezarius https://wiki.lix.systems/books/lix-contributors/page/pointer-equality 12:26:25

Show newer messages


Back to Room ListRoom Version: 10