<< 08-07-2023 >>

00:01:36*ltriant quit (Ping timeout: 246 seconds)
00:01:44*systemdsucks quit (Ping timeout: 246 seconds)
00:01:53*systemdsucks joined #nim
00:32:19*ltriant joined #nim
00:37:10*ltriant quit (Ping timeout: 260 seconds)
01:07:10*ltriant joined #nim
01:11:57*ltriant quit (Ping timeout: 246 seconds)
01:42:16*ltriant joined #nim
01:43:41*oldpcuser quit (Read error: Connection reset by peer)
01:46:57*ltriant quit (Ping timeout: 246 seconds)
02:16:17*ltriant joined #nim
02:20:51*ltriant quit (Ping timeout: 245 seconds)
02:50:40*ltriant joined #nim
02:55:26*ltriant quit (Ping timeout: 245 seconds)
03:22:36*ltriant joined #nim
03:27:08NimEventerNew thread by Niminem: W3C Compliant HTML Parser to replace current std/htmlparser , see https://forum.nim-lang.org/t/10328
03:27:24*ltriant quit (Ping timeout: 246 seconds)
03:46:16*ltriant joined #nim
03:51:12*ltriant quit (Ping timeout: 246 seconds)
04:19:56*ltriant joined #nim
04:27:44*ltriant quit (Ping timeout: 246 seconds)
04:58:41*ltriant joined #nim
05:04:11*ltriant quit (Ping timeout: 245 seconds)
05:10:38*ltriant joined #nim
05:15:33*ltriant quit (Ping timeout: 246 seconds)
05:20:11*ovenpasta joined #nim
05:45:23*ltriant joined #nim
05:50:01*ltriant quit (Ping timeout: 245 seconds)
06:19:46*ltriant joined #nim
06:24:36*ltriant quit (Ping timeout: 245 seconds)
06:56:44*ltriant joined #nim
07:00:18*azimut quit (Ping timeout: 240 seconds)
07:00:52*ntat joined #nim
07:01:36*ltriant quit (Ping timeout: 252 seconds)
07:28:06FromDiscord<gentk> By the way for vscode it’s probably worth trying all the nim extensions. For me it wasn’t the case that the newer versions were better.
07:29:13FromDiscord<gentk> Autocomplete was the most useful with the one that has most downloads, but hasn’t seen updates in 2 years or so
07:32:05*ltriant joined #nim
07:36:44*ltriant quit (Ping timeout: 246 seconds)
08:04:48*ltriant joined #nim
08:09:39*sagax quit (Read error: Connection reset by peer)
08:09:47*ltriant quit (Ping timeout: 245 seconds)
08:14:01*user__ joined #nim
08:17:31*ovenpasta quit (Ping timeout: 245 seconds)
08:36:33NimEventerNew thread by alexeypetrushin: Why iterator doesn't work?, see https://forum.nim-lang.org/t/10329
08:40:59*ltriant joined #nim
08:45:51*ltriant quit (Ping timeout: 245 seconds)
09:12:43FromDiscord<ac1original> sent a long message, see http://ix.io/4A3i
09:12:43FromDiscord<ac1original> thx :)
09:14:31FromDiscord<ac1original> (edit) "long message," => "code paste," | "http://ix.io/4A3i" => "https://play.nim-lang.org/#ix=4A3j"
09:21:16*ltriant joined #nim
09:24:11*jmdaemon quit (Ping timeout: 245 seconds)
09:25:51*ltriant quit (Ping timeout: 245 seconds)
09:25:52*dv^_^ quit (Ping timeout: 240 seconds)
09:26:29FromDiscord<intellj_gamer> Are you wanting to concatenate them as strings?
09:29:26*dv^_^ joined #nim
09:30:52FromDiscord<k0ts> sent a code paste, see https://play.nim-lang.org/#ix=4A3n
09:31:12FromDiscord<intellj_gamer> sent a code paste, see https://play.nim-lang.org/#ix=4A3o
09:31:30FromDiscord<k0ts> The real solution is to generate a number in 0 ..< 10 ^ 16 and then pad it using something like std/strutils.align
09:31:56FromDiscord<intellj_gamer> Also no need for the asserts, rand will also generate a number between 0..n (or whatever range you pass)
09:33:07FromDiscord<leetnewb> should also call randomize()
09:37:08FromDiscord<ac1original> Thank you
09:56:02*ltriant joined #nim
10:00:48*ltriant quit (Ping timeout: 246 seconds)
10:27:40*sagax joined #nim
10:28:58*ltriant joined #nim
10:33:49*ltriant quit (Ping timeout: 250 seconds)
10:50:06*ltriant joined #nim
10:55:11*ltriant quit (Ping timeout: 264 seconds)
10:57:29*ltriant joined #nim
11:01:33ntatIs it a function to generate random numbers (or sample from array) without repetition or must I write own?
11:05:59*ltriant quit (Ping timeout: 264 seconds)
11:08:08FromDiscord<odexine> "without repetition"? repetition does not mean it is no less random
11:08:40FromDiscord<odexine> if you mean shuffling an array then i think there is
11:14:01*ltriant joined #nim
11:16:08ntatodexine, I write this for sequence → https://ideone.com/Vs5Yea
11:17:00ntatI want to make eg. 5 unique numbers
11:18:15ntatIt works, but I think Is it better way? :)
11:20:07FromDiscord<odexine> make a seq of all numbers you want `var digits = toSeq(0..9)` shuffle `digits.shuffle()` take five `digits[0..<5]` but this will likely be slower than desirable so i think the thing you wrote is best
11:20:15FromDiscord<odexine> wel;
11:20:18FromDiscord<odexine> well
11:20:20FromDiscord<odexine> not sure about that
11:20:27FromDiscord<odexine> test both systems
11:21:40ntatOK :)
12:43:00FromDiscord<System64 ~ Flandre Scarlet> Are arrays passed by value or by reference?
12:43:47FromDiscord<System64 ~ Flandre Scarlet> (edit) "Are" => "Hi!↵Are"
12:43:57FromDiscord<odexine> they have pass-by-value semantics when theyre immutable in the parameter
12:44:04*azimut joined #nim
12:44:04FromDiscord<odexine> otherwise its pass-by-reference semantics
12:44:36FromDiscord<odexine> note that this doesnt mean that when its immutable its always copied, its only the semantics in usage
12:46:03FromDiscord<System64 ~ Flandre Scarlet> sent a code paste, see https://play.nim-lang.org/#ix=4A45
12:46:14FromDiscord<odexine> it will not compile
12:46:54FromDiscord<System64 ~ Flandre Scarlet> Oh alright
12:47:32FromDiscord<System64 ~ Flandre Scarlet> But that means all 256 values are copied?
12:47:46FromDiscord<odexine> again, no
12:48:03FromDiscord<System64 ~ Flandre Scarlet> and what to do if I want to make it mutable?
12:48:23FromDiscord<odexine> In reply to @odexine "note that this doesnt": if the size of the memory is over i believe 3 floating point values, then it is passed by reference BUT still has pass-by-value semantics
12:48:37FromDiscord<odexine> In reply to @sys64 "and what to do": add var before array `var array....`
12:48:51FromDiscord<odexine> this will not make your code faster
12:53:10FromDiscord<System64 ~ Flandre Scarlet> In reply to @odexine "this will not make": i will use var only if I need to modify the array
13:11:38FromDiscord<klepsi> hey does anyone know how to get nim db_postgres to return rows and column names for each value?
13:19:42*junaid_ joined #nim
14:13:55FromDiscord<treeform> In reply to @klepsi "hey does anyone know": I don't think db_postgres suppors that. But you can do that with a lower level API.
14:15:06FromDiscord<treeform> You will need to use low level libsql function like `PQfname`
14:16:28FromDiscord<klepsi> Well that sucks :/
14:16:34FromDiscord<treeform> for each value might be excessive, you probably just want to get a header
14:17:07FromDiscord<klepsi> Yeah, why isn't that in the std?
14:17:18FromDiscord<treeform> I don't know
14:19:55FromDiscord<treeform> In reply to @klepsi "Yeah, why isn't that": actually I might be wrong, Maybe you can get column names with https://nim-lang.org/docs/db_postgres.html#instantRows.i%2CDbConn%2CSqlPrepared%2Cvarargs%5Bstring%2C%5D never tried?
14:20:21FromDiscord<treeform> by "column text" it meant mean "column names"?
14:21:23FromDiscord<treeform> It does call `PQfname` here https://github.com/nim-lang/Nim/blob/version-1-6/lib/impure/db_postgres.nim#L425 so there must be a way to get that data out to you.
14:21:40FromDiscord<treeform> (edit) "meant mean" => "maybe means"
14:31:24*junaid_ quit (Remote host closed the connection)
14:33:32*nyeaa492842301 quit (Ping timeout: 258 seconds)
15:06:00FromDiscord<nivviv> sent a code paste, see https://play.nim-lang.org/#ix=4A4Q
15:44:20FromDiscord<michaelb.eth> In reply to @nivviv "hello. quick question": what if you move the declaration of the threadvar outside of `proc test` and initialize it on the first line of the the proc body?
15:51:52FromDiscord<nivviv> In reply to @michaelb.eth "what if you move": yes, then it works as expected. i suspect the more aggressive GC of arc/orc dtors the threadvar on scope exit, whereas refc was more lenient and it just didn't trigger.↵↵however, assuming that hunch is correct (i haven't checked the generated code) that sort of defeats the purpose of having a TLS var inside a func
15:53:51FromDiscord<michaelb.eth> might be worth asking about in #internals and/or filing a GitHub issue
15:54:19FromDiscord<michaelb.eth> maybe something needs to be clarified in the manual, or there's a bug outright
15:54:43FromDiscord<nivviv> thanks for checking/confirming. i'll probably ticket it on GH
16:10:38FromDiscord<heysokam> sent a code paste, see https://play.nim-lang.org/#ix=4A5a
16:19:32FromDiscord<nivviv> parseEnum[] ?
16:22:15FromDiscord<heysokam> seems to be it, ye. tytyt
17:15:18*Ekho quit (Ping timeout: 258 seconds)
17:33:24FromDiscord<mrgaturus> sent a code paste, see https://play.nim-lang.org/#ix=4A5u
17:50:38*azimut quit (Ping timeout: 240 seconds)
18:06:37nisstyreis the playground website down for anyone else?
18:06:39nisstyrewon't load here
18:07:38nisstyrecloudflare issue?
18:09:54ntatnisstyre, yes, as of yesterday it no longer works.
18:14:19nisstyreoh, that's unfortunate
18:14:37nisstyrecan someone explain what "ClosedSymChoice" is? Trying to make a macro and I see that some things use that
18:14:40nisstyrebut I'm not sure what it is
18:14:50nisstyree.g. the pow function from std/math
18:15:27nisstyrehttps://ideone.com/kP8pg5
18:15:38nisstyreit works for f or mypow, but not pow
18:16:15nisstyretrying to make something akin to (apply f xs) in Scheme
18:18:01nisstyreI'm sure this is missing a lot of error handling and stuff too
18:21:43*jmdaemon joined #nim
18:24:14nisstyreoh it has something to do with overloading
18:24:22nisstyrethat makes sense
18:45:43FromDiscord<michaelb.eth> In reply to @nisstyre "trying to make something": What would be the difference with using a varargs parameter?
18:47:39nisstyreyou call it with a sequence or array, not a variable number of arguments
18:47:44nisstyreit's like the opposite of that
18:48:19nisstyreexample use case, I have a sequence of stuff I want to pass to a constructor, and I just want to pass the sequence instead of indexing each argument
18:48:34nisstyreand I don't want to make a wrapper function or anything that takes a sequence
18:49:12nisstyreso MyThing(xs) rather than MyThing(xs[0], x[1], ...)
18:49:20nisstyreapply(MyThing, xs) I mean
18:51:25nisstyrea better version would also handle fixing position or keyword args too...
18:51:42nisstyrebut that gets more into partial application
18:52:26FromDiscord<michaelb.eth> You can e.g. pass an array in varargs position and it just works
18:52:48nisstyreyeah but the original function doesn't take varargs
18:52:52nisstyreor shouldn't need to
18:53:03FromDiscord<michaelb.eth> I see
18:53:30nisstyreanyway, I think the issue is that I'm not able to handle overloaded procs with this
18:53:46nisstyrebut not sure how to solve that
18:56:39FromDiscord<ac1original> what libraries du you use for GUI's?
18:57:30nisstyreI've used RayGUI with Nim and it works ok
18:57:40nisstyredoesn't come with a lot of built-in stuff though
18:57:54nisstyreand requires C bindings
18:58:02nisstyreImGUI might work better
18:58:12FromDiscord<ac1original> okay thank you. Can I also use it to code games or is that not a good idea
18:58:18nisstyreyou definitely can
18:58:26nisstyreit's part of Raylib, which is a game engine
18:58:39nisstyrehttps://github.com/Guevara-chan/Raylib-Forever
18:59:01nisstyrethis might be better done with Futhark now, though
18:59:06nisstyrefor generating C bindings
18:59:29FromDiscord<ac1original> thx
19:09:27nisstyreI guess I cannot have my macro work with overloaded procs unless it knows the type of the params somehow
19:09:35nisstyremaybe I can give a better error though
20:11:07*disso-peach quit (Quit: Leaving)
20:20:59*ntat quit (Quit: Leaving)
21:59:51FromDiscord<heysokam> In reply to @nisstyre "it's part of Raylib,": the amount of times I've heard "raylib is not an engine" in a passive agressive way in their channel makes me actually worry that you think this way
22:18:02FromDiscord<spotlightkid> @ac1original\: this was also recently discussed on the forum (probably not for the first nor the last time)\:↵● https://forum.nim-lang.org/t/10299↵● https://forum.nim-lang.org/t/10301
22:18:39FromDiscord<spotlightkid> Also, https://github.com/ringabout/awesome-nim#user-interface
22:36:44*calebjohn quit (Ping timeout: 240 seconds)
22:37:21*calebjohn joined #nim
22:54:11*user__ quit (Ping timeout: 245 seconds)
23:23:31wgetchis it possible to make a distinct int type that I can override, e.g. proc `$` only for that type and not for all the underlying int type?
23:26:23wgetchlucky me used the correct word for once. distinct, found it in the manual
23:27:31wgetchof course, then I have to borrow other stuff. hmm...
23:28:49nisstyreheysokman: I only say that because you have to compile it separately
23:29:02FromDiscord<Elegantbeef> Do you just want to override `$`?
23:29:47FromDiscord<Elegantbeef> If so wgetch you likely can make a converter to the base type
23:30:01FromDiscord<Elegantbeef> If you want it to be treated the same as the base but only override specific procedures
23:35:59wgetchyes that is closer to what I want
23:49:59*azimut joined #nim