pingiun has quit [Quit: Bye!]
pingiun has joined #nix-lang
rajivr has joined #nix-lang
<
Profpatsch>
It’s kinda crazy, since not allowing an 0x0000 means you don’t speak utf-8 correctly
<
Profpatsch>
but afaik not even json speaks \0
<
Profpatsch>
It does
<
Profpatsch>
> echo '"foo\u0000bar"' | jq --raw-output | cat -A
<
{^_^}>
error: syntax error, unexpected $undefined, expecting ')', at (string):477:6
<
Profpatsch>
foo^@bar$
rajivr has quit [Quit: Connection closed for inactivity]
<
sterni>
well json has sane escaping huh
<
sterni>
> "\0" == "0"
<
sterni>
gotta love it
rajivr has joined #nix-lang
qyliss has quit [Quit: bye]
qyliss has joined #nix-lang
Dotz0cat_ has quit [Ping timeout: 264 seconds]
rajivr has quit [Quit: Connection closed for inactivity]
Dotz0cat has joined #nix-lang
jared-w has quit [Remote host closed the connection]
<
sterni>
> builtins.deepSeq (lib.fix (self: { car = "lol"; cdr = self; })) null
<
sterni>
so deepSeq does not in fact deepSeq?
<
sterni>
this should never terminate or am I missing something about deepSeq
<
sterni>
if it’s a list or set, its elements or attributes are also evaluated recursively
<
sterni>
yeah right
<
Profpatsch>
okay, bear with me here, what if deepSeq saw it’s the same thunk and would lead to infinite recursion, and in that case just ignored it
<
sterni>
I wouldn't think so
<
sterni>
In that case it always throws right?
<
sterni>
nix that is
<
sterni>
maybe someone knows so I don't have to read libexpr source code
jared-w has joined #nix-lang
<
infinisil>
It does indeed..
<
sterni>
okay wait that kinda makes sense actually I'm dumb
<
sterni>
because it actually evaluates all of it
<
Profpatsch>
infinisil: I literally cannot read that
<
Profpatsch>
It combines mutable inserts with query logic with unbracketed if and my brain refuses to parse the logic
<
infinisil>
It just recurses while making sure a value isn't recursed into twice
<
Profpatsch>
But … does that confirm or deny my thesis that it ignores thunks it finds twice
<
sterni>
it confirms
<
sterni>
it just stops as soon as it finds a thunk that has been evaluated
<
sterni>
let nats = n: { car = n; cdr = nats (n + 1); }; in builtins.deepSeq (nats 0) null
<
sterni>
error: stack overflow (possible infinite recursion)
<
sterni>
i wonder what would happen to nixbot with this
<
Profpatsch>
but the thunks are not yet evaluated, right?
<
Profpatsch>
car = self; it’s in the process of evaluating self
<
sterni>
but as soon as you have seen the same thunk twice you know you're not gonna get more than a thunk right
jared-w has quit [Remote host closed the connection]
jared-w has joined #nix-lang
<
Profpatsch>
but in that case it should not say “oh I deep seqed”, it should crash with an infinite recursion
<
infinisil>
> let nats = n: { car = n; cdr = nats (n + 1); }; in builtins.deepSeq (nats 0) null
<
{^_^}>
error: stack overflow (possible infinite recursion)
<
sterni>
{^_^} survived!
<
infinisil>
{^_^} has been through worse
<
infinisil>
Had to implement resource constraints so it can't lag my machine lol
Dotz0cat_ has joined #nix-lang
Dotz0cat has quit [Ping timeout: 256 seconds]