<< 22-03-2025 >>

00:35:15*derpydoo quit (Quit: derpydoo)
01:00:28FromDiscord<sms219> sent a long message, see https://pasty.ee/HwZTBjKy
01:06:14FromDiscord<leorize> runtime duck typing is not really a thing in Nim
01:06:56FromDiscord<leorize> you can approximate the pattern by doing things like adding a object fields with procedures that should be implemented, and you know whether it's not implemented by checking if it's `nil`
01:06:57FromDiscord<heysokam> nim is not a dynamic language, so likely not↵unless someone has some wizardry that I'm not aware of, you will need get out of that pattern and design a beter api
01:07:09FromDiscord<heysokam> better
01:07:29FromDiscord<leorize> streams does something like this\: https://nim-lang.org/docs/streams.html#StreamObj
01:07:56FromDiscord<leorize> alternatively, if your options are fixed, then you can use an object variant
01:08:09FromDiscord<heysokam> the closest thing will likely be a template with `mixin`,↵but I would advise in favor of using proper types instead
01:08:42FromDiscord<leorize> but ideally you move out of that pattern, of which you'd need to describe more of what you're trying to do for us to figure out what you can restructure into
01:11:13FromDiscord<heysokam> In reply to @sms219 "In python you can": Thinking about it more, if I'm understanding correctly↵what you actually want can be done with `object of T` that takes a T argument and the basetype is guaranteed to have that member↵if you want the higher type to have it instead, then overload a proc for that type instead
01:11:54FromDiscord<heysokam> `and a function that takes a T argument`↵misspelled a bit
01:17:19FromDiscord<heysokam> sent a code paste, see https://play.nim-lang.org/#pasty=UfxalmZf
01:18:15FromDiscord<heysokam> (edit) "https://play.nim-lang.org/#pasty=wWYenWlT" => "https://play.nim-lang.org/#pasty=giHRCMoG"
01:18:23FromDiscord<heysokam> Does that make sense, @sms219 ?
01:20:24FromDiscord<heysokam> This is called Single Inheritance in Nim, for reference
01:20:35FromDiscord<sms219> sent a long message, see https://pasty.ee/XQPXxJqu
01:20:59FromDiscord<leorize> then the vtable technique is what you want
01:21:21FromDiscord<leorize> you parse the file, if you have a custom implementation, install it into the table
01:21:42FromDiscord<leorize> code that consumes it can consult the table to see if they should use it or not
01:21:43FromDiscord<heysokam> @Robyn [She/Her] was doing something similar some time back, iirc
01:22:21FromDiscord<heysokam> Dont know if she figured out a nice pattern to solve it cleanly
01:23:56FromDiscord<heysokam> But, if you are rewriting, I'd advise to find a better solution than a text file↵Nim has support for comptime programming that could solve the need to use text files for that
01:24:03FromDiscord<sms219> Thanks. I'll need to think about this for a bit longer. I still have lots of more straightforward code to port and can make progress on that first before dealing with this part.
01:24:54FromDiscord<Robyn [She/Her]> In reply to @heysokam "<@524288464422830095> was doing something": oh?
01:25:34FromDiscord<heysokam> In reply to @battery.acid.bubblegum "oh?": weren't you working on vtable-like mapping of procs to strings some time ago? 🐠
01:26:09FromDiscord<Robyn [She/Her]> I think I was loading DLLs for plugins
01:26:11FromDiscord<heysokam> maybe it was scarlet? i have the worst memory
01:26:16FromDiscord<Robyn [She/Her]> maybe i was tho and i dont remember
02:00:07*rockcavera joined #nim
03:42:38*derpydoo joined #nim
03:48:42FromDiscord<sms219> sent a long message, see https://pasty.ee/RDvnuBQV
03:49:47FromDiscord<Elegantbeef> Nim doesn't have narrowing
04:13:02FromDiscord<Robyn [She/Her]> In reply to @Elegantbeef "Nim doesn't have narrowing": hm i wonder if that could be done as a compiler plugin in Nimony or something
04:18:07FromDiscord<Elegantbeef> Possibly but likely not
04:35:41FromDiscord<Robyn [She/Her]> hmm
05:01:26FromDiscord<leorize> I've actually talked about doing this in skull
05:02:17FromDiscord<leorize> big problem is in write tracking/borrowing, since narrowing requires that you don't override the variable containing the pointer/ref, and the data within it
05:02:43FromDiscord<leorize> the current compiler is ill equipped for such analysis
05:12:20FromDiscord<Robyn [She/Her]> Maybe Nimony will make that easier
05:12:39FromDiscord<Robyn [She/Her]> Not sure, but it is a rewrite of the compiler so
05:37:27*rez joined #nim
05:40:47*rez quit (Client Quit)
05:41:07*rez joined #nim
05:41:18*rez quit (Client Quit)
05:41:50*rez joined #nim
06:05:12*rez quit (Quit: much snoozes...)
06:31:06*xet7 quit (Ping timeout: 246 seconds)
06:44:20*xet7 joined #nim
06:58:58*xet7 quit (Ping timeout: 252 seconds)
07:12:34*xet7 joined #nim
07:22:25*ntat joined #nim
08:16:46*tiorock joined #nim
08:16:46*tiorock quit (Changing host)
08:16:46*tiorock joined #nim
08:16:46*rockcavera quit (Killed (erbium.libera.chat (Nickname regained by services)))
08:16:46*tiorock is now known as rockcavera
08:18:51*tiorock joined #nim
08:18:51*tiorock quit (Changing host)
08:18:51*tiorock joined #nim
08:18:51*rockcavera is now known as Guest4574
08:18:51*tiorock is now known as rockcavera
08:21:45*Guest4574 quit (Ping timeout: 260 seconds)
08:47:21FromDiscord<enthus1ast.> In reply to @sms219 "Why does the following": Maybe ecs? We have some libs for ecs. Ref objects for entities will get slow quickly
08:48:17FromDiscord<enthus1ast.> And you could cram your system into threads as a nice benefit
08:48:25FromDiscord<enthus1ast.> (edit) "system" => "systems"
10:08:58*derpydoo quit (Ping timeout: 252 seconds)
11:09:10*rockcavera quit (Ping timeout: 260 seconds)
11:11:57*rockcavera joined #nim
11:12:57FromDiscord<tauruuuuuus> Is `seq[seq[T]]` the way to go for doing "simple" dynamic matrices? Essentially what you would do with `malloc(sizeof(T) count)` with C
11:21:25Amun-Raseq[seq[T]] is not an equivalent of malloc(sizeof T), that memory is not nontiguous
11:23:42*gshumway quit (Ping timeout: 244 seconds)
11:30:50FromDiscord<odexine> `seq[T]` would be that though
11:30:53FromDiscord<lainlaylie> should probably instead do a type that manages a seq[T] of widthheight and does the conversion between row/col and flat index right
11:30:59FromDiscord<odexine> pretty much
11:31:26FromDiscord<odexine> `type M[T, R: static int, C: static int] = distinct seq[T]` IIRC...
11:32:51*beholders_eye joined #nim
11:36:12FromDiscord<lainlaylie> think it needs to be `T;` but yeah
11:40:47FromDiscord<tauruuuuuus> What I'm trying to say is, there is no such thing in the std lib right?
11:40:52FromDiscord<tauruuuuuus> A direct analogue I mean
11:41:53FromDiscord<tauruuuuuus> I would have to build my own type/procs
11:46:19FromDiscord<odexine> In reply to @lainlaylie "think it needs to": forgor
11:46:27FromDiscord<odexine> In reply to @tauruuuuuus "What I'm trying to": No
11:47:40FromDiscord<tauruuuuuus> Got it thanks, maybe I'll try it later, for now seq of seq's is enough but I was curious
11:47:48*tiorock joined #nim
11:47:48*rockcavera is now known as Guest3485
11:47:48*Guest3485 quit (Killed (osmium.libera.chat (Nickname regained by services)))
11:47:48*tiorock is now known as rockcavera
11:47:52FromDiscord<tauruuuuuus> Btw I'm using nim for non-embedded for the first time in a more in depth way and gotta be honest, it's the best experience I've had with a language in recent years
11:49:56*tiorock joined #nim
11:49:56*tiorock quit (Changing host)
11:49:56*tiorock joined #nim
11:49:56*rockcavera is now known as Guest3167
11:49:56*Guest3167 quit (Killed (tantalum.libera.chat (Nickname regained by services)))
11:49:56*tiorock is now known as rockcavera
12:08:14*beholders_eye quit (Ping timeout: 272 seconds)
12:09:34FromDiscord<heysokam> In reply to @tauruuuuuus "Is `seq[seq[T]]` the way": https://github.com/treeform/vmath/blob/master/src/vmath.nim
12:09:53FromDiscord<heysokam> and https://github.com/mratsim/Arraymancer
12:18:11*gshumway joined #nim
13:12:18*gshumway quit (Ping timeout: 252 seconds)
13:15:21*xutaxkamay quit (Read error: Connection reset by peer)
13:15:31*xutaxkamay_ joined #nim
13:16:26*xutaxkamay_ is now known as xutaxkamay
13:19:43*gshumway joined #nim
13:32:26*beholders_eye joined #nim
13:44:25FromDiscord<Phil> sent a code paste, see https://play.nim-lang.org/#pasty=ngNvysmN
13:46:40*gshumway quit (Ping timeout: 260 seconds)
14:00:33FromDiscord<fabric.input_output> maybe look into some other email client does it?
14:00:36FromDiscord<fabric.input_output> like thunderbird
14:04:05*beholders_eye quit (Ping timeout: 248 seconds)
14:05:01FromDiscord<Phil> I wouldn't even know how to look tbh
14:05:51*gshumway joined #nim
14:06:47FromDiscord<zumi.dxy> something to do with google's weird requirements?
14:17:25*beholders_eye joined #nim
14:24:52FromDiscord<Phil> Maybe? I mean, I have an app-password which requires 2 FA; that is set up correctly, the PW is copy pasted correctly so I'm really not sure what it could be
15:05:14*beholders_eye quit (Ping timeout: 260 seconds)
15:25:12*tiorock joined #nim
15:25:12*rockcavera is now known as Guest4873
15:25:12*tiorock is now known as rockcavera
15:27:21*tiorock joined #nim
15:27:21*rockcavera is now known as Guest1261
15:27:21*Guest1261 quit (Killed (mercury.libera.chat (Nickname regained by services)))
15:27:21*tiorock is now known as rockcavera
15:29:04*Guest4873 quit (Ping timeout: 252 seconds)
15:33:24*coldfeet joined #nim
15:40:31FromDiscord<graveflo> @Robyn [She/Her] pick up here if you don't mind. I dunno if it's really impossible. I just couldn't get the macro to actually run when used in a case statement. I didn't try very hard but I just chalked it up to a fail. I also don't know if this macro will interfere with exceptions syntax since they both use `as` like that
15:44:38FromDiscord<Robyn [She/Her]> That's also fair
16:43:10FromDiscord<mronetwo0995> is it possible to parametrize fmt with a variable? this doesn't work↵↵`fmt("my data: {data:<LINE_LEN}")`
16:46:08Amun-Ra{data:<{LINE_LEN}}
16:46:25Amun-Rathat should work
16:48:05Amun-Raand if it doesn't and LINE_LEN is const you can make it static string first: fmt(static fmt"my data: {{data:<{LINE_LEN}}}")
16:48:52FromDiscord<mronetwo0995> sent a code paste, see https://play.nim-lang.org/#pasty=ddyftvgp
16:52:21FromDiscord<mronetwo0995> sent a code paste, see https://play.nim-lang.org/#pasty=iiLFkzNG
16:52:56Amun-Rathat's one ugly but it works: https://play.nim-lang.org/#pasty=PfkTlbyE
16:53:07FromDiscord<mronetwo0995> (edit) "https://play.nim-lang.org/#pasty=FBJdpvKz" => "https://play.nim-lang.org/#pasty=BfnYQMRf"
16:53:41Amun-Rayou can use padLeft
16:54:45FromDiscord<mronetwo0995> alignLeft?
16:55:13FromDiscord<mronetwo0995> btw with your example, is it that every `fmt` or `&` strips one layer of `{...}?
16:55:48Amun-Raright, alignLeft
16:55:52Amun-Rayes
16:56:03Amun-Rayou need to escape each { with {{ etc.
16:57:20FromDiscord<mronetwo0995> ok, great, thank you, the `alignLeft` does the job. is `fmt` working compile time? or only if I prepend the `static`?
16:57:49Amun-Rasomeone should correct me if I'm wrong but it isn't
17:18:30*ntat quit (Quit: leaving)
17:22:29*fallback quit (Ping timeout: 248 seconds)
17:36:01*ntat joined #nim
17:36:14*fallback joined #nim
17:37:39*ntat quit (Client Quit)
17:42:29FromDiscord<Elegantbeef> fmt expands at compile time and does not allow symbols to be used I guess unless you do what amun did
17:46:53*ntat joined #nim
17:48:08*odor joined #nim
17:55:46*odor quit (Quit: Client closed)
18:04:02*xet7 quit (Remote host closed the connection)
18:45:12*tk quit (Remote host closed the connection)
18:46:10*xet7 joined #nim
18:47:05*tk joined #nim
21:02:26*coldfeet quit (Quit: Lost terminal)
21:40:34*ntat quit (Quit: leaving)