15 Oct 2025 |
raitobezarius | static analysis doesn't work anymore :( | 01:14:43 |
raitobezarius | it's a with -style construct | 01:14:48 |
raitobezarius | it could even be said this is anti with | 01:14:54 |
Charles | yeah basically lol | 01:15:20 |
raitobezarius | why do you need so hard to restrict names? | 01:15:44 |
Charles | hm why not? to me this seems sort of similar to mod in rust except you don't get use | 01:15:46 |
raitobezarius | static analyzers needs to keep track if they have entered into a restricted scope | 01:16:11 |
raitobezarius | so you cannot just go brrrrrrr and look at every scopes and collect variables | 01:16:31 |
Charles | yeah, that's true | 01:16:39 |
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 |