<< 06-03-2025 >>

00:21:17*alexdaguy joined #nim
00:25:05*Goodbye_Vincent1 quit (Remote host closed the connection)
00:25:57*Goodbye_Vincent1 joined #nim
01:41:15*tiorock joined #nim
01:41:15*rockcavera quit (Killed (tantalum.libera.chat (Nickname regained by services)))
01:41:15*tiorock is now known as rockcavera
01:43:22*tiorock joined #nim
01:43:22*tiorock quit (Changing host)
01:43:22*tiorock joined #nim
01:43:22*rockcavera is now known as Guest7768
01:43:22*tiorock is now known as rockcavera
01:46:02*Guest7768 quit (Ping timeout: 252 seconds)
01:47:23FromDiscord<heysokam> Is there any existing Nim type that represents the same concept as Rust/Zig slices and cpp std::span? 🤔↵I noticed that Go's slices are the same as Nim's seq, but that made me realize that I haven't seen the slice version in Nim so far↵Is there an existing type that behaves like them?
01:50:40FromDiscord<leorize> technically it's `openArray`
01:50:47FromDiscord<leorize> but borrowing is unstable and buggy
01:51:10FromDiscord<leorize> and Go's slices are not the same as Nim's seq
01:51:40FromDiscord<leorize> Go's slice have a ton of gotchas that you need to be aware of when you use it
01:54:26FromDiscord<heysokam> I thought `openArray` is not really a type, but more like a generic hint. Maybe I misunderstood that?
01:55:02FromDiscord<Elegantbeef> It's a type
01:55:17FromDiscord<Elegantbeef> It's `ptr, len` but safe
01:55:36FromDiscord<heysokam> ah so then it is a slice. kk, had no idea
01:56:19FromDiscord<heysokam> so `seq` implicitly "casts" to openArray when passed into an openArray argument, right?
01:56:28FromDiscord<Elegantbeef> Same with array, yes
01:56:44FromDiscord<Elegantbeef> It's an implicit conversion which can cause many headaches if you're writing generic code 😄
01:56:55FromDiscord<heysokam> ic
01:57:20FromDiscord<Elegantbeef> Mainly that `openarray[T] or T` does not work
01:57:40FromDiscord<Elegantbeef> since it's a generic it does not do an implicit conversion(which is how all conversions in Nim work)
01:58:45FromDiscord<heysokam> noted
01:58:51FromDiscord<heysokam> ty
01:59:15FromDiscord<Elegantbeef> I choose to believe you have a big ol' "Nim Notes I Noted Notedly"
02:08:04FromDiscord<heysokam> most definitely 🙂
03:58:06*beholders_eye quit (Ping timeout: 244 seconds)
04:00:00*rockcavera quit (Remote host closed the connection)
04:30:37FromDiscord<luckyskullsexyniner> hello! I'm new to Nim, just started reading 'Mastering Nim' this weekend. I'm curious about learning more about Nim, especially in security & red-teaming(which im also still very new).
04:54:26*alexdaguy quit (Quit: a)
06:13:14*ntat joined #nim
07:26:16*tokyovigilante_ joined #nim
07:26:49*tokyovigilante quit (Ping timeout: 260 seconds)
07:26:50*tokyovigilante_ is now known as tokyovigilante
07:34:50*MauGal joined #nim
07:39:29*MauGal quit (Ping timeout: 248 seconds)
07:39:46*MauGal joined #nim
08:32:52FromDiscord<nocturn9x> a question for elegantbeef
08:33:00FromDiscord<nocturn9x> sent a code paste, see https://play.nim-lang.org/#pasty=natmLDOh
08:33:16FromDiscord<nocturn9x> currently I have modified my constructor like this, whereas before it was simply `result.positions = positions`
08:33:33FromDiscord<nocturn9x> is there a way I can make `Position` a `sink T` so that I don't need to explicitly clone anything?
08:40:43FromDiscord<nocturn9x> also, I'm trying to migrate my move generation to use move semantics. Currently I pass around a bunch of `var Position`, but I'm thinking `sink Position` would be best. What I'm not sure about is whether the caller gets ownership of it back at the end of the call, from the docs it seems like the original location is destroyed by wasMoved(p)
09:15:58*jkl__ joined #nim
09:15:59FromDiscord<Robyn [She/Her]> In reply to @nocturn9x "also, I'm trying to": why not do `sink seq[Position]`?
09:16:11*jkl quit (Read error: Connection reset by peer)
09:16:56FromDiscord<Robyn [She/Her]> I think ownership is not given back, but you could do `proc(_: sink T): T`
09:20:13FromDiscord<nocturn9x> that's a big problem
09:20:19FromDiscord<nocturn9x> I need the ownership to come back :')
09:20:40FromDiscord<nocturn9x> sent a code paste, see https://play.nim-lang.org/#pasty=aSvKXPjb
09:20:52FromDiscord<nocturn9x> changing `var Position` to `sink Position` makes compilation fail
09:21:22FromDiscord<nocturn9x> `/home/nocturn9x/heimdall/src/heimdall/position.nim(586, 25) Error: '=dup' is not available for type <Position>, which is inferred from unavailable '=copy'; requires a copy because it's not the last read of 'result'; another read is done here: position.nim(669, 11); routine: loadFEN`
09:21:39FromDiscord<nocturn9x> (copy is unavailable cuz I explicitly borked it so that every copy has to be explicit via clone())
09:23:32FromDiscord<nocturn9x> In reply to @battery.acid.bubblegum "why not do `sink": that also fails
09:23:36FromDiscord<nocturn9x> rip
09:26:08FromDiscord<Robyn [She/Her]> In reply to @nocturn9x "`/home/nocturn9x/heimdall/src/heimdall/position.nim": that'll be because you dont do what i suggested
09:26:16FromDiscord<nocturn9x> such as?
09:26:17FromDiscord<Robyn [She/Her]> In reply to @nocturn9x "that also fails": oof
09:26:25FromDiscord<Robyn [She/Her]> In reply to @battery.acid.bubblegum "I *think* ownership is": here
09:26:51FromDiscord<nocturn9x> In reply to @nocturn9x "currently I have a": so I'd need to mark this as discardable and return Position?
09:27:50FromDiscord<nocturn9x> sent a code paste, see https://play.nim-lang.org/#pasty=PvJLJctO
09:28:01FromDiscord<nocturn9x> In reply to @nocturn9x "`/home/nocturn9x/heimdall/src/heimdall/position.nim": cuz it fails the same way
09:28:48FromDiscord<nocturn9x> sent a code paste, see https://play.nim-lang.org/#pasty=iyKEmTAY
09:29:43FromDiscord<nocturn9x> it seems like it's trying to make a copy instead of moving it
09:29:53FromDiscord<nocturn9x> which doesn't make a ton of sense?
09:29:58FromDiscord<nocturn9x> like isn't the point of move semantics to avoid copies
09:35:28FromDiscord<nocturn9x> also if I uncomment my overridden copy constructor, the behavior of the program changes
09:35:31FromDiscord<nocturn9x> and it makes my tests fail
09:35:35FromDiscord<nocturn9x> so something is clearly not right here
09:41:46FromDiscord<nocturn9x> I think my problem lies here: A "move" can be regarded as an optimized copy operation. If the source of the copy operation is not used afterward, the copy can be replaced by a move. This document uses the notation lastReadOf(x) to describe that x is not used afterward.
09:41:57FromDiscord<nocturn9x> I _do_ use x afterwards
09:42:02FromDiscord<nocturn9x> I need ownership to move back and forth
09:42:11FromDiscord<nocturn9x> otherwise nothing works
09:44:17*MauGal quit (Ping timeout: 248 seconds)
09:52:31FromDiscord<Robyn [She/Her]> In reply to @nocturn9x "so I'd need to": not discardable, you'd need to do `myPos = spawnPiece(myPos, ...)`
09:52:58FromDiscord<Robyn [She/Her]> So you'd assign the return value to the original variable, giving you back the ownership as soon as the function returns
09:54:30*jjido joined #nim
09:54:38FromDiscord<Robyn [She/Her]> In reply to @nocturn9x "which doesn't make a": think about it like how Rust's mutable reference semantics work, you can't have more than one living mutable reference at a time
09:54:54FromDiscord<nocturn9x> I don't want more than one mutable reference at a time tho
09:55:00FromDiscord<Robyn [She/Her]> It's a poor way to describe it but, eh
09:55:03FromDiscord<nocturn9x> I want the single mutable reference to move through the function call chain
09:55:05FromDiscord<nocturn9x> back and forth
09:55:10FromDiscord<nocturn9x> there is only ever one mutable ref
09:55:23FromDiscord<nocturn9x> In reply to @battery.acid.bubblegum "So you'd assign the": ugh
09:55:24FromDiscord<nocturn9x> annoying
09:55:34FromDiscord<nocturn9x> but I guess I can try it
09:55:44FromDiscord<nocturn9x> would that avoid copies?
09:55:48FromDiscord<nocturn9x> it's my main concern
09:55:55FromDiscord<nocturn9x> and why I use var parameters in the first place
09:56:08FromDiscord<Robyn [She/Her]> You're doing `spawnPiece(result, square, piece)` which causes a copy because `spawnPiece` takes a `sink Position` and you still have a living instance (`result`)
09:56:31FromDiscord<Robyn [She/Her]> In reply to @nocturn9x "would that avoid copies?": Yeah, I used this a few times when messing with parser combinators
10:12:50*MauGal joined #nim
10:13:40*ntat quit (Quit: Leaving)
10:15:28*jjido quit (Quit: My laptop has gone to sleep. ZZZzzz…)
10:42:19FromDiscord<nocturn9x> In reply to @battery.acid.bubblegum "You're doing `spawnPiece(result, square,": I see
10:42:26FromDiscord<nocturn9x> I'm gonna have to experiment with this
10:47:26*ntat joined #nim
10:50:11FromDiscord<nocturn9x> do copies occur if I pass `Position` alone?
10:50:23FromDiscord<nocturn9x> considering it's immutable it can just pass it as a hidden reference no?
10:50:34FromDiscord<nocturn9x> iirc the compiler already does this for large objects but it's an implementation detail
10:50:37FromDiscord<nocturn9x> so not something to rely on
10:56:27FromDiscord<nocturn9x> I have a function like this as well: `proc isEPLegal(self: var Position, friendlyKing, epTarget: Square, occupancy, pawns: Bitboard, sideToMove: PieceColor): tuple[left, right: Square]`
10:56:30FromDiscord<nocturn9x> where I return something
10:56:35FromDiscord<nocturn9x> how do I rewrite this one? :')
10:57:02FromDiscord<nocturn9x> can I just assign to `self`
10:58:12FromDiscord<albassort> hashsets[string] isn't matching strings
10:58:24FromDiscord<albassort> in returns false when it should return
10:58:48FromDiscord<albassort> that, or the strings are hding characters from me but idk how that would happen here
11:01:17FromDiscord<albassort> matchId: "CZV-TSC-2025-03-08T12:00:00-05:00",↵ "CZV-TSC-2025-03-08T12:00:00-05:00",
11:07:58FromDiscord<Robyn [She/Her]> In reply to @nocturn9x "I have a function": uhhhh no clue
11:08:23FromDiscord<Robyn [She/Her]> I usually just used a type that contained my uncopiable type
11:08:34FromDiscord<Robyn [She/Her]> You'd probably wanna use ensureMove
11:14:12FromDiscord<nocturn9x> I just added `position` to the tuple
11:14:29FromDiscord<nocturn9x> and when I use it (in just like 3 places) I call it and then do `result = thing.position`
11:14:30FromDiscord<nocturn9x> seems to work
11:14:34FromDiscord<nocturn9x> will keep refactoring
11:15:47FromDiscord<nocturn9x> sent a code paste, see https://play.nim-lang.org/#pasty=JYeNurAW
11:18:06FromDiscord<nocturn9x> now I have this failing to compile
11:18:10FromDiscord<nocturn9x> sent a code paste, see https://play.nim-lang.org/#pasty=oanefMVi
11:18:17FromDiscord<nocturn9x> it's trying to make a copy
11:18:21FromDiscord<nocturn9x> why though?
11:18:52FromDiscord<Robyn [She/Her]> In reply to @nocturn9x "do you mean something": is ensureMove causing the error?
11:18:55FromDiscord<nocturn9x> nopes
11:19:04FromDiscord<Robyn [She/Her]> ah
11:19:04FromDiscord<nocturn9x> `/home/nocturn9x/heimdall/src/heimdall/movegen.nim(277, 40) Error: '=dup' is not available for type <Position>, which is inferred from unavailable '=copy'; requires a copy because it's not the last read of 'self.positions[1]'; routine: generateMoves`
11:19:16FromDiscord<nocturn9x> sent a code paste, see https://play.nim-lang.org/#pasty=RQtvMlBp
11:19:32*ntat quit (Read error: Connection reset by peer)
11:19:32FromDiscord<nocturn9x> thanks for the help btw
11:20:09*cornfeedhobo quit (Ping timeout: 276 seconds)
11:20:49FromDiscord<Robyn [She/Her]> sent a code paste, see https://play.nim-lang.org/#pasty=AtegVhMx
11:20:55FromDiscord<Robyn [She/Her]> and no sweat
11:21:30FromDiscord<nocturn9x> sent a code paste, see https://play.nim-lang.org/#pasty=HPisnQuQ
11:21:49FromDiscord<nocturn9x> the only thing that needs to modify the position is `generatePawnMoves` to check for en passant legality
11:21:54FromDiscord<nocturn9x> everything else just reads from it
11:22:17FromDiscord<nocturn9x> (edit) "https://play.nim-lang.org/#pasty=feBWbqJD" => "https://play.nim-lang.org/#pasty=aouxynXD"
11:22:22FromDiscord<nocturn9x> I removed the comments to make the snippet shorter
11:23:00FromDiscord<Robyn [She/Her]> hm...
11:23:02FromDiscord<nocturn9x> I assume you'd want to see `generatePawnMoves`?
11:23:09FromDiscord<Robyn [She/Her]> genuinely can't see a problem
11:23:09FromDiscord<nocturn9x> it's a bit big so it'll have to be a paste
11:24:32FromDiscord<Robyn [She/Her]> That's fine though it should be unrelated since the error is at the assignment
11:24:38FromDiscord<nocturn9x> yeah
11:24:43FromDiscord<nocturn9x> idk
11:26:21FromDiscord<nocturn9x> sent a code paste, see https://play.nim-lang.org/#pasty=uKlWXrnc
11:26:23FromDiscord<nocturn9x> this is the chessboard
11:26:35FromDiscord<Robyn [She/Her]> Beef will call me a dumbass later but you could try `var pos = ensureMove(self.positions[^1])`, pass that to `generateMoves` and then do `self.positions[^1] = ensureMove(pos)`?
11:26:46FromDiscord<nocturn9x> that was my thought
11:26:47FromDiscord<nocturn9x> let's try
11:27:07FromDiscord<Robyn [She/Her]> sent a code paste, see https://play.nim-lang.org/#pasty=cGSgIOcK
11:27:35FromDiscord<nocturn9x> sent a code paste, see https://play.nim-lang.org/#pasty=sXLmBNAj
11:27:36FromDiscord<nocturn9x> so like this?
11:28:05FromDiscord<nocturn9x> `/home/nocturn9x/heimdall/src/heimdall/movegen.nim(277, 40) Error: cannot move 'self.positions[1]', which introduces an implicit copy`
11:28:08FromDiscord<Robyn [She/Her]> Yeah, try that and lmk
11:28:20FromDiscord<Robyn [She/Her]> Ah, you could try popping it
11:28:21FromDiscord<nocturn9x> line 277 is `var pos`
11:28:28FromDiscord<nocturn9x> In reply to @battery.acid.bubblegum "Ah, you could try": k
11:28:42FromDiscord<nocturn9x> so just pop without ensureMove?
11:28:43FromDiscord<Robyn [She/Her]> `self.positions.pop` (iirc pop removes the last elem and returns it?)
11:28:46FromDiscord<Robyn [She/Her]> Yep
11:29:15FromDiscord<nocturn9x> sent a code paste, see https://play.nim-lang.org/#pasty=PSBPIgWw
11:29:18FromDiscord<nocturn9x> like so?
11:29:22FromDiscord<Robyn [She/Her]> Then you'd do `self.positions.setLen self.positions.len + 1` and `self.positions[^1] = ensureMove(...)`
11:29:33FromDiscord<nocturn9x> ah right
11:29:51FromDiscord<Robyn [She/Her]> this is literally just me wildly guessing and hoping it'll stick
11:30:13FromDiscord<nocturn9x> sent a code paste, see https://play.nim-lang.org/#pasty=fKrILqmZ
11:30:20FromDiscord<nocturn9x> I could also just do `.add()` ig?
11:30:24FromDiscord<Robyn [She/Her]> Yeah looks good
11:30:34FromDiscord<Robyn [She/Her]> Add may work? Not sure if it'll introduce a copy
11:30:39FromDiscord<Robyn [She/Her]> If lucky, it won't
11:30:47FromDiscord<nocturn9x> ok so
11:30:53FromDiscord<nocturn9x> with the assignment it does not compile
11:30:54FromDiscord<nocturn9x> with add, it does
11:31:03FromDiscord<nocturn9x> sent a code paste, see https://play.nim-lang.org/#pasty=lQQeQEPI
11:31:08FromDiscord<Robyn [She/Her]> Oh lol
11:31:19FromDiscord<Robyn [She/Her]> That's good then at least woo
11:31:26FromDiscord<nocturn9x> I mean I get another error somewhere else that I have to fix but at least this seems solved
11:31:27FromDiscord<nocturn9x> so, nice
11:31:31FromDiscord<Robyn [She/Her]> iss ensureMove necessary there?
11:31:47FromDiscord<nocturn9x> good question
11:31:48FromDiscord<nocturn9x> I have no idea
11:31:53FromDiscord<Robyn [She/Her]> lolol
11:31:54FromDiscord<nocturn9x> can't hurt, since it's compile time only no?
11:31:59FromDiscord<Robyn [She/Her]> yep
11:32:03FromDiscord<nocturn9x> neat
11:32:16FromDiscord<nocturn9x> ah it's the same problem
11:32:21FromDiscord<Robyn [She/Her]> oh?
11:32:26FromDiscord<nocturn9x> `/home/nocturn9x/heimdall/src/heimdall/movegen.nim(366, 44) Error: '=dup' is not available for type <Position>, which is inferred from unavailable '=copy'; requires a copy because it's not the last read of 'self.positions[1]'; routine: doMove`
11:32:28FromDiscord<nocturn9x> assignment again
11:32:36FromDiscord<nocturn9x> `self.positions[^1] = self.positions[^1].removePiece(epPawnSquare)`
11:32:52FromDiscord<nocturn9x> do I have to pop and push every time? that seems horribly slow
11:32:57FromDiscord<Robyn [She/Her]> I think it's because indexing involves a copy operation
11:32:58FromDiscord<nocturn9x> I can't do it in performance critical code
11:33:03FromDiscord<nocturn9x> :P
11:33:15FromDiscord<nocturn9x> doing it once in generateMoves at the end is fine, since popping at the end is cheap anyway
11:33:24FromDiscord<nocturn9x> but every time I have to modify stuff? I'd be doing it like 20 times per move
11:33:40FromDiscord<Robyn [She/Her]> Since it's at the end of a loop, there should be no issue, I don't think pop reduces the capacity at all
11:33:49FromDiscord<nocturn9x> oh it doesn't I know that
11:33:58FromDiscord<nocturn9x> but idk if it would affect performance still
11:34:05FromDiscord<nocturn9x> guess I can just try
11:34:24FromDiscord<Robyn [She/Her]> then i'd assume no issues in an ideal world
11:34:28FromDiscord<nocturn9x> let's try ig
11:34:35FromDiscord<Robyn [She/Her]> you could avoid that variable assignment thouggh
11:34:41FromDiscord<nocturn9x> how?
11:34:46FromDiscord<Robyn [She/Her]> would just make it a bit uglier
11:34:55FromDiscord<nocturn9x> do you mean push and pop in one go?
11:35:06FromDiscord<nocturn9x> oh but wait a sec
11:35:08FromDiscord<nocturn9x> can I not do like
11:35:15FromDiscord<nocturn9x> move it at the beginning of `doMove`
11:35:18FromDiscord<nocturn9x> then move it back and forth
11:35:22FromDiscord<nocturn9x> then add it back?
11:35:35FromDiscord<nocturn9x> no indexing anywhere
11:35:35FromDiscord<Robyn [She/Her]> sent a code paste, see https://play.nim-lang.org/#pasty=laQHYmEr
11:35:42FromDiscord<nocturn9x> sent a code paste, see https://play.nim-lang.org/#pasty=uXZqJFXI
11:36:25FromDiscord<Robyn [She/Her]> In reply to @nocturn9x "then add it back?": im struggling to process the words bc im hungry and tired af :p
11:36:36FromDiscord<Robyn [She/Her]> sent a code paste, see https://play.nim-lang.org/#pasty=duBbBwXN
11:37:04FromDiscord<nocturn9x> In reply to @battery.acid.bubblegum "im struggling to process": ah rip
11:37:06FromDiscord<nocturn9x> what I mean is like
11:37:10FromDiscord<nocturn9x> I pop() it
11:37:13FromDiscord<nocturn9x> do whatever I need to do on it
11:37:18FromDiscord<nocturn9x> then add it back at the end
11:37:25FromDiscord<nocturn9x> instead of pop/push/pop/push
11:37:43FromDiscord<Robyn [She/Her]> yeah that would likely be more ideal
11:37:47FromDiscord<nocturn9x> lemme try
11:39:07FromDiscord<nocturn9x> oh but wait
11:39:13FromDiscord<nocturn9x> doMove already creates a clone
11:39:33*ntat joined #nim
11:39:39FromDiscord<Robyn [She/Her]> Ah
11:39:48FromDiscord<nocturn9x> so I can just
11:39:52FromDiscord<nocturn9x> clone the previous one
11:39:54FromDiscord<nocturn9x> and add it at the end
11:40:03FromDiscord<Robyn [She/Her]> groovin then
11:40:11FromDiscord<nocturn9x> fr
11:42:30FromDiscord<nocturn9x> ayy
11:42:31FromDiscord<nocturn9x> it works
11:42:40FromDiscord<nocturn9x> I just do `var cloned = self.positions[^1].clone()`
11:42:46FromDiscord<nocturn9x> do `cloned = cloned.stuff()`
11:42:57FromDiscord<nocturn9x> and at the end `self.positions.add(ensureMove(cloned))`
11:43:58FromDiscord<nocturn9x> fun stuff
11:44:27FromDiscord<Robyn [She/Her]> In reply to @nocturn9x "it works": groovin :)
11:44:58FromDiscord<Robyn [She/Her]> In reply to @nocturn9x "I just do `var": surely a move would be more effective than a clone tho
11:45:08FromDiscord<nocturn9x> but I do have to clone it
11:45:11FromDiscord<nocturn9x> it's a new position
11:45:15FromDiscord<nocturn9x> doMove creates a new position
11:45:17FromDiscord<nocturn9x> so it has to clone
11:45:20FromDiscord<Robyn [She/Her]> ooooh
11:45:24FromDiscord<nocturn9x> I keep a position stack yk
11:45:24FromDiscord<Robyn [She/Her]> kk ignore me then lol
11:45:40FromDiscord<Robyn [She/Her]> yeah that makes sense
11:45:46FromDiscord<nocturn9x> sent a code paste, see https://play.nim-lang.org/#pasty=NHagptih
11:45:49FromDiscord<nocturn9x> welp good thing I have tests
11:45:51FromDiscord<nocturn9x> time to fix shit
11:45:52FromDiscord<nocturn9x> xD
11:49:09FromDiscord<Robyn [She/Her]> oof-
11:50:53*cornfeedhobo joined #nim
11:58:02FromDiscord<nocturn9x> uh
11:58:04FromDiscord<nocturn9x> what the fuck
11:58:06FromDiscord<nocturn9x> `Error: unhandled exception: /home/nocturn9x/heimdall/src/heimdall/tui.nim(84, 13) `pos.zobristKey == incHash` 4973416858127630896 != 4973416858127630896 at a2a3 (Default) (rnbqkbnr/pppppppp/8/8/8/8/PPPPPPPP/RNBQKBNR w KQkq - 0 1) [AssertionDefect]`
11:58:11FromDiscord<nocturn9x> sir, those are the same fucking hashes-
11:59:02FromDiscord<nocturn9x> sent a code paste, see https://play.nim-lang.org/#pasty=gLqHhroe
11:59:27FromDiscord<nocturn9x> ah I'm printing the wrong thing
11:59:27FromDiscord<nocturn9x> lol
11:59:46FromDiscord<nocturn9x> love it when the test is broken
11:59:55FromDiscord<Robyn [She/Her]> lolol relatable
12:00:49FromDiscord<nocturn9x> hmm I think I see the problem
12:00:56FromDiscord<nocturn9x> incremental zobrist hashes are getting fucked
12:01:37FromDiscord<nocturn9x> ah fuck I see why
12:01:39FromDiscord<nocturn9x> I'm an idiot
12:01:42FromDiscord<nocturn9x> using the wrong thing
12:01:44FromDiscord<nocturn9x> no wonder it's borked
12:01:57FromDiscord<nocturn9x> I'm cloning the zobrist hash to a new position but then updating it from the wrong hash
12:04:08FromDiscord<nocturn9x> god I am SO glad I put all of these tests and asserts everywhere
12:04:15FromDiscord<nocturn9x> it would've been hell to figure bugs out without them
12:04:27*ntat quit (Read error: Connection reset by peer)
12:17:52FromDiscord<nocturn9x> hmm the incremental hash seems correct
12:17:57FromDiscord<nocturn9x> it's the from scratch one that's borked then?
12:23:40*beholders_eye joined #nim
12:24:22FromDiscord<nocturn9x> sent a code paste, see https://play.nim-lang.org/#pasty=YYlytmkb
12:24:32FromDiscord<nocturn9x> does this implementation of `clone` make sense?
12:24:39FromDiscord<nocturn9x> beef gave it to me but I'm starting to doubt it's the problem
12:24:55FromDiscord<nocturn9x> if I try to do `board.position.mailbox == board.position.clone().mailbox` I get an overflow error inside the stdlib lol
12:25:02FromDiscord<nocturn9x> despite both of them printing fine
12:25:10FromDiscord<nocturn9x> `board.position` is a `lent Position`
12:28:26*MauGal quit (Ping timeout: 252 seconds)
12:34:38*ntat joined #nim
12:36:20*jjido joined #nim
12:36:38FromDiscord<nocturn9x> oh FUCK
12:36:44FromDiscord<nocturn9x> I'm cloning the previous position and not changing the side to move
12:36:47FromDiscord<nocturn9x> hahahahahahahahahahaha
12:36:48FromDiscord<nocturn9x> what a moron
12:50:07*ntat quit (Quit: leaving)
13:03:20*beholders_eye quit (Quit: WeeChat 4.5.1)
13:05:07*ntat joined #nim
13:10:55*MauGal joined #nim
13:14:50*andreas joined #nim
13:14:56*andreas is now known as yacc
13:16:23yaccThe nim forum seems to refuse to register new users with "could not send email" (no matter if it's a gmail account or on a 3rd party ISP).
13:17:10FromDiscord<nnsee> yes, this is an ongoing issue, see https://forum.nim-lang.org/t/12690
13:17:49FromDiscord<nnsee> @pmunch can register an account for you
13:21:23*PMunch joined #nim
13:21:26FromDiscord<pmunch> Just PM me your preferred username and e-mail and I'll create an account for you
13:21:37PMunch@yacc, you can of course also do this on IRC
13:24:10yaccWell, let's ask around here: PDF parsing in nim? (Basically data scraping)
13:30:26FromDiscord<nnsee> tesseract may be an option? https://github.com/DavideGalilei/nimtesseract
13:31:38FromDiscord<nnsee> although iirc tesseract accepts image formats only, and converting PDF to an image is (obviously) lossy
13:32:05FromDiscord<nnsee> as PDFs often (but not always) include copyable plaintext
13:36:49yaccNo, it's a text pdf, so no need for OCR.
13:49:37*ntat quit (Quit: leaving)
13:52:55yaccAnyway, how does nim handle unicode? I can echo "strings that contain utf-8", but that's a side effect that my terminal is UTF-8 clean, but len(s) does count the unicode codepoints as 2 bytes.
13:53:22Amun-Racheck out std/unicode and runelen
13:53:34yacc@PMunch Private message?
13:55:11Amun-Rayacc: https://nim-lang.org/docs/unicode.html#runeLen%2Cstring
14:04:08FromDiscord<nocturn9x> uhhh @Robyn [She/Her]
14:04:09FromDiscord<nocturn9x> small problem
14:04:20FromDiscord<nocturn9x> I have this bit of coce
14:04:22FromDiscord<nocturn9x> (edit) "coce" => "code"
14:04:35FromDiscord<nocturn9x> sent a code paste, see https://play.nim-lang.org/#pasty=aMpAouYQ
14:04:47FromDiscord<nocturn9x> for some reason between the loading from FEN and move generation the position gets all fucked
14:04:55FromDiscord<nocturn9x> sent a code paste, see https://play.nim-lang.org/#pasty=msgDYFCZ
14:05:00FromDiscord<nocturn9x> it seems like the position is entirely reset to zero
14:05:53FromDiscord<nocturn9x> sent a code paste, see https://play.nim-lang.org/#pasty=oyeJVNmD
14:05:57FromDiscord<nocturn9x> is this somehow erasing ownership????
14:06:09FromDiscord<nocturn9x> (edit) "https://play.nim-lang.org/#pasty=uvybidAH" => "https://play.nim-lang.org/#pasty=gbfQQROr"
14:06:28FromDiscord<nocturn9x> I'm so confused
14:07:33FromDiscord<nocturn9x> ah I may have figured it out
14:07:35FromDiscord<nocturn9x> lolol
14:07:58FromDiscord<nocturn9x> for some tests at least
14:08:59FromDiscord<nocturn9x> still happens for others tho
14:09:01FromDiscord<nocturn9x> hmmm
14:12:50FromDiscord<Robyn [She/Her]> In reply to @nocturn9x "uhhh <@524288464422830095>": sorry was busy earlier
14:12:58FromDiscord<nocturn9x> dw!
14:13:01FromDiscord<nocturn9x> k so
14:13:04FromDiscord<nocturn9x> we have a VERY weird case
14:13:14FromDiscord<Robyn [She/Her]> Oh?
14:13:19FromDiscord<nocturn9x> the test now works for some cases and fails for others 😭
14:13:27FromDiscord<nocturn9x> sent a code paste, see https://play.nim-lang.org/#pasty=gHXaLgsF
14:13:34FromDiscord<nocturn9x> i.e. after generateMoves the position is basically zeroed
14:14:27FromDiscord<Robyn [She/Her]> hm
14:15:01FromDiscord<Robyn [She/Her]> In reply to @nocturn9x "i.e. after generateMoves the": check everywhere you use `ensureMove` and check if you should be using a clone
14:15:34FromDiscord<nocturn9x> I have used ensureMove a bit much tbh
14:15:36FromDiscord<nocturn9x> upsie
14:15:59FromDiscord<nocturn9x> would you be able to reproduce my woes locally?
14:16:04FromDiscord<nocturn9x> I can push to my branch if you're able to run some code
14:16:33FromDiscord<Robyn [She/Her]> In reply to @nocturn9x "would you be able": unfortunately on my phone rn, if you could wait roughly an hour though...
14:16:39FromDiscord<nocturn9x> no rush :)
14:16:50FromDiscord<Robyn [She/Her]> epic
14:26:06FromDiscord<nocturn9x> lmk when you're available :))
14:33:02FromDiscord<Robyn [She/Her]> In reply to @nocturn9x "lmk when you're available": ofc
14:35:14*ntat joined #nim
14:35:37FromDiscord<nocturn9x> :D
14:59:46FromDiscord<Robyn [She/Her]> @nocturn9x i'm able to test ya code now
15:04:27FromDiscord<nocturn9x> ayy
15:04:36FromDiscord<nocturn9x> lemme finish up lunch and I'll push to a branch
15:04:48FromDiscord<Robyn [She/Her]> kk
15:11:54FromDiscord<nocturn9x> you can clone https://git.nocturn9x.space/heimdall-engine/heimdall
15:12:03FromDiscord<nocturn9x> I recommend doing --depth 1 since the history is quite chonktastic
15:12:09FromDiscord<Robyn [She/Her]> kk
15:12:13FromDiscord<nocturn9x> then `git checkout movegen-tweaks`
15:12:42FromDiscord<nocturn9x> then to build, satisfy the dependencies once with `make net` and `make deps`, then you can do `make dev IS_DEBUG=1` to make a debug executable
15:12:56FromDiscord<nocturn9x> I've added some echo statements to the already failing test so it should be obvious what's happening
15:13:01FromDiscord<nocturn9x> let me know if you have any issues :)
15:13:23FromDiscord<Robyn [She/Her]> okay
15:15:15FromDiscord<Robyn [She/Her]> hm
15:16:18FromDiscord<Robyn [She/Her]> so `king = self.getPiece(kingSq)` specifcally causes an issue
15:16:25FromDiscord<nocturn9x> well not really
15:16:29FromDiscord<nocturn9x> that's a symptom
15:16:33FromDiscord<nocturn9x> the problem is the board is all empty
15:16:36FromDiscord<nocturn9x> and it shouldn't be
15:16:41FromDiscord<Robyn [She/Her]> ...huh hold on
15:16:50FromDiscord<nocturn9x> or rather it's all pawns, which is the default value for a piece
15:16:53FromDiscord<nocturn9x> (edit) "pawns," => "whitepawns,"
15:16:57FromDiscord<nocturn9x> (edit) "whitepawns," => "white pawns,"
15:17:01FromDiscord<nocturn9x> if you look at the last pair of FENs
15:17:05FromDiscord<nocturn9x> they should be identical, but aren't
15:17:21FromDiscord<nocturn9x> the second one shows the position has somehow been zeroed or corrupted
15:18:41FromDiscord<nocturn9x> btw I have an appointment in like 45 minutes
15:18:46FromDiscord<nocturn9x> which lasts ~50 minutes
15:18:53FromDiscord<nocturn9x> so I might disappear in a bit xD
15:18:56FromDiscord<nocturn9x> will be back soon tho
15:19:31FromDiscord<Robyn [She/Her]> movegen 281 `self.positions.add(self.positions.pop().generateMoves(moves, capturesOnly))`
15:19:40FromDiscord<Robyn [She/Her]> could this be a cause? is a clone wanted there?
15:22:08FromDiscord<nocturn9x> I mean
15:22:20FromDiscord<nocturn9x> why would simply generating moves warrant a copy?
15:23:39FromDiscord<nocturn9x> the point is that the position is mutated at some point but is then brought back to its original state
15:23:57FromDiscord<Robyn [She/Her]> that's fair
15:24:05FromDiscord<Robyn [She/Her]> honestly im sorta clueless about this
15:24:08FromDiscord<nocturn9x> it was definitely not copying before
15:24:13FromDiscord<nocturn9x> since it was all var parameters
15:25:08FromDiscord<nocturn9x> making a copy kind of misses the point of using move semantics
15:25:10FromDiscord<Robyn [She/Her]> I feel like something is mutating the board in an unsafe way but I have no clue what it could be, sorry
15:25:18FromDiscord<nocturn9x> rip
15:25:30FromDiscord<Robyn [She/Her]> this is just massive to me and i havent programmed much in a bit
15:25:43FromDiscord<nocturn9x> yeah I get it dw
15:27:53FromDiscord<nocturn9x> sent a code paste, see https://play.nim-lang.org/#pasty=FztwTbdR
15:28:07FromDiscord<nocturn9x> something must be forgetting to move stuff or whatever
15:28:11FromDiscord<nocturn9x> I can't explain it otherwise
15:29:48FromDiscord<nocturn9x> I've also had it print right after it has generated all the moves
15:29:50FromDiscord<nocturn9x> and that's fine
15:29:56FromDiscord<Robyn [She/Her]> makes sense
15:29:57FromDiscord<nocturn9x> so it must be happening between the return call
15:30:01FromDiscord<nocturn9x> or something
15:30:02FromDiscord<nocturn9x> idk
15:30:05FromDiscord<Robyn [She/Her]> could compare old code and new code?
15:30:13FromDiscord<Robyn [She/Her]> try and compare the difference in semantics
15:30:16FromDiscord<nocturn9x> idk they're very different now
15:30:30FromDiscord<nocturn9x> and I can't think of something that would make it work OK sometimes and break some other time
15:30:33FromDiscord<nocturn9x> it makes no sense
15:30:35FromDiscord<nocturn9x> the code is the same
15:31:38FromDiscord<nocturn9x> cloning it explicitly seems to fix it
15:31:42FromDiscord<nocturn9x> but causes other issues elsewhere
15:31:43FromDiscord<nocturn9x> hmm
15:33:49FromDiscord<nocturn9x> what the fuck is going on 😭
15:36:45FromDiscord<nocturn9x> I narrowed it down
15:37:02FromDiscord<nocturn9x> sent a code paste, see https://play.nim-lang.org/#pasty=hGJhOOcZ
15:38:24FromDiscord<nocturn9x> oh god.
15:38:34FromDiscord<nocturn9x> @Robyn [She/Her] take a guess
15:38:38FromDiscord<nocturn9x> what the problem is
15:38:49FromDiscord<nocturn9x> sent a code paste, see https://play.nim-lang.org/#pasty=MJeNewqd
15:38:52FromDiscord<nocturn9x> (edit) "https://play.nim-lang.org/#pasty=rcYZrVLt" => "https://play.nim-lang.org/#pasty=TUCewBqq"
15:38:54FromDiscord<nocturn9x> 💀
15:39:43FromDiscord<nocturn9x> the reason for the erratic behavior is that it only occurred in double checked positions 💀
15:42:45FromDiscord<Robyn [She/Her]> In reply to @nocturn9x "the reason for the": oh eeesh
15:42:53FromDiscord<Robyn [She/Her]> did you manage to fix it then?
15:42:56FromDiscord<nocturn9x> yeah
15:43:01FromDiscord<nocturn9x> now I have another crash somewhere else
15:43:02FromDiscord<Robyn [She/Her]> epic
15:43:05FromDiscord<nocturn9x> but at least, different error
15:43:08FromDiscord<Robyn [She/Her]> oh oof
15:44:37FromDiscord<nocturn9x> nevermind
15:44:41FromDiscord<nocturn9x> the code was actually garbage and made no sense
15:44:45FromDiscord<nocturn9x> now that I reworked it
15:44:47FromDiscord<nocturn9x> it works fine
15:44:51FromDiscord<nocturn9x> weird, but okay 💀
15:45:03FromDiscord<nocturn9x> probably was doing something that was OK before but breaks with this new system
15:45:58FromDiscord<nocturn9x> 💀 https://media.discordapp.net/attachments/371759389889003532/1347233755366166558/image.png?ex=67cb14b5&is=67c9c335&hm=7d658a540e6a62746cfc711340b1495ec4f714f7c481e747903b96188c98050b&
15:46:04FromDiscord<nocturn9x> there's bugs and it's slower than the original too
15:46:06FromDiscord<nocturn9x> pain
15:47:29FromDiscord<nocturn9x> it also fails perft
15:47:33FromDiscord<nocturn9x> aaaaa
15:48:05FromDiscord<nocturn9x> I'll fix this later
15:53:28*ntat quit (Quit: Leaving)
16:05:25FromDiscord<vazl> Howdy, folks 👋
16:05:52FromDiscord<odexine> hello
16:07:07*ntat joined #nim
16:30:29*MauGal quit (Ping timeout: 260 seconds)
16:30:42*PMunch_ joined #nim
16:32:11*PMunch quit (Read error: Connection reset by peer)
16:51:50FromDiscord<nocturn9x> In reply to @vazl "Howdy, folks 👋": hi!
17:30:59*jjido quit (Quit: My laptop has gone to sleep. ZZZzzz…)
17:34:08FromDiscord<nocturn9x> out of curiosity, is there a non eager version of `map` from sequtils?
17:34:22FromDiscord<nocturn9x> Something that can work with iterators or slices instead of just open arrays
17:39:44FromDiscord<odexine> not really no, its sequtils after all, but if you dont mind the output being a seq then maybe sugar.collect
17:41:28FromDiscord<aintea> btw does Nim have a ternary operator ?
17:42:22FromDiscord<odexine> use a regular if statement
17:42:31FromDiscord<odexine> `if xxx: somevalue else: someothervalue`
17:42:59FromDiscord<nervecenter> In reply to @aintea "btw does Nim have": `let cond_val = if something: this elif something_else: that else: another`
17:43:28FromDiscord<nervecenter> `if` is an expression that can return a value, same for `case`
17:43:38FromDiscord<aintea> something ore consice
17:44:18FromDiscord<aintea> (edit) "ore consice" => "more concise"
17:44:24FromDiscord<aintea> like the ternary operator in C
17:44:37FromDiscord<nervecenter> you can separate each clause by line if you want clarity, but there aren't any symbols if that's what you're asking
17:44:45FromDiscord<aintea> how sad
17:45:03FromDiscord<nervecenter> many such cases
17:45:40FromDiscord<odexine> nim is generally a "readably concise" language except for a few things
17:45:42FromDiscord<nervecenter> (obviously I'm joking, I don't think it's a big deal)
17:47:25FromDiscord<aintea> Do we have a way to make theenary operator ?
17:49:13FromDiscord<nervecenter> macros and templates exist if you want to try it yourself, but they can't outright change the syntax
17:50:54FromDiscord<fabric.input_output> In reply to @aintea "Do we have a": `if c: e1 else: e2` is the equivalent
17:51:41FromDiscord<aintea> sent a code paste, see https://play.nim-lang.org/#pasty=QgqWPjAG
17:51:59FromDiscord<fabric.input_output> nah you can't do that. why would you need to anyways?
17:52:04FromDiscord<fabric.input_output> or even want to
17:52:52FromDiscord<demotomohiro> sent a code paste, see https://play.nim-lang.org/#pasty=xTBghwwJ
17:55:15FromDiscord<aintea> In reply to @fabric.input_output "or even want to": Nim prides itself of being a programming language with the extensibility of LISP
17:55:20FromDiscord<aintea> let me do stuff
17:55:24FromDiscord<nervecenter> sent a code paste, see https://play.nim-lang.org/#pasty=eCrQGkas
17:55:25FromDiscord<fabric.input_output> sure
17:57:24FromDiscord<aintea> In reply to @nervecenter "`echo if true: "yes"": this is an example
18:00:30FromDiscord<aintea> sent a code paste, see https://play.nim-lang.org/#pasty=ZBHIVDdb
18:00:55FromDiscord<fabric.input_output> you don't need the parens btw
18:01:08FromDiscord<fabric.input_output> and in this example you can put everything on one line
18:07:58FromDiscord<odexine> In reply to @aintea "Nim prides itself of": nim doesnt provide you the syntax extensibility
18:08:50FromDiscord<odexine> that is the shortest you can do
18:10:23FromDiscord<demotomohiro> sent a code paste, see https://play.nim-lang.org/#pasty=bnYJJCSt
18:10:26FromDiscord<Robyn [She/Her]> sent a code paste, see https://play.nim-lang.org/#pasty=AIdxSMTt
18:11:11FromDiscord<Robyn [She/Her]> In reply to @demotomohiro "How about to combine": oh this is a better solution than mine (i was gonna make a type that acted as an intermediary)
18:14:16FromDiscord<Robyn [She/Her]> random question but is array indexing (with the `array` type) faster than if statements?
18:14:26FromDiscord<demotomohiro> But unlike if expression, it always evaluate both 'true' and 'false' expressions.↵It can be a problem if 'true' or 'false' expression has a side effect.
18:15:39FromDiscord<demotomohiro> And above code might less efficient than if expression.
18:17:29FromDiscord<Robyn [She/Her]> In reply to @demotomohiro "But unlike if expression,": enum indexed arrays?
18:17:45FromDiscord<odexine> In reply to @battery.acid.bubblegum "random question but is": probably not?
18:18:03FromDiscord<odexine> In reply to @battery.acid.bubblegum "enum indexed arrays?": what about enum indexed arrays would change this?
18:19:34FromDiscord<Robyn [She/Her]> In reply to @demotomohiro "But unlike if expression,": idk if this was aimed at me or AinTea
18:19:52FromDiscord<Robyn [She/Her]> In reply to @odexine "what about enum indexed": that's why i said enum indexed array, for more than true and false
18:20:09FromDiscord<odexine> huh?"?
18:20:20FromDiscord<odexine> i dont see what that would be useful for
18:20:49FromDiscord<odexine> the problem is that both branches are evaluated; in a regular if else statement only one branch is evaluated
18:21:13FromDiscord<odexine> this is inherently from how nim works, since it is an eager language
18:23:49FromDiscord<Robyn [She/Her]> In reply to @odexine "the problem is that": the value is already known at compile-time, but the access for it varies depending on runtime results, but tbh it's probably not useful even then
18:24:39FromDiscord<odexine> i have no idea what youre trying to say
18:27:20*derpydoo joined #nim
19:04:31FromDiscord<Robyn [She/Her]> In reply to @odexine "i have no idea": Yeah it's hard for me to articulate rn, if I figure out how to write it in english and not whatever tf my brain speaks, I'll let ya know
19:21:14*derpydoo quit (Quit: derpydoo)
20:25:25FromDiscord<abraham> sent a long message, see https://pasty.ee/XprOdMrh
20:26:10FromDiscord<Elegantbeef> Not as soon orc has a collector that doesn't fire instantly, but i'tll free it
20:27:06FromDiscord<abraham> I thought so, but it seemed a little too good to be true.
20:27:41FromDiscord<Elegantbeef> It's shitty automatic memory management if you have to manually do something 😄
20:42:18*jjido joined #nim
20:45:10*adigitoleo quit (*.net *.split)
20:45:29*adigitoleo joined #nim
21:27:30FromDiscord<nervecenter> In reply to @abraham "Hey folks, I'm trying": It's a type of reference counter so I imagine as soon as anything created with `new` loses all refs or goes out of scope, its count is checked and if 0 the destructor is called. So when the list is destroyed, it should chain to every node. In that case, yes is the answer to the second question. The point of RC and GC is it avoids manual memory semantic code in the vast majority of cases.
21:27:46FromDiscord<nervecenter> (edit) "loses all refs" => "is deleted"
21:28:24FromDiscord<nervecenter> (edit) "In reply to @abraham "Hey folks, I'm trying": It's" => "sent" | "type of reference counter so I imagine as soon as anything created with `new` is deleted or goes out of scope, its count is checked and if 0 the destructor is called. So when the list is destroyed, it should chain to every node. In that case, yes is the answer to the second question. The point of RC and GC is it avoids manual memory semantic code in the vast m
21:30:14FromDiscord<nervecenter> Garbage collectors are finicky in that they'll only collect when memory runs out, so it's "lazy" memory management. Reference counting cleans things up "eagerly".
21:30:52FromDiscord<nervecenter> They accomplish the same thing, but the eager behavior has a more deterministic impact on moment-to-moment behavior.
21:31:21FromDiscord<Elegantbeef> > Garbage collectors are finicky in that they'll only collect when memory runs out↵That's not true
21:31:47FromDiscord<nervecenter> I must have forgotten something along the way then, I forget
21:31:57FromDiscord<Elegantbeef> When to collect garbage is not forced in any single way. You can attempt to clean up garbage whenever
21:32:18FromDiscord<Elegantbeef> In fact garbage collectors usually expose procedures to stop automatic collection and allow you to control it manually
21:32:48FromDiscord<nervecenter> Isn't it the case that if not invoked manually, a GC will only collect when out of memory? Also, I'm pretty sure RCs constrain collection only to relevant objects, while GCs must clean the entire pool the object is contained in.
21:32:53FromDiscord<fabric.input_output> also generational gc
21:33:05FromDiscord<Elegantbeef> Nope
21:33:27FromDiscord<Elegantbeef> Why would you wait until memory issues to invoke GC
21:34:21FromDiscord<nervecenter> In reply to @Elegantbeef "Why would you wait": Unless I was taught wrong, I though it was an attempt to allocate with `new` when a GC checks its tables and runs a sweep if there's not enough contiguous space
21:35:07FromDiscord<Elegantbeef> The runtime can do collection whenever
21:35:12FromDiscord<nervecenter> While I also learned that an RC's only collection condition is a 0 count upon deallocation
21:35:16FromDiscord<Elegantbeef> It likely also checks on new if there is memory contention
21:35:18FromDiscord<nervecenter> Or are these just simple naive strategies
21:35:57FromDiscord<nervecenter> In reply to @Elegantbeef "The runtime can do": Well yes that too, sophisticated GCs can have timed collections and such
21:36:04*rockcavera joined #nim
21:36:10FromDiscord<nervecenter> I know high-throughput systems use timed and generational and all sorts of combined strategies
21:36:41FromDiscord<Elegantbeef> https://learn.microsoft.com/en-us/dotnet/standard/garbage-collection/fundamentals#conditions-for-a-garbage-collection C# does seem to do what you say
21:38:51FromDiscord<nervecenter> iirc JVM and BEAM implement all sorts of crazy knobs and switches
21:39:14FromDiscord<Elegantbeef> Nim's refc also has a bunch of configuration
21:39:43FromDiscord<Elegantbeef> Or atleast I think it did
21:41:16*ntat quit (Quit: Leaving)
21:42:27FromDiscord<nnsee> In reply to @nervecenter "Isn't it the case": not "out of memory", but rather memory pressure (usually). "pressure" is pretty loosely defined but more often than not it's rather conservative and collects as soon as it's reasonable to do so
21:42:48FromDiscord<nnsee> when talking about the defaults, that is
21:43:15FromDiscord<Elegantbeef> Though also what collection means also differs, some returns to the OS others might not
22:34:58*jjido quit (Quit: My laptop has gone to sleep. ZZZzzz…)
22:50:53FromDiscord<heysokam> @nervecenter might be a case of arc/orc algorithm doing things in a better way than your standard "by the book" GC mark-and-sweep implementation, and whoever gave you context not being aware of the new algorithms out there
22:51:46FromDiscord<heysokam> education is the slowest industry by far
23:35:50FromDiscord<nimble install python-zig?> What really gets me with gc is that you do have to think about stuff differently, like the fact that the logic for freeing complex structures like graphs is just baked means I don't need to avoid them as much as I do when writing in the manual languages I typically use.
23:45:35FromDiscord<Elegantbeef> This is why people like arena allocators for data types like that
23:45:47FromDiscord<Elegantbeef> Parsers and trees work well with arenas as you just free all of them when you're done
23:53:18FromDiscord<prestosilver> Yup
23:53:38FromDiscord<prestosilver> Actually so true, I always forget they exist
23:57:31FromDiscord<Elegantbeef> Insert people annoyed that Nim does not have an implicit `context` variable like Zig/Odin here