| 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:08 | NimEventer | New 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:06 | FromDiscord | <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:13 | FromDiscord | <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:33 | NimEventer | New 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:43 | FromDiscord | <ac1original> sent a long message, see http://ix.io/4A3i |
| 09:12:43 | FromDiscord | <ac1original> thx :) |
| 09:14:31 | FromDiscord | <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:29 | FromDiscord | <intellj_gamer> Are you wanting to concatenate them as strings? |
| 09:29:26 | * | dv^_^ joined #nim |
| 09:30:52 | FromDiscord | <k0ts> sent a code paste, see https://play.nim-lang.org/#ix=4A3n |
| 09:31:12 | FromDiscord | <intellj_gamer> sent a code paste, see https://play.nim-lang.org/#ix=4A3o |
| 09:31:30 | FromDiscord | <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:56 | FromDiscord | <intellj_gamer> Also no need for the asserts, rand will also generate a number between 0..n (or whatever range you pass) |
| 09:33:07 | FromDiscord | <leetnewb> should also call randomize() |
| 09:37:08 | FromDiscord | <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:33 | ntat | Is 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:08 | FromDiscord | <odexine> "without repetition"? repetition does not mean it is no less random |
| 11:08:40 | FromDiscord | <odexine> if you mean shuffling an array then i think there is |
| 11:14:01 | * | ltriant joined #nim |
| 11:16:08 | ntat | odexine, I write this for sequence → https://ideone.com/Vs5Yea |
| 11:17:00 | ntat | I want to make eg. 5 unique numbers |
| 11:18:15 | ntat | It works, but I think Is it better way? :) |
| 11:20:07 | FromDiscord | <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:15 | FromDiscord | <odexine> wel; |
| 11:20:18 | FromDiscord | <odexine> well |
| 11:20:20 | FromDiscord | <odexine> not sure about that |
| 11:20:27 | FromDiscord | <odexine> test both systems |
| 11:21:40 | ntat | OK :) |
| 12:43:00 | FromDiscord | <System64 ~ Flandre Scarlet> Are arrays passed by value or by reference? |
| 12:43:47 | FromDiscord | <System64 ~ Flandre Scarlet> (edit) "Are" => "Hi!↵Are" |
| 12:43:57 | FromDiscord | <odexine> they have pass-by-value semantics when theyre immutable in the parameter |
| 12:44:04 | * | azimut joined #nim |
| 12:44:04 | FromDiscord | <odexine> otherwise its pass-by-reference semantics |
| 12:44:36 | FromDiscord | <odexine> note that this doesnt mean that when its immutable its always copied, its only the semantics in usage |
| 12:46:03 | FromDiscord | <System64 ~ Flandre Scarlet> sent a code paste, see https://play.nim-lang.org/#ix=4A45 |
| 12:46:14 | FromDiscord | <odexine> it will not compile |
| 12:46:54 | FromDiscord | <System64 ~ Flandre Scarlet> Oh alright |
| 12:47:32 | FromDiscord | <System64 ~ Flandre Scarlet> But that means all 256 values are copied? |
| 12:47:46 | FromDiscord | <odexine> again, no |
| 12:48:03 | FromDiscord | <System64 ~ Flandre Scarlet> and what to do if I want to make it mutable? |
| 12:48:23 | FromDiscord | <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:37 | FromDiscord | <odexine> In reply to @sys64 "and what to do": add var before array `var array....` |
| 12:48:51 | FromDiscord | <odexine> this will not make your code faster |
| 12:53:10 | FromDiscord | <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:38 | FromDiscord | <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:55 | FromDiscord | <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:06 | FromDiscord | <treeform> You will need to use low level libsql function like `PQfname` |
| 14:16:28 | FromDiscord | <klepsi> Well that sucks :/ |
| 14:16:34 | FromDiscord | <treeform> for each value might be excessive, you probably just want to get a header |
| 14:17:07 | FromDiscord | <klepsi> Yeah, why isn't that in the std? |
| 14:17:18 | FromDiscord | <treeform> I don't know |
| 14:19:55 | FromDiscord | <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:21 | FromDiscord | <treeform> by "column text" it meant mean "column names"? |
| 14:21:23 | FromDiscord | <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:40 | FromDiscord | <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:00 | FromDiscord | <nivviv> sent a code paste, see https://play.nim-lang.org/#ix=4A4Q |
| 15:44:20 | FromDiscord | <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:52 | FromDiscord | <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:51 | FromDiscord | <michaelb.eth> might be worth asking about in #internals and/or filing a GitHub issue |
| 15:54:19 | FromDiscord | <michaelb.eth> maybe something needs to be clarified in the manual, or there's a bug outright |
| 15:54:43 | FromDiscord | <nivviv> thanks for checking/confirming. i'll probably ticket it on GH |
| 16:10:38 | FromDiscord | <heysokam> sent a code paste, see https://play.nim-lang.org/#ix=4A5a |
| 16:19:32 | FromDiscord | <nivviv> parseEnum[] ? |
| 16:22:15 | FromDiscord | <heysokam> seems to be it, ye. tytyt |
| 17:15:18 | * | Ekho quit (Ping timeout: 258 seconds) |
| 17:33:24 | FromDiscord | <mrgaturus> sent a code paste, see https://play.nim-lang.org/#ix=4A5u |
| 17:50:38 | * | azimut quit (Ping timeout: 240 seconds) |
| 18:06:37 | nisstyre | is the playground website down for anyone else? |
| 18:06:39 | nisstyre | won't load here |
| 18:07:38 | nisstyre | cloudflare issue? |
| 18:09:54 | ntat | nisstyre, yes, as of yesterday it no longer works. |
| 18:14:19 | nisstyre | oh, that's unfortunate |
| 18:14:37 | nisstyre | can someone explain what "ClosedSymChoice" is? Trying to make a macro and I see that some things use that |
| 18:14:40 | nisstyre | but I'm not sure what it is |
| 18:14:50 | nisstyre | e.g. the pow function from std/math |
| 18:15:27 | nisstyre | https://ideone.com/kP8pg5 |
| 18:15:38 | nisstyre | it works for f or mypow, but not pow |
| 18:16:15 | nisstyre | trying to make something akin to (apply f xs) in Scheme |
| 18:18:01 | nisstyre | I'm sure this is missing a lot of error handling and stuff too |
| 18:21:43 | * | jmdaemon joined #nim |
| 18:24:14 | nisstyre | oh it has something to do with overloading |
| 18:24:22 | nisstyre | that makes sense |
| 18:45:43 | FromDiscord | <michaelb.eth> In reply to @nisstyre "trying to make something": What would be the difference with using a varargs parameter? |
| 18:47:39 | nisstyre | you call it with a sequence or array, not a variable number of arguments |
| 18:47:44 | nisstyre | it's like the opposite of that |
| 18:48:19 | nisstyre | example 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:34 | nisstyre | and I don't want to make a wrapper function or anything that takes a sequence |
| 18:49:12 | nisstyre | so MyThing(xs) rather than MyThing(xs[0], x[1], ...) |
| 18:49:20 | nisstyre | apply(MyThing, xs) I mean |
| 18:51:25 | nisstyre | a better version would also handle fixing position or keyword args too... |
| 18:51:42 | nisstyre | but that gets more into partial application |
| 18:52:26 | FromDiscord | <michaelb.eth> You can e.g. pass an array in varargs position and it just works |
| 18:52:48 | nisstyre | yeah but the original function doesn't take varargs |
| 18:52:52 | nisstyre | or shouldn't need to |
| 18:53:03 | FromDiscord | <michaelb.eth> I see |
| 18:53:30 | nisstyre | anyway, I think the issue is that I'm not able to handle overloaded procs with this |
| 18:53:46 | nisstyre | but not sure how to solve that |
| 18:56:39 | FromDiscord | <ac1original> what libraries du you use for GUI's? |
| 18:57:30 | nisstyre | I've used RayGUI with Nim and it works ok |
| 18:57:40 | nisstyre | doesn't come with a lot of built-in stuff though |
| 18:57:54 | nisstyre | and requires C bindings |
| 18:58:02 | nisstyre | ImGUI might work better |
| 18:58:12 | FromDiscord | <ac1original> okay thank you. Can I also use it to code games or is that not a good idea |
| 18:58:18 | nisstyre | you definitely can |
| 18:58:26 | nisstyre | it's part of Raylib, which is a game engine |
| 18:58:39 | nisstyre | https://github.com/Guevara-chan/Raylib-Forever |
| 18:59:01 | nisstyre | this might be better done with Futhark now, though |
| 18:59:06 | nisstyre | for generating C bindings |
| 18:59:29 | FromDiscord | <ac1original> thx |
| 19:09:27 | nisstyre | I guess I cannot have my macro work with overloaded procs unless it knows the type of the params somehow |
| 19:09:35 | nisstyre | maybe I can give a better error though |
| 20:11:07 | * | disso-peach quit (Quit: Leaving) |
| 20:20:59 | * | ntat quit (Quit: Leaving) |
| 21:59:51 | FromDiscord | <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:02 | FromDiscord | <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:39 | FromDiscord | <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:31 | wgetch | is 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:23 | wgetch | lucky me used the correct word for once. distinct, found it in the manual |
| 23:27:31 | wgetch | of course, then I have to borrow other stuff. hmm... |
| 23:28:49 | nisstyre | heysokman: I only say that because you have to compile it separately |
| 23:29:02 | FromDiscord | <Elegantbeef> Do you just want to override `$`? |
| 23:29:47 | FromDiscord | <Elegantbeef> If so wgetch you likely can make a converter to the base type |
| 23:30:01 | FromDiscord | <Elegantbeef> If you want it to be treated the same as the base but only override specific procedures |
| 23:35:59 | wgetch | yes that is closer to what I want |
| 23:49:59 | * | azimut joined #nim |