| 23 Aug 2025 |
Grimmauld (any/all) | Also the repl is screwy:
Lix 2.93.3
Type :? for help.
nix-repl> f = x: 1 + f x
error: undefined variable 'f'
at «string»:1:12:
1| f = x: 1 + f x
| ^
nix-repl> f = let f' = x: 1 + f' x; in f'
Added f.
nix-repl>
like come on, why do i need a let binding to define recursion in a repl, this is dumb
| 17:37:00 |
emily | I think it's nice that you don't have to worry about Nix expressions you import having side effects, and that only the packages you need for the package you want to build are evaluated | 17:37:14 |
emily | you can make a restricted DSL in any language if you really want, but Nix gives you those for free | 17:37:39 |
Niklauz | In part I think what I'm asking is if you're consider that it could be "worthwhile"? | 17:37:44 |
piegames | In reply to @grimmauld:grapevine.grimmauld.de
Also the repl is screwy:
Lix 2.93.3
Type :? for help.
nix-repl> f = x: 1 + f x
error: undefined variable 'f'
at «string»:1:12:
1| f = x: 1 + f x
| ^
nix-repl> f = let f' = x: 1 + f' x; in f'
Added f.
nix-repl>
like come on, why do i need a let binding to define recursion in a repl, this is dumb
Can you file an issue and tag me please? | 17:38:30 |
Grimmauld (any/all) | (ignore this function is missing an anchor, not the point) | 17:38:37 |
Qyriad | repl bindings can shadow though | 17:38:48 |
emily | I think Guix is a decent enough implementation of "Nix if you wrote the expressions in Scheme" | 17:38:55 |
Grimmauld (any/all) | sure can do, its bugged me for a long time already | 17:39:06 |
emily | but I would prefer a better Nix-ish language to putting in more or less any other existing language | 17:39:09 |
emily | the alternative is not being able to x = x + 1 | 17:39:39 |
emily | ah, as Qyriad said | 17:39:50 |
Grimmauld (any/all) | so there is no good solution because one can't have both? | 17:41:02 |
Grimmauld (any/all) | not even something like \noshadow ... to omit the let...in for recursion or something? | 17:41:29 |
Grimmauld (any/all) | * maybe something like \noshadow ... to omit the let...in for recursion or something? | 17:41:36 |
piegames | Yes. (The solution to your problem is lib.fix btw) | 17:41:38 |
Grimmauld (any/all) | * maybe something like :noshadow ... to omit the let...in for recursion or something? | 17:41:59 |
Niklauz | Yeah I'm assuming this wouldn't be an either or situation - that perhaps the improvement to Nix might open up the option to sanely target nix as part of language evolution goal. | 17:42:16 |
piegames | Personally I'd always prefer shadowing over implicit recursion, but that ship has sailed when I was in Kindergarten, so now the question only is about language consistency | 17:42:27 |
Niklauz | but now I'm just talking to the internet about my dreams 😄 | 17:42:28 |
Grimmauld (any/all) | not everything uses nixpkgs lib, but fair enough i guess | 17:42:55 |
Grimmauld (any/all) | honestly all shadowing should be banned, its just one big footgun. I want recursion everywhere and now shadows. | 17:43:41 |
Grimmauld (any/all) | buuut that might be a bit radical and i am probably missing some detail why we need it | 17:44:01 |
piegames | I learned in Haskell that recursion is an equal footgun | 17:44:56 |
Qyriad | In reply to @grimmauld:grapevine.grimmauld.de honestly all shadowing should be banned, its just one big footgun. I want recursion everywhere and now shadows. the repl and function arguments are the literal only places where things can shadow and imo those are both good places for it | 17:45:48 |
| ebeem-sama changed their profile picture. | 19:58:55 |
| whixie joined the room. | 21:25:06 |
| 24 Aug 2025 |
| RichInOverdraft changed their display name from Richman to rich. | 04:10:47 |
| uvla joined the room. | 12:51:43 |
| 25 Aug 2025 |
| NixOS Moderation Bot banned @srid:matrix.org (<no reason supplied>). | 08:17:23 |