| 15 Oct 2025 |
raitobezarius | your analyzer for call expressions needs to keep track of entering restrictions and exiting restrictions | 01:16:48 |
Charles | doing this is a builtin is probably Wrong and it should really be some kind of language construct | 01:16:51 |
raitobezarius | also | 01:16:57 |
raitobezarius | imagine | 01:16:58 |
raitobezarius | head (map (_: builtins.restrictNamespace) [ foo ]) | 01:17:12 |
raitobezarius | * head (map builtins.restrictNamespace [ foo ]) | 01:17:28 |
Charles | yikes | 01:17:29 |
Charles | see also lol | 01:17:41 |
raitobezarius | this is what I mean by static analyzers are completely fucked in front of this | 01:17:43 |
raitobezarius | yeah, feels like to me you want { } | 01:17:54 |
raitobezarius | let
{
fucking around
}
x = 3;
in
{ ... }
| 01:18:11 |
raitobezarius | but basically you can always scope things | 01:18:40 |
raitobezarius | with attrsets? | 01:18:43 |
raitobezarius | let
scope = _: { foo = 4 };
bar = (x: x + foo);
in bar 5
| 01:19:53 |
raitobezarius | like i have trouble finding cases where you cannot structure your code that way | 01:20:26 |
raitobezarius | if your let bindings are the most locals to what you need | 01:20:33 |
raitobezarius | there's no global pollution | 01:20:36 |
raitobezarius | you can always thunk things in function scopes to avoid the problem | 01:20:44 |
Charles | the reason i want something like this is to be able to enforce that the return value of source and input in sprinkles can't be polluted by external state | 01:21:02 |
raitobezarius | what do you want to avoid by achieving that? | 01:21:40 |
raitobezarius | simulate triviality checks? | 01:22:00 |
David Lee | hmm as best I can tell it's that NIX_PATH is explicitly set by the runner script
sudo env NIX_PATH="${nix_path}" nixos-rebuild "$cmd" --no-reexec "$@" | 01:22:36 |
Charles | to prevent a mistake like
let
source = { foo = 5; };
input = source': { foo = source.foo + 1 };
in
...
i guess
| 01:22:48 |
raitobezarius | this example can be transformed into | 01:23:11 |
raitobezarius | let
input = source: let source' = { foo = 5; } in { foo = source'.foo + 1; };
in
| 01:23:30 |
raitobezarius | * let
input = source: let source' = { foo = 5; } in { foo = source'.foo + 1; };
in
| 01:23:33 |
raitobezarius | even with your restriction mechanism, you are not out of the woods here | 01:23:44 |
raitobezarius | it definitely feels like you want the expression defining input to be mostly trivial | 01:24:08 |
QuadRadical (Ping) | by the way, raitobezarius, did you ever take a look at my freeze? | 01:24:11 |
QuadRadical (Ping) | with the nextest? | 01:24:18 |