| 1 Dec 2025 |
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 |
raitobezarius | i explained a bunch of things there | 12:26:28 |
raitobezarius | from what I gathered | 12:26:31 |
raitobezarius | the import machinery not caching things for example would break maximal sharing | 12:26:46 |
Qyriad | It's because imports are cached.
nix-repl> (scopedImport { } <nixpkgs/lib>).recursiveUpdate == (scopedImport { } <nixpkgs/lib>).recursiveUpdate
false
nix-repl> (scopedImport { } <nixpkgs/lib>).recursiveUpdate == (import <nixpkgs/lib>).recursiveUpdate
false
| 12:27:15 |
Qyriad | scopedImport disables that caching | 12:27:24 |
raitobezarius | yeah, it feels like a nixlang2 thing | 12:27:53 |
raitobezarius | not a fan of special meaning attributes | 12:28:10 |
Qyriad | We would be in favor of something more metatable-flavored over magic attributes | 12:28:37 |
raitobezarius | how would that look like? | 12:29:38 |
raitobezarius | setMetaAttributes attrs { __eq = x; } ? | 12:30:00 |
Qyriad | Yeah something like that | 12:30:14 |
Qyriad | Which would return a new attrset obvi, not mutate | 12:30:23 |
raitobezarius | ye | 12:30:32 |