<< 26-02-2025 >>

01:02:02*xet7 quit (Remote host closed the connection)
01:03:51*xet7 joined #nim
01:51:16FromDiscord<Robyn [She/Her]> sent a code paste, see https://play.nim-lang.org/#pasty=vHDHdduR
01:52:34*SchweinDeBurg quit (Quit: WeeChat 4.6.0-dev)
02:45:11*SchweinDeBurg joined #nim
02:49:19*rockcavera quit (Remote host closed the connection)
03:44:25FromDiscord<leorize> this is probably not the best place to ask about CPS \:p
03:44:48FromDiscord<leorize> that's one continuation, fwiw
03:50:34FromDiscord<Elegantbeef> Robyn is matrix allergic
04:24:11*ensyde joined #nim
06:49:47*ensyde quit (Quit: WeeChat 4.5.1)
07:16:58*PMunch joined #nim
07:17:50FromDiscord<Robyn [She/Her]> In reply to @leorize "this is probably not": it's not specific to the nim-cps library since I'm working on a minimal impl myself rn aha, and thank you :)
07:18:16FromDiscord<Robyn [She/Her]> In reply to @Elegantbeef "Robyn is matrix allergic": when basically everything for me is usually on one app, it is a tad inconvenient
07:52:03*halloy2785 joined #nim
07:53:18FromDiscord<Robyn [She/Her]> hm i think i need to transform `IfExpr`s into statements before transforming the body
08:19:35*halloy2785 quit (Quit: halloy2785)
08:37:25*PMunch quit (Read error: Connection reset by peer)
08:37:37*PMunch joined #nim
08:45:52Amun-Rais there a when condition that let's me know I'm in compile-time process? so I can ie. call initRand when creating var object, and call fallback when creating const one
08:46:26PMunch`when nimvm` is supposed to do this IIRC
08:48:37Amun-Rathanks
09:26:46FromDiscord<entropydev> sent a code paste, see https://play.nim-lang.org/#pasty=OytvtBaQ
09:36:27FromDiscord<pmunch> In reply to @entropydev "Can anyone see what": Hmm, might be a limitation in the Nim <-> C++ wrapper
09:36:45FromDiscord<pmunch> Not sure if it's allowed to add default arguments on the Nim side of the wrapper
09:37:18FromDiscord<entropydev> oh interesting, I guess it's not too big a deal if the C++ side is already providing them
09:37:35FromDiscord<lainlaylie> look at the generated c++ and see where it's going wrong?
09:37:52FromDiscord<entropydev> actually, will that work?
09:38:04FromDiscord<entropydev> In reply to @lainlaylie "look at the generated": ok, how do I do that?
09:38:48FromDiscord<entropydev> (edit) "actually, will that work? ... " added "I can't make those arguments optional without providing a default value can I?"
09:38:54FromDiscord<lainlaylie> look in your nincache, it goes to some global cache directory by default, set --nimcache to change it
09:39:02FromDiscord<lainlaylie> (edit) "nincache," => "nimcache,"
09:39:37PMunch@entropydev, well you can always wrap it multiple times with different number of arguments
09:39:58FromDiscord<entropydev> ugh, that would be a major pain
09:43:40PMunchYou could always write a macro to do it automatically *shrug*
09:51:19FromDiscord<entropydev> In reply to @PMunch "You could always write": I guess that is true, still it does feel a bit like an oversight on the part of the FFI
09:51:43FromDiscord<entropydev> In reply to @lainlaylie "look in your nimcache,": I'm looking into this now
09:57:31PMunchYeah it does seem a bit weird
09:59:40FromDiscord<Robyn [She/Her]> Why is this code segfaulting? https://play.nim-lang.org/#pasty=UrHwBMwS
10:00:51FromDiscord<Robyn [She/Her]> oh my condition is just bad
10:01:25FromDiscord<entropydev> Is there another way to express optional arguments in Nim? If the C++ code handles the actual assignment my default value is unnecessary
10:02:33FromDiscord<entropydev> Like a type of "value or null" for the argument?
10:04:00*acidsys quit (Ping timeout: 244 seconds)
10:07:19*beholders_eye joined #nim
10:14:00FromDiscord<entropydev> In reply to @lainlaylie "look in your nimcache,": I'm afraid it isn't very easy to read
10:14:38FromDiscord<entropydev> sent a code paste, see https://play.nim-lang.org/#pasty=kxhhtJvF
10:14:51FromDiscord<entropydev> (edit) "https://play.nim-lang.org/#pasty=eKJvpUtS" => "https://play.nim-lang.org/#pasty=IKDMUWXK"
10:15:34FromDiscord<entropydev> (edit) "https://play.nim-lang.org/#pasty=OTOOIAtu" => "https://play.nim-lang.org/#pasty=JdZqkckA"
10:16:02FromDiscord<entropydev> (edit) "https://play.nim-lang.org/#pasty=qtEzVqLQ" => "https://play.nim-lang.org/#pasty=PSWjgjxZ"
10:16:37FromDiscord<entropydev> sent a code paste, see https://play.nim-lang.org/#pasty=YCFsWdYI
10:19:23FromDiscord<entropydev> I think I see the problem, the ArucoDetector constructor is running using the Dictionary before the Dictionary has been assigned, which doesn't seem to happen until the second block of code
10:19:36FromDiscord<entropydev> (edit) removed "seem to"
10:20:29*acidsys joined #nim
10:31:39FromDiscord<lainlaylie> Nim 2 introduced some execution order bugs in top-level code in C++ FFI, this looks like it's one of those
10:32:22FromDiscord<entropydev> actually the problem seems to be worse, even if I remove the default arguments it still does not work
10:32:26FromDiscord<lainlaylie> (edit) "it's" => "it might be"
10:34:31FromDiscord<entropydev> In reply to @lainlaylie "Nim 2 introduced some": So will this work if I wrap it in a main function?
10:35:45FromDiscord<entropydev> looks like it does!
10:35:58FromDiscord<entropydev> that's not a bad issue then
10:39:55FromDiscord<entropydev> everything works, including default arguments as long as it is in a main function
10:40:20FromDiscord<lainlaylie> the workaround is easy but its a pretty bad bug imo
11:09:14*ehmry is now known as emery
11:13:28*emery is now known as ehmry
11:38:29FromDiscord<blashyrk> Does anyone know of a nim (micro)benchmark library that doesn't do any allocations when measuring user code? `nimbench` is nice but the results vary wildly based on `--gc` even though my measured code performs no allocations
11:42:45FromDiscord<jabuci> sent a code paste, see https://play.nim-lang.org/#pasty=mwRDBHfx
11:46:59FromDiscord<blashyrk> sent a code paste, see https://play.nim-lang.org/#pasty=VKCbaKKj
11:49:05FromDiscord<jabuci> Yes, I want to use it without any objects.
11:55:45FromDiscord<jabuci> sent a code paste, see https://play.nim-lang.org/#pasty=VRxtOsFi
11:59:40FromDiscord<blashyrk> In reply to @jabuci "Is this correct? It": That is fine, however you cannot access the object's fields this way as the proc is declared on the object's type rather than an object instance
11:59:52FromDiscord<blashyrk> (edit) "instance" => "instance."
12:00:46FromDiscord<jabuci> That's fine, this is what I needed. Thanks!
12:03:44FromDiscord<Robyn [She/Her]> @blashyrk would benchy work for you? https://github.com/treeform/benchy
12:04:12FromDiscord<Robyn [She/Her]> From skimming the code, looks like allocations are done outside of the actual benchmarking code
12:14:29FromDiscord<blashyrk> sent a code paste, see https://play.nim-lang.org/#pasty=zZyxekmP
12:15:12FromDiscord<Robyn [She/Her]> Yeah that's odd then, sorry I can't help
12:15:23FromDiscord<blashyrk> Thanks for recommending benchy, I'll give it a shot!
12:15:48FromDiscord<Robyn [She/Her]> No sweat!
12:18:59FromDiscord<blashyrk> sent a code paste, see https://play.nim-lang.org/#pasty=sIufnhQv
12:19:40FromDiscord<blashyrk> Hm though I guess it should still be more than flat 0 😄
12:24:20FromDiscord<Robyn [She/Her]> ah...
12:24:42FromDiscord<Robyn [She/Her]> In reply to @blashyrk "Unfortunately, seems benchy stops": https://github.com/disruptek/criterion ? Haven't looked at the source though
13:43:50*ntat joined #nim
14:18:22FromDiscord<Elegantbeef> @blashyrk The GCs do use different exception handlers also are you compiling with `--panics:on`?
15:34:08FromDiscord<blashyrk> In reply to @Elegantbeef "<@148538079030935552> The GCs do": Thanks, that was it! With `--panics:on` the results are similar across MM modes. I assume this is because some built in functions use exceptions and this means "terminate process on any exception"?
16:05:56FromDiscord<lainlaylie> panics on turns defects into panics
16:06:14FromDiscord<lainlaylie> this fact is buried in this section of the manual↵https://nim-lang.org/docs/manual.html#definitions
16:54:59FromDiscord<leorize> you don't have to, the compiler will automatically convert Expr nodes to standard ones↵(@Robyn [She/Her])
17:01:26FromDiscord<Robyn [She/Her]> In reply to @leorize "you don't have to,": oh rad then
17:27:56FromDiscord<Robyn [She/Her]> sent a code paste, see https://play.nim-lang.org/#pasty=XCZcGmHc
17:28:01FromDiscord<Robyn [She/Her]> manual translation
18:42:16*nils` joined #nim
20:14:36FromDiscord<kiloneie> Why did that guy who mate Microsoft Sam text to speech Nim tutorial part 1 delete his post on the forums AND the video(unavailable comments from start) ?
20:14:44FromDiscord<kiloneie> (At em if you respond :))
20:29:33*ntat quit (Quit: Leaving)
20:44:59*dza quit (Excess Flood)
20:46:24*dza joined #nim
21:04:02*rockcavera joined #nim
21:23:15*tiorock joined #nim
21:23:16*tiorock quit (Changing host)
21:23:16*tiorock joined #nim
21:23:16*rockcavera is now known as Guest5200
21:23:16*Guest5200 quit (Killed (calcium.libera.chat (Nickname regained by services)))
21:23:16*tiorock is now known as rockcavera
21:25:25*tiorock joined #nim
21:25:25*tiorock quit (Changing host)
21:25:25*tiorock joined #nim
21:25:25*rockcavera quit (Killed (tantalum.libera.chat (Nickname regained by services)))
21:25:25*tiorock is now known as rockcavera
21:50:08*tiorock joined #nim
21:50:08*rockcavera quit (Killed (erbium.libera.chat (Nickname regained by services)))
21:50:08*tiorock is now known as rockcavera
22:04:46*ftajhii quit (Remote host closed the connection)
23:29:04*tiorock joined #nim
23:29:04*tiorock quit (Changing host)
23:29:04*tiorock joined #nim
23:29:04*rockcavera is now known as Guest3307
23:29:04*tiorock is now known as rockcavera
23:31:11*tiorock joined #nim
23:31:11*rockcavera is now known as Guest6684
23:31:11*tiorock is now known as rockcavera
23:32:45*Guest3307 quit (Ping timeout: 260 seconds)
23:34:30*Guest6684 quit (Ping timeout: 260 seconds)