!9IQChSjwSHXPPWTa:lix.systems

Lix

1121 Members
Lix user channel. Feel free to discuss on-topic issues here and give each other help. For matrix.to links to the rest of the Lix channels, see: https://wiki.lix.systems/books/lix-organisation/page/matrix-rooms311 Servers

Load older messages


SenderMessageTime
20 Mar 2026
@piegames:flausch.socialpiegameshmm21:12:24
@toonn:matrix.orgtoonn Is a literal still a literal if it requires interpolation though? 22:20:31
@piegames:flausch.socialpiegamesThat's a philosophical question22:56:07
@piegames:flausch.socialpiegamesBonus points for: semantically, strings with interpolations are parsed as a concatenation right now, but so are escapes. Yes this is bogus22:57:06
@piegames:flausch.socialpiegamesBonus bonus points: this is load-bearing and semantically observable in Flakes where literals are allowed but no concatenations, and changing the parser thus changes the language of flake files22:57:53
@blokyk:matrix.orgzoë (she/her) sorry to interrupt the debate, but is the fact that break doesn't force its argument (unlike e.g. trace and warn) really intended? it causes break calls to be opaque in some situations (e.g. isAttrs {} != isAttrs (break {}), and mapAttrs f (break {}) always errors out, complaining about about the argument being a thunk and not a set), which means that it can potentially break (ha) a lot of code that relies on those 23:07:45
@blokyk:matrix.orgzoë (she/her) i know the test suite is not exactly the best thing to go by, but adding forceValue(args[0]) to prim_break "only" breaks two tests, in the repl. from what i can tell, it seems to change where the error's 0th frame is located for some reason 23:11:42
@blokyk:matrix.orgzoë (she/her) * i know the test suite is not exactly the best thing to go by, but adding forceValue(args[0]) to prim_break "only" breaks two tests, in the repl. from what i can tell, it seems to change where the breakpoint/error's 0th frame is located for some reason 23:11:48
@blokyk:matrix.orgzoë (she/her) * sorry to interrupt the debate, but is the fact that break doesn't force its argument (unlike e.g. trace and warn) really intended? it causes break calls to be opaque in some situations (e.g. isAttrs {} != isAttrs (break {}), and mapAttrs f (break {}) always errors out, complaining about about the argument being a thunk and not a set), which means that it can potentially break (ha) a lot of code that relies on those
(and from experience it has bitten me every time i use break, to the point that i carry the declaration brk = x: builtins.seq (break x) x in every file i debug)
23:13:10
@blokyk:matrix.orgzoë (she/her) * sorry to interrupt the debate, but is the fact that break doesn't force its argument (unlike e.g. trace and warn) really intended? it causes break calls to be opaque in some situations (e.g. isAttrs {} != isAttrs (break {}), and mapAttrs f (break {}) always errors out, complaining about about the argument being a thunk and not a set), which means that it can potentially break (ha) a lot of code that relies on those. does that mean it'd be considered a breaking change to do that (is break even considered part of the language's stability contract?)
(and from experience it has bitten me every time i use break, to the point that i carry the declaration brk = x: builtins.seq (break x) x in every file i debug)
23:14:15
@blokyk:matrix.orgzoë (she/her)nvm, the only differences are actually just in the final stack that's shown -- in the current tests, there's a smaller backtrace (which isn't very informative imo), but with the patch it traces the whole call-stack from the root expression instead23:21:20
@blokyk:matrix.orgzoë (she/her)* nvm, in both failing tests, the only differences are actually just in the call stack that's displayed -- in the current tests, there's a smaller backtrace (which isn't very informative imo), but with the patch it traces the whole call-stack from the root expression instead23:24:23
@blokyk:matrix.orgzoë (she/her) * nvm, in both failing tests, the only differences are actually just in the call stack (either from :bt or after quitting) -- in the current tests, there's a smaller backtrace (which isn't very informative imo), but with the patch it traces the whole call-stack from the root expression instead 23:24:46
@piegames:flausch.socialpiegamesTIL about break 23:25:48
@piegames:flausch.socialpiegamesAnd oid23:25:51
@piegames:flausch.socialpiegames* And oof23:26:04
@piegames:flausch.socialpiegamesThis is such a layering violation23:26:14
@piegames:flausch.socialpiegameshttps://git.lix.systems/lix-project/lix/src/branch/main/lix/libexpr/primops.cc#L647 but the implementation does not look super shady to me (well, besides the normal amount of cursedness)23:28:23
@blokyk:matrix.orgzoë (she/her)yeah no i was surprised at how little code was actually there23:28:50
@blokyk:matrix.orgzoë (she/her)* yeah no i was surprised at how little code was actually there too23:28:55
@piegames:flausch.socialpiegamesIt just passes the value it gets through like a wrapper, which makes intuitive sense to me23:28:56
@piegames:flausch.socialpiegames
In reply to @blokyk:matrix.org
sorry to interrupt the debate, but is the fact that break doesn't force its argument (unlike e.g. trace and warn) really intended? it causes break calls to be opaque in some situations (e.g. isAttrs {} != isAttrs (break {}), and mapAttrs f (break {}) always errors out, complaining about about the argument being a thunk and not a set), which means that it can potentially break (ha) a lot of code that relies on those. does that mean it'd be considered a breaking change to do that (is break even considered part of the language's stability contract?)
(and from experience it has bitten me every time i use break, to the point that i carry the declaration brk = x: builtins.seq (break x) x in every file i debug)
Can you paste the errors maybe?
23:29:49
@blokyk:matrix.orgzoë (she/her) me too, but i don't know how the evaluator actually works internally, and i saw that trace has a forceValue(args[1]), and i know for a fact that trace doesn't have that bug, so i figured it'd fix it 23:29:57
@blokyk:matrix.orgzoë (she/her)sure hold on23:30:01
@piegames:flausch.socialpiegamesI have a hunch this might be a callsite problem23:30:14
@piegames:flausch.socialpiegames
In reply to @blokyk:matrix.org
me too, but i don't know how the evaluator actually works internally, and i saw that trace has a forceValue(args[1]), and i know for a fact that trace doesn't have that bug, so i figured it'd fix it
I mean you can just try it out and see if it helps
23:30:42
@blokyk:matrix.orgzoë (she/her)
nix-repl> builtins.mapAttrs (n: v: v) (break { a = 5; })
error:
       … while calling the 'mapAttrs' builtin
         at «string»:1:1:
            1| builtins.mapAttrs (n: v: v) (break { a = 5; })
             | ^

       … while evaluating the second argument passed to builtins.mapAttrs

       error: expected a set but found a thunk: «thunk»
23:31:43
@blokyk:matrix.orgzoë (she/her)yep that's what i did and it seems to work how i'd expect (i.e. the above expression evaluates fine)23:32:40
@piegames:flausch.socialpiegamesAnd if you replace break with identity or with trace it works?23:32:56
@blokyk:matrix.orgzoë (she/her)it seems to be the case with most of the builtins i've tried, from memory23:33:13

Show newer messages


Back to Room ListRoom Version: 10