| 18 May 2026 |
llakala | filterAttrs is heavier, requiring a whole removeAttrs | 15:53:23 |
llakala | I personally choose not to use optionalAttrs in that way, instead choosing
${if cond then "foo" else null} = value;
xovidium has said that empty merges are free on new nix versions though
| 15:54:44 |
llakala | (I've been working close to the metal on mkDerivation, which makes me performance minded) | 15:55:17 |
llakala | * | 15:57:12 |
toonn | I have the same reservation about filterAttrs. The lambda also kinda obscures what's going on, it's too powerful in a way. | 17:03:03 |
toonn | Hadn't considered a dynamic attribute with if-then-else. Useful for multiple attributes at a time but I do feel like it's more obscure. | 17:05:00 |
| Arcadia (Cady) Rose joined the room. | 17:09:05 |
| 19 May 2026 |
| Nuwa changed their profile picture. | 14:56:39 |
| todo joined the room. | 15:41:02 |
Nuwa | Redacted or Malformed Event | 20:24:00 |
| amadaluzia changed their profile picture. | 20:58:44 |
| 20 May 2026 |
| nahsi joined the room. | 09:09:48 |
| nahsi left the room. | 09:41:01 |
| nahsi joined the room. | 09:48:48 |
| Nuwa changed their profile picture. | 21:00:54 |
| Nuwa changed their display name from Hazel to Aspen. | 22:37:52 |
| 21 May 2026 |
| rajudev joined the room. | 00:00:20 |
| @moatx:matrix.org removed their profile picture. | 15:47:26 |
| @k.sommer:mozilla.org joined the room. | 16:29:06 |
| @k.sommer:mozilla.org changed their display name from k-sommer to k-sommer 🏳️⚧️. | 16:29:51 |
| @k.sommer:mozilla.org changed their display name from k-sommer 🏳️⚧️ to 🏳️⚧️❄️ k-sommer (she/her). | 16:42:18 |
| jayf99 joined the room. | 18:45:33 |
| @k.sommer:mozilla.org left the room. | 20:48:28 |
| @moatx:matrix.org left the room. | 22:01:44 |
| 22 May 2026 |
| 凛锋 changed their profile picture. | 10:24:09 |
| share-x joined the room. | 15:22:09 |
| 23 May 2026 |
| dj joined the room. | 06:04:20 |
| Yingchi Long changed their profile picture. | 11:24:37 |
| mtmn joined the room. | 15:20:49 |
| 25 May 2026 |
llakala | how does nix handle these differently when it comes to laziness?
let
inherit (builtins) isInt genList;
assertMsg = pred: msg: pred || throw msg;
v1 =
x:
assert isInt x || throw "error message";
x * 2;
v2 =
x:
assert assertMsg (isInt x) "error message";
x * 2;
indices = genList (i: i) 100;
in
map v2 indices
i understand that assertMsg and similar functions (throwIf, warnIf, etc) are bad for performance - i can run stats on both versions and tell you that we go from 7 -> 107 thunks, 200 -> 400 function calls, and 4300 -> 7500 envs.bytes when using v2. what i don't get is how we're able to only have 7 thunks in the || case. how do we not need to create a thunk on every call?
| 01:58:00 |