00:44:58 | * | xet7 joined #nim |
00:52:26 | FromDiscord | <gibson> In reply to @Elegantbeef "Atleast it shouldnt 😄": Well then, surprisingly it does! I don't know enough about concepts to have had an opinion either way. Why did you think it would not work? |
01:44:38 | FromDiscord | <Elegantbeef> refer to the typeclass comments |
01:44:40 | FromDiscord | <Elegantbeef> @gibson\: |
02:13:28 | FromDiscord | <wiga> any idea on how i can get the total amount of files in a directory |
02:15:13 | FromDiscord | <!Patitotective> In reply to @wiga "any idea on how": https://nim-lang.org/docs/os.html#walkDir.i%2Cstring |
02:17:22 | FromDiscord | <wiga> uh |
02:17:29 | FromDiscord | <wiga> doesnt work |
02:17:36 | FromDiscord | <wiga> or im just too tired idk |
02:17:51 | FromDiscord | <!Patitotective> what doesnt work? |
02:18:00 | FromDiscord | <wiga> how am i suppose to use it |
02:18:02 | FromDiscord | <wiga> im |
02:18:04 | FromDiscord | <wiga> e |
02:18:20 | FromDiscord | <Elegantbeef> It's an iterator so `for dir in walkDir` |
02:18:31 | FromDiscord | <wiga> but i just want a number... |
02:19:07 | FromDiscord | <!Patitotective> https://nim-lang.org/docs/sequtils.html#toSeq.t%2Cuntyped |
02:19:43 | FromDiscord | <wiga> ?&&????? |
02:19:56 | FromDiscord | <wiga> im |
02:19:57 | FromDiscord | <huantian> Don’t use toSeq beef is shivering from the extra allocations |
02:20:11 | FromDiscord | <wiga> i just want |
02:20:15 | FromDiscord | <wiga> total files |
02:20:17 | FromDiscord | <wiga> in |
02:20:20 | FromDiscord | <wiga> a dir |
02:20:28 | FromDiscord | <wiga> like an int |
02:20:44 | FromDiscord | <Elegantbeef> I swear people dont want to write a single line of code |
02:20:51 | FromDiscord | <Prestige> Lol |
02:20:56 | FromDiscord | <wiga> but i tried |
02:21:03 | FromDiscord | <!Patitotective> In reply to @Elegantbeef "I swear people dont": true |
02:21:16 | FromDiscord | <wiga> i just want to finish that thing so i can go to sleep |
02:21:28 | FromDiscord | <Prestige> Beef that reminds me: How can I create a set of all enum values at compile time? |
02:21:42 | FromDiscord | <Elegantbeef> sent a code paste, see https://play.nim-lang.org/#ix=46uH |
02:21:43 | FromDiscord | <Elegantbeef> enumtils.fullset |
02:21:49 | FromDiscord | <wiga> tysm |
02:21:53 | FromDiscord | <Elegantbeef> Or `{MyEnum.low..myEnum.high}` |
02:22:15 | FromDiscord | <!Patitotective> sent a code paste, see https://play.nim-lang.org/#ix=46uI |
02:22:17 | FromDiscord | <Prestige> hm I don't see `fullset` in enumutils, maybe I'm looking at something eld |
02:22:19 | FromDiscord | <Prestige> (edit) "eld" => "old" |
02:22:29 | FromDiscord | <Elegantbeef> It's in setutils maybe |
02:22:30 | FromDiscord | <wiga> In reply to @Patitotective "you need to check": i only have files in the directory i want to check |
02:22:31 | FromDiscord | <Elegantbeef> I always forget |
02:22:46 | FromDiscord | <demotomohiro> Calculating total number of files would requires count number of files in each directory recursively. |
02:23:28 | FromDiscord | <Elegantbeef> No one write the solution if they need recursive just mention `walkDirRec` and carry on |
02:24:19 | FromDiscord | <!Patitotective> In reply to @Elegantbeef "No one write the": he must be sleeping already lmao |
02:53:18 | FromDiscord | <!Patitotective> sent a code paste, see https://play.nim-lang.org/#ix=46uX |
02:54:50 | FromDiscord | <Elegantbeef> I dont follow the issue |
02:55:06 | FromDiscord | <!Patitotective> see the last line↵why are they not the same |
02:55:11 | FromDiscord | <!Patitotective> they should, right? |
02:55:21 | FromDiscord | <Elegantbeef> They're floats |
02:55:33 | FromDiscord | <Elegantbeef> I mean they should be the same |
02:55:47 | FromDiscord | <!Patitotective> yes, but `self.data[^1].padding` is 0 0 |
02:55:50 | FromDiscord | <Elegantbeef> But we'll blame it on them being floats |
02:56:00 | FromDiscord | <!Patitotective> let me put this on github |
03:01:30 | FromDiscord | <!Patitotective> https://github.com/Patitotective/ImNotify |
03:01:46 | FromDiscord | <!Patitotective> sent a code paste, see https://play.nim-lang.org/#ix=46v0 |
03:04:08 | FromDiscord | <Elegantbeef> What gc are you using by default? |
03:04:45 | FromDiscord | <!Patitotective> the default one |
03:06:02 | * | arkurious quit (Quit: Leaving) |
03:07:00 | FromDiscord | <Elegantbeef> Is there any chance imgui is mutating it? |
03:07:11 | FromDiscord | <Elegantbeef> Or anything is mutating it |
03:07:43 | FromDiscord | <flywind> nim secret seems to have a regression on Linux since 1.6.0? |
03:07:57 | FromDiscord | <Elegantbeef> In what way? |
03:08:09 | FromDiscord | <flywind> https://media.discordapp.net/attachments/371759389889003532/1004224126128488519/unknown.png |
03:08:12 | FromDiscord | <flywind> 1.6.0 |
03:08:38 | FromDiscord | <!Patitotective> In reply to @Elegantbeef "Or anything is mutating": no, they're just objects↵no pointers |
03:09:53 | FromDiscord | <flywind> In reply to @flywind "1.6.0": The prompt showed for results not for user inputs |
03:10:23 | FromDiscord | <flywind> At 1.4.8 |
03:10:30 | FromDiscord | <flywind> https://media.discordapp.net/attachments/371759389889003532/1004224714274771014/unknown.png |
03:10:43 | FromDiscord | <Elegantbeef> Well patito something is changing the values after adding |
03:10:51 | FromDiscord | <Elegantbeef> So i can only assume something unsafe is happening |
03:11:16 | FromDiscord | <!Patitotective> weird :/ |
03:14:51 | FromDiscord | <!Patitotective> sent a code paste, see https://play.nim-lang.org/#ix=46v1 |
03:15:10 | FromDiscord | <Elegantbeef> No you cant |
03:15:12 | FromDiscord | <!Patitotective> btw @flywind how did you get to that interactive console? |
03:15:39 | FromDiscord | <Elegantbeef> sent a code paste, see https://play.nim-lang.org/#ix=46v2 |
03:15:43 | FromDiscord | <Elegantbeef> `nim secret` opens up a nimscript repl |
03:16:20 | FromDiscord | <!Patitotective> sent a code paste, see https://play.nim-lang.org/#ix=46v3 |
03:16:39 | FromDiscord | <Elegantbeef> Dont find/fix the issue just work around it |
03:16:42 | FromDiscord | <Elegantbeef> That's never a good way to work |
03:17:02 | FromDiscord | <!Patitotective> hehe |
03:32:20 | FromDiscord | <!Patitotective> sent a code paste, see https://play.nim-lang.org/#ix=46v5 |
03:35:01 | FromDiscord | <!Patitotective> i should report this to nimgl/imgui, right? |
03:35:15 | FromDiscord | <Elegantbeef> Perhaps |
03:35:32 | FromDiscord | <Elegantbeef> See if you can remove the imgui dependency |
03:36:37 | FromDiscord | <!Patitotective> at first instance replacing imgui's ImVec2 seems to fix it |
03:36:47 | FromDiscord | <!Patitotective> and thats all im using form imgui |
03:40:11 | FromDiscord | <!Patitotective> https://github.com/nimgl/nimgl/issues/83 |
03:41:34 | FromDiscord | <!Patitotective> 🌃 |
03:49:03 | FromDiscord | <demotomohiro> That looks like compiler bug. It seems just set value of the object and add it to seq. It uses types in imgui but not calling procs in imgui. |
03:50:43 | FromDiscord | <demotomohiro> Does `echo data` or `echo data[^1]` print incorrect value? |
03:51:47 | FromDiscord | <wiga> In reply to @Patitotective "he must be sleeping": No im eating |
03:51:59 | FromDiscord | <wiga> Sleep comes after |
04:06:54 | FromDiscord | <!&luke> In reply to @Patitotective "btw <@658563905425244160> how did": Is that not inim? |
04:07:08 | FromDiscord | <Elegantbeef> No that's nim secret |
04:07:17 | FromDiscord | <!&luke> Wot |
04:07:40 | FromDiscord | <!&luke> Oh wow |
04:52:59 | * | jmd_ joined #nim |
04:53:02 | * | jmdaemon quit (Ping timeout: 240 seconds) |
05:09:07 | FromDiscord | <Phil> In reply to @ripluke "Oh wow": inim --> Full feature support for all nim libs↵nim secret --> no support for some of them |
05:16:41 | NimEventer | New Nimble package! thes - Thesaurus CLI/Library & Analyzer in Nim, see https://github.com/c-blake/thes |
05:21:17 | FromDiscord | <pepperoni> how do u do functions in nim |
05:21:18 | * | jmdaemon joined #nim |
05:22:26 | * | jmd_ quit (Ping timeout: 268 seconds) |
05:28:25 | FromDiscord | <!&luke> proc |
05:29:14 | FromDiscord | <!&luke> https://nim-lang.org/docs/tut1.html |
05:30:06 | FromDiscord | <!&luke> https://nim-lang.org/docs/tut1.html#procedures |
05:30:39 | FromDiscord | <!&luke> @pepperoni |
06:03:19 | * | rockcavera quit (Remote host closed the connection) |
06:04:43 | * | jmd_ joined #nim |
06:06:13 | * | jmdaemon quit (Ping timeout: 268 seconds) |
06:49:48 | FromDiscord | <PyryTheBurger> sent a code paste, see https://play.nim-lang.org/#ix=46vW |
07:42:05 | FromDiscord | <Hamid_Bluri> what the hell is going on https://media.discordapp.net/attachments/371759389889003532/1004293057753124905/unknown.png |
07:43:28 | FromDiscord | <Prestige> What's the value of mySet.compliment? |
07:44:15 | FromDiscord | <Hamid_Bluri> it's even fails on `{1, 2}` == `{1, 2}` |
07:44:20 | FromDiscord | <Hamid_Bluri> (edit) "it's" => "it" |
07:44:40 | FromDiscord | <Hamid_Bluri> sent a code paste, see https://play.nim-lang.org/#ix=46w8 |
07:45:40 | FromDiscord | <Hamid_Bluri> i think that's `check` problem |
07:46:34 | FromDiscord | <Hamid_Bluri> sent a code paste, see https://play.nim-lang.org/#ix=46wa |
07:48:55 | FromDiscord | <Prestige> Wrap in parens |
07:49:15 | FromDiscord | <flywind> unittest has some limitations like https://nim-lang.org/docs/unittest.html#limitationsslashbugs Probbably related. |
07:49:30 | FromDiscord | <flywind> (edit) "Probbably" => "Probably" |
07:49:41 | FromDiscord | <Prestige> I wrote my own little testing framework because of weird nonsense like that |
07:59:33 | FromDiscord | <Hamid_Bluri> no really looks like `==` proc is not defined for `set` |
08:00:11 | FromDiscord | <Hamid_Bluri> https://media.discordapp.net/attachments/371759389889003532/1004297614872813578/unknown.png |
08:02:09 | * | fallback quit (Ping timeout: 268 seconds) |
08:09:10 | FromDiscord | <Hamid_Bluri> debugEcho "---------------------" |
08:09:21 | FromDiscord | <Hamid_Bluri> uncomment this |
08:09:22 | FromDiscord | <Hamid_Bluri> https://play.nim-lang.org/#ix=46wg |
08:09:27 | FromDiscord | <Hamid_Bluri> and get different result |
08:10:45 | FromDiscord | <Hamid_Bluri> I guess it's somehow related to the number of the lines 😄 |
08:13:39 | * | fallback joined #nim |
08:36:15 | FromDiscord | <Hamid_Bluri> https://github.com/nim-lang/Nim/issues/20142 |
08:44:47 | FromDiscord | <flywind> In reply to @hamidb80 "https://github.com/nim-lang/Nim/issues/20142": remove the range subtype, it works too. |
08:45:35 | FromDiscord | <flywind> sent a code paste, see https://play.nim-lang.org/#ix=46wq |
08:45:40 | FromDiscord | <Elegantbeef> Ah the issue is that `T` is inferred to be the subrange type and it "converts" the latter to it |
08:46:02 | FromDiscord | <Elegantbeef> As such it's data is off |
08:46:32 | FromDiscord | <flywind> Yeah, I think so. |
08:49:05 | FromDiscord | <Elegantbeef> sent a code paste, see https://paste.rs/wVy |
08:49:31 | FromDiscord | <Elegantbeef> Line 7 errors since `T` is bound to `set[char]` |
08:51:17 | FromDiscord | <Elegantbeef> sent a code paste, see https://play.nim-lang.org/#ix=46wt |
08:51:32 | FromDiscord | <Elegantbeef> So probably in everyone's favourite `typerel` procedure |
08:53:09 | FromDiscord | <Elegantbeef> Maybe i'm wrong? https://github.com/nim-lang/Nim/blob/devel/compiler/sigmatch.nim#L1311-L1322 |
09:10:49 | FromDiscord | <flywind> In reply to @Elegantbeef "Maybe i'm wrong? https://github.com/nim-lang/Nim/bl": git blame is quite useful |
09:10:58 | FromDiscord | <flywind> https://github.com/nim-lang/Nim/issues/16270 |
09:11:03 | FromDiscord | <flywind> (edit) |
09:12:12 | FromDiscord | <Elegantbeef> I really hope that it doesnt drop the optimization |
09:12:13 | FromDiscord | <Elegantbeef> That'd be a shame |
09:12:39 | FromDiscord | <Elegantbeef> Though i guess it doesnt change much |
09:13:26 | FromDiscord | <Elegantbeef> Anyway I dont know if i'd argue `set[char] + set['a'..'c']` should even be legal |
09:15:03 | FromDiscord | <flywind> It seems to be an existing issue https://github.com/nim-lang/Nim/issues/18396 |
09:15:13 | FromDiscord | <flywind> (edit) "existing" => "pre-existing" |
09:26:52 | FromDiscord | <jmgomez> sent a code paste, see https://play.nim-lang.org/#ix=46wG |
09:26:59 | FromDiscord | <jmgomez> https://media.discordapp.net/attachments/371759389889003532/1004319458145345566/message.txt |
09:27:21 | * | LaughingBubba joined #nim |
09:27:38 | FromDiscord | <jmgomez> Seems to be that the ptr is not valid? But cant see why if it's just being created there |
09:33:18 | LaughingBubba | Hi I'd like to submit a PR to fix a problem with xmltree. Do you want me to raise an issue in GH and link the PR to that or can I write a meaningful commit message and PR body? I've already talked about the problem in the forum here: https://forum.nim-lang.org/t/9335#61306 |
09:34:42 | FromDiscord | <flywind> Either way is fine. |
09:35:20 | LaughingBubba | Ok cool. Thanks |
10:33:10 | FromDiscord | <EyeCon> Don't we have `enumerate` anymore? I can't import it |
10:33:51 | FromDiscord | <EyeCon> sent a code paste, see https://play.nim-lang.org/#ix=46wY |
10:34:40 | NimEventer | New thread by Yglukhov: Associating compile time data with function identifiers, see https://forum.nim-lang.org/t/9344 |
10:35:33 | FromDiscord | <Rika> In reply to @EyeCon "Don't we have `enumerate`": How do you import it? |
10:35:34 | FromDiscord | <Bung> sent a code paste, see https://play.nim-lang.org/#ix=46wZ |
10:36:26 | FromDiscord | <EyeCon> In reply to @Rika "How do you import": I'm not sure what you are asking exactly, hope this helps https://media.discordapp.net/attachments/371759389889003532/1004336936137277500/unknown.png |
10:36:34 | FromDiscord | <Rika> That’s wrong |
10:36:39 | FromDiscord | <Rika> You must have the std prefix |
10:36:43 | FromDiscord | <Rika> std/enumerate |
10:37:06 | FromDiscord | <EyeCon> Previously that was optional, has something changed? |
10:37:18 | FromDiscord | <Rika> It has never been optional for enumerate |
10:37:31 | FromDiscord | <Rika> All new standard library packages require this, only old packages have it as optional |
10:37:54 | FromDiscord | <EyeCon> OK, thanks |
10:46:31 | * | krux02 joined #nim |
10:55:59 | FromDiscord | <4zv4l> sent a code paste, see https://play.nim-lang.org/#ix=46x4 |
10:56:16 | FromDiscord | <4zv4l> sent a code paste, see https://play.nim-lang.org/#ix=46x5 |
10:56:25 | FromDiscord | <4zv4l> is there another formater that could work ? |
10:57:05 | FromDiscord | <dom96> it wants a `string` you're giving it a `char` |
10:57:12 | FromDiscord | <dom96> put `$` in front of every `board` |
10:57:38 | FromDiscord | <4zv4l> what will this change ? |
10:57:53 | FromDiscord | <Rika> It will make the characters strings |
10:57:57 | * | LaughingBubba quit (Quit: Client closed) |
10:57:57 | FromDiscord | <Rika> And then it will work |
10:58:27 | FromDiscord | <4zv4l> alright, some black magic ok xD |
11:02:29 | FromDiscord | <4zv4l> is there a quicker way to write that type↵`array[3, array[3, char]]` ? |
11:04:35 | FromDiscord | <konsumlamm> you can make a type alias for it |
11:04:44 | FromDiscord | <konsumlamm> but there's no sugar for it |
11:07:39 | FromDiscord | <4zv4l> alright I'm a bit struggling with the pointer syntax also |
11:08:13 | FromDiscord | <4zv4l> how do I give a reference of a variable to a function ? |
11:08:25 | FromDiscord | <4zv4l> I tried the `ref` but it doesn't seem to work |
11:08:53 | FromDiscord | <konsumlamm> first, why do you want to pass a reference of a variable? |
11:08:59 | FromDiscord | <4zv4l> well |
11:09:38 | FromDiscord | <4zv4l> sent a long message, see http://ix.io/46x8 |
11:09:42 | FromDiscord | <Generic> ref objects need to be created as ref |
11:09:43 | FromDiscord | <4zv4l> (edit) "http://ix.io/46x8" => "http://ix.io/46x9" |
11:09:49 | FromDiscord | <4zv4l> `ptr` then ? |
11:09:55 | FromDiscord | <Generic> no, you can use var parameters |
11:09:59 | FromDiscord | <konsumlamm> in this case you want to pass an `openArray` |
11:10:02 | FromDiscord | <enthus1ast> do\:↵board\: var Board |
11:10:07 | FromDiscord | <Generic> yes this ^ |
11:10:16 | FromDiscord | <konsumlamm> but in general, you'll want a `var T` argument |
11:10:36 | FromDiscord | <Generic> you don't need to do anything on the call site |
11:11:16 | FromDiscord | <4zv4l> so it's when I call the function that I precise if I copy it or pass the pointer of it ? |
11:11:24 | FromDiscord | <konsumlamm> In reply to @konsumlamm "in this case you": nvm, it was `var openArray[T]` |
11:11:52 | FromDiscord | <4zv4l> sent a code paste, see https://play.nim-lang.org/#ix=46xa |
11:11:58 | FromDiscord | <4zv4l> I just wanna make play able to modify the board |
11:12:07 | FromDiscord | <Generic> yeah then use var parameters |
11:12:20 | FromDiscord | <4zv4l> var ? |
11:12:29 | FromDiscord | <Generic> board: var Board |
11:12:35 | FromDiscord | <Generic> in the definition of play |
11:12:47 | FromDiscord | <4zv4l> but then it will change play only in the function stack no ? |
11:12:56 | FromDiscord | <4zv4l> it will copy it no ? |
11:13:16 | FromDiscord | <Generic> it will implicitly pass a pointer |
11:13:32 | FromDiscord | <4zv4l> the syntax seems weird |
11:13:37 | FromDiscord | <4zv4l> adding var to tell that's a pointer ? |
11:13:39 | FromDiscord | <Generic> and modify the variable given at call site |
11:13:52 | FromDiscord | <Generic> well "pointer" is what happens behind the scenes |
11:14:07 | FromDiscord | <Generic> from a user perspective it's more comparable to C++'s references |
11:14:30 | FromDiscord | <Generic> you'd write Board& board there |
11:14:50 | FromDiscord | <enthus1ast> when you pass it pass ptr board, then the semantic changes later\:board[].doStuff, when you do just var then it does not change↵(@4zv4l) |
11:15:19 | FromDiscord | <4zv4l> In reply to @Generic "from a user perspective": I never really coded in C++ |
11:15:35 | FromDiscord | <4zv4l> so I only know C/Go/Rust/Zig pointers way |
11:15:42 | FromDiscord | <4zv4l> which seems more understandable than Nim pointers |
11:16:12 | FromDiscord | <konsumlamm> itcs like `&mut` in Rust |
11:16:46 | FromDiscord | <4zv4l> yeah but using `var` sounds like creating a new var in the function stack which isn't what it's actually doing |
11:17:17 | FromDiscord | <4zv4l> func (var i )↵you don't expect that i to actually be a pointer to the func(i) |
11:17:33 | FromDiscord | <4zv4l> more looks like a new fresh variable |
11:17:33 | FromDiscord | <enthus1ast> var in this context could be called "out" or "modifieable" or so, but this ship has sailed i guess |
11:18:12 | FromDiscord | <konsumlamm> i find the behaviour pretty intuitive ¯\\_(ツ)\_/¯ |
11:18:22 | FromDiscord | <enthus1ast> same↵(@konsumlamm) |
11:18:34 | FromDiscord | <4zv4l> sent a long message, see http://ix.io/46xc |
11:18:36 | FromDiscord | <enthus1ast> but its stuff you must know i guess \:) |
11:18:37 | FromDiscord | <4zv4l> seems more intuitive to me |
11:19:03 | FromDiscord | <4zv4l> I mean it's weird to use the same keyword you use to create a new variable to also tell that's a pointer |
11:19:10 | FromDiscord | <enthus1ast> sent a long message, see http://ix.io/46xe |
11:19:19 | FromDiscord | <4zv4l> In reply to @enthus1ast "then you would use\:": we can do that ? |
11:19:20 | FromDiscord | <konsumlamm> ptr is a raw pointer in Nim, nothing you wanna use directly usually |
11:20:35 | FromDiscord | <4zv4l> also metaprogramming is nice but having to write `mod` instead of using `%` or `addr` instead of `&` is a bit weird to me also for now↵I guess I'll get used to it |
11:21:40 | FromDiscord | <4zv4l> but the `addr`|`ptr` is ok, more understandable |
11:22:16 | FromDiscord | <konsumlamm> also more unsafe |
11:22:30 | FromDiscord | <4zv4l> why more unsafe ? |
11:22:36 | FromDiscord | <4zv4l> more unsafe than `var` ? |
11:23:00 | FromDiscord | <4zv4l> why ? |
11:23:44 | FromDiscord | <enthus1ast> because a pointer can point to null↵(@4zv4l) |
11:23:46 | FromDiscord | <enthus1ast> or anywhere |
11:23:49 | FromDiscord | <konsumlamm> because it operates on raw pointers, there's no guarantee that an arbitrary pointer is valid |
11:23:57 | FromDiscord | <enthus1ast> you cannot reassign a ref |
11:24:16 | FromDiscord | <konsumlamm> In reply to @konsumlamm "because it operates on": whereas for `var` parameters, there is |
11:24:45 | FromDiscord | <enthus1ast> ref is also more userfriendly, since you do not have to deref all the time |
11:25:46 | FromDiscord | <planetis> It's managed by the compiler and hidden from the user. So you don't have to worry for things like dereferencing or lifetimes |
11:26:57 | FromDiscord | <4zv4l> alright, I need to get used to that xD |
11:27:29 | FromDiscord | <enthus1ast> i mean, c also has -\@4zv4l) |
11:27:54 | FromDiscord | <enthus1ast> which is (\foo).baa ? |
11:28:01 | FromDiscord | <4zv4l> yeah for struct |
11:28:29 | FromDiscord | <4zv4l> I just mean↵having to use `var` in a function arguments is weird to me↵even more if it means it's a pointer |
11:28:40 | FromDiscord | <enthus1ast> its a ref |
11:28:42 | FromDiscord | <enthus1ast> not a pointer |
11:28:48 | FromDiscord | <enthus1ast> a pointer can be reassigned |
11:28:51 | FromDiscord | <enthus1ast> a ref cannot |
11:30:57 | FromDiscord | <konsumlamm> it's not a `ref` |
11:31:13 | FromDiscord | <konsumlamm> `ref` is a garbage collected pointer |
11:32:20 | FromDiscord | <planetis> My problem was getting used to the other way around. This so much easier. |
11:35:29 | FromDiscord | <Zectbumo> is there a way to exec a process and have it replace the current nim process? |
11:35:40 | FromDiscord | <enthus1ast> https://www.reddit.com/r/nim/comments/rpw5xf/difference_between_ref_and_a_var_inside_proc/↵↵PMunch describes it nicely |
11:36:14 | * | TakinOver quit (Ping timeout: 240 seconds) |
11:37:43 | FromDiscord | <enthus1ast> start a new process, then exit the current one?↵(@Zectbumo) |
11:40:36 | FromDiscord | <Zectbumo> that would give me a new pid. I'm looking for something like the bourne shell `exec` command |
11:42:55 | FromDiscord | <Rika> posix execv() |
11:43:39 | FromDiscord | <Rika> https://linux.die.net/man/3/execv |
11:43:48 | FromDiscord | <Rika> I don’t recall if it’s POSIX actually |
11:44:06 | FromDiscord | <Rika> Yup it is |
11:44:07 | FromDiscord | <Zectbumo> oh I'll check the posix module |
11:44:12 | FromDiscord | <Rika> Don’t ask me about windows |
11:45:25 | FromDiscord | <enthus1ast> what is the usecase for this btw? |
11:45:26 | FromDiscord | <Zectbumo> I won't be 😉 here it is↵https://nim-lang.org/docs/posix.html#execv%2Ccstring%2CcstringArray |
11:45:29 | FromDiscord | <enthus1ast> why one want this? |
11:47:16 | FromDiscord | <Zectbumo> I'm using nim more and more and I'm replacing shell stuff with nim code. one case is when a process calls a program and waits for that process to exit (my nim code). If it forks and spawns a new process and main pid exits then the original watching process erroneously thinks it's done. |
11:48:16 | FromDiscord | <enthus1ast> ok i see, thank you |
11:50:09 | FromDiscord | <deech> This maybe better asked on the forum but besides Status and the Nim team itself who is working on a large-ish Nim codebase with a team size of more than 3 people or so? |
12:03:41 | FromDiscord | <epesrihar1970> https://sites.google.com/view/viagra-sale-online/viagra-from-0-36 |
12:04:02 | FromDiscord | <epesrihar1970> Sale of drugs for the treatment of erectile dysfunction with a discount of up to 90%! |
12:04:31 | FromDiscord | <epesrihar1970> Viagra - from $0.36 per pill, Levitra - from $0.99 per pill, Cialis - from $1.07 per pill and much, much more! |
12:04:37 | FromDiscord | <epesrihar1970> Confidentiality is 100%! |
12:04:43 | FromDiscord | <epesrihar1970> Free shipping! |
12:09:30 | FromDiscord | <konsumlamm> <@&371760044473319454> |
12:12:07 | FromDiscord | <wiga> Wtf lmfao |
12:13:06 | FromDiscord | <wiga> Google site |
12:13:12 | FromDiscord | <wiga> Hdveheisksmkslsl |
12:13:17 | FromDiscord | <wiga> Ahahahagag |
12:14:18 | FromDiscord | <Rika> Damn I sure wish I could buy some viagra right now |
12:14:29 | FromDiscord | <wiga> lol? |
12:14:46 | FromDiscord | <enthus1ast> what they sell is not viagra but, dirt with color↵(@Rika) |
12:14:59 | FromDiscord | <Rika> What’s the difference anyway |
12:15:10 | FromDiscord | <wiga> Its not viagra its extazy |
12:15:14 | FromDiscord | <wiga> Literally |
12:15:38 | FromDiscord | <wiga> Its not the first time i come across weird shits like these |
12:15:52 | FromDiscord | <wiga> The site looks like silk road |
12:15:56 | FromDiscord | <wiga> But dark theme lol |
12:16:14 | FromDiscord | <wiga> Shady stuff going on |
12:37:15 | FromDiscord | <dom96> Dollar per pill? wtf, that's expensive |
12:44:34 | FromDiscord | <Rika> Sus, how would you know |
12:55:48 | FromDiscord | <dom96> hah |
12:55:58 | FromDiscord | <dom96> no pill should be more than a dollar per pill |
12:56:57 | * | rockcavera joined #nim |
12:56:57 | * | rockcavera quit (Changing host) |
12:56:57 | * | rockcavera joined #nim |
13:04:28 | FromDiscord | <Phil> In reply to @deech "This maybe better asked": I assume you mean applications and not libs? |
13:06:36 | FromDiscord | <deech> In reply to @Isofruit "I assume you mean": Either is fine. |
13:07:22 | FromDiscord | <flywind> https://github.com/nim-lang/Nim/wiki/Organizations-using-Nim some companies of that list I guess |
13:09:14 | FromDiscord | <flywind> In reply to @deech "Either is fine.": Or https://nitter.net/tacen_app which uses Nim in their application. |
13:10:54 | FromDiscord | <deech> In reply to @flywind "Or https://nitter.net/tacen_app which uses": Is that still the case? They're hiring Go & Rust devs now. https://tacen.breezy.hr/p/c1f3fb206216-backend-engineer |
13:16:37 | FromDiscord | <Phil> In reply to @deech "Either is fine.": I'm not sure that would count since I'd guess even norm, prologue or jester might qualify for this and I don't think these are what you meant |
13:17:28 | FromDiscord | <Phil> So I guess flywind's posted list is the best resource at a glance |
13:17:48 | FromDiscord | <flywind> In reply to @deech "Is that still the": I don't know. They used to use Nim extensively https://nitter.net/jae_tacen/status/1527559262427222016#m |
13:18:37 | FromDiscord | <Phil> That was merely 3 months ago so possibly there's a separate project |
13:19:01 | FromDiscord | <deech> In reply to @flywind "I don't know. They": Interesting, that is a good indication. They may be listing Go/Rust to get more applications. |
13:19:48 | FromDiscord | <Phil> That or there's a separate project with those languages going on. Because if you're actually looking for nim devs you'd at least mention the language |
13:29:43 | * | jmd_ quit (Ping timeout: 244 seconds) |
14:10:44 | * | arkurious joined #nim |
14:23:18 | FromDiscord | <Phil> Question, what is an "output" parameter, since araq is talking about those in one of the nimv2 RFCs↵https://github.com/nim-lang/RFCs/issues/378 |
14:23:47 | FromDiscord | <dom96> similar to `var T` I guess |
14:24:36 | FromDiscord | <PyryTheBurger> what are hashes and intsets i didnt understand it from nim docs |
14:24:59 | FromDiscord | <Phil> In reply to @dom96 "similar to `var T`": The way I read it `var T` is the output parameter.↵What I don't get is what differentiates that from a "read-write parameter" |
14:25:31 | FromDiscord | <Phil> The concept appears to exist in other languages, I just never used any of those I don't think |
14:25:43 | FromDiscord | <Phil> That or it's something common used in a specific way and I'm confused by the wording |
14:26:01 | FromDiscord | <konsumlamm> i think an out parameter is only meant for writing |
14:26:46 | FromDiscord | <konsumlamm> like an extra return value |
14:26:49 | FromDiscord | <enthus1ast> like this? https://docs.microsoft.com/en-us/dotnet/csharp/language-reference/keywords/out-parameter-modifier |
14:27:25 | FromDiscord | <enthus1ast> you often see "output" annotations in ms docs, when they wanna make sure you understand that this param is used for outputting stuff |
14:28:08 | FromDiscord | <konsumlamm> ye |
14:28:48 | FromDiscord | <Phil> Wait, is that this ~~nonsense~~ pattern where the "return" of your proc is that the operation succeeded and your actual result is the parameter? |
14:29:13 | FromDiscord | <Phil> Well, the contents of the parameter |
14:30:41 | FromDiscord | <enthus1ast> a hash is a not reversible function, that always generates the same output for the same input↵an intset is a set of ints \:)↵(@PyryTheBurger) |
14:30:47 | FromDiscord | <dom96> oh gosh, glad to see people not wanting that RFC 👎 |
14:30:58 | FromDiscord | <enthus1ast> which rfc? |
14:31:06 | FromDiscord | <dom96> the out parameter one |
14:31:20 | FromDiscord | <PyryTheBurger> In reply to @enthus1ast "a hash is a": why not use seq[int] |
14:32:10 | FromDiscord | <enthus1ast> because a seq[int] is slower for larger data |
14:32:37 | FromDiscord | <PyryTheBurger> so if i want a seq of ints i always want to use intset |
14:33:41 | FromDiscord | <enthus1ast> mh, maybe when the order is not important |
14:33:49 | FromDiscord | <Phil> In reply to @PyryTheBurger "so if i want": enthus1ast may shoot me if I'm wrong in case intset is a special case of Sets, but generally Sets are used to allow really fast checking if an integer you have is contained in a group of ints |
14:34:02 | FromDiscord | <Phil> That's their main usecase, check if X is in Y |
14:34:08 | FromDiscord | <enthus1ast> yeah |
14:34:24 | FromDiscord | <enthus1ast> and join them and get the difference etc |
14:34:26 | FromDiscord | <Phil> They're way faster than seqs at that job, also comparing sets to other sets is a useful thing for them |
14:34:46 | FromDiscord | <enthus1ast> maybe seq are faster for smaller datasets |
14:34:58 | FromDiscord | <enthus1ast> but bechmark |
14:35:39 | FromDiscord | <Phil> So if you have a set of ids that represent admins in a set in ram, checking "is the id of value 5 in my set of admin ids" is faster with a set than a seq. That's the general idea anyway |
14:36:18 | FromDiscord | <PyryTheBurger> i also didnt really understand your description of hashes |
14:36:56 | FromDiscord | <enthus1ast> do you know what sha or md5 does? |
14:37:13 | FromDiscord | <PyryTheBurger> havent heard if them |
14:38:30 | FromDiscord | <enthus1ast> you have an input of variable size; the hash function generates an output (eg a number) of the same predefined size, and if something (even one bit) in the input changes, the hash changes completely |
14:40:13 | FromDiscord | <enthus1ast> so eg\: they say on a website "this big iso image has hash\: xyz123" but after downloading you do the hash yourself and is has\: "abc999" you know the files are not the same |
14:41:23 | FromDiscord | <enthus1ast> so, in nim's case, hashes are used for example to check if two objects are the same |
14:44:22 | FromDiscord | <Phil> Hashing often just means "transform an object somehow into a number that is always the same for any object that looks like this" |
14:46:05 | FromDiscord | <Phil> sent a long message, see http://ix.io/46yl |
14:46:58 | FromDiscord | <Phil> If you compare two strings you have to compare each byte in the byte-array that is the string for equality.↵If you compare two numbers for equality you're checking typically at most 8 bytes (at least I assume hashes are calculated as int64 and not int32). |
14:47:33 | FromDiscord | <Phil> (edit) "at most 8 bytes (at least I assume hashes are calculated as int64 and not int32)." => "a lot less bytes." |
14:47:38 | FromDiscord | <Phil> I think the edit is more correct. |
14:49:45 | FromDiscord | <Phil> this is particularly useful for Hashsets and strings.↵Because if I want to figure out "is this object in my hashset of objects" I calculate the hash of my object once and then I'm just comparing the number against a set of other numbers, which is fast.↵If I directly had to compare my object against all other objects in the set, I'd be comparing the values of each field individually with one another. |
15:03:38 | FromDiscord | <PyryTheBurger> sent a code paste, see https://play.nim-lang.org/#ix=46yD |
15:05:44 | FromDiscord | <Phil> I work way too rarely with cast to be able to answer that |
15:13:51 | FromDiscord | <Tanguy> No, the first is safe, not the second (as in, cast can cause memory corruptions) |
15:22:55 | FromDiscord | <domosokrat> sent a code paste, see https://play.nim-lang.org/#ix=46yR |
15:25:53 | NimEventer | New question by azyx: Why calling times.cpuTime() is slow in Nim?, see https://stackoverflow.com/questions/73223884/why-calling-times-cputime-is-slow-in-nim |
15:26:22 | FromDiscord | <domosokrat> The cast means 'interprete the internal representaion of the float 1.5 as an int' |
15:42:11 | * | joshbaptiste1 quit (Ping timeout: 272 seconds) |
16:02:06 | FromDiscord | <PyryTheBurger> sent a code paste, see https://paste.rs/lD4 |
16:51:11 | * | wallabra quit (Ping timeout: 252 seconds) |
16:51:52 | * | jkl1337 quit (Quit: Gone.) |
16:53:15 | * | jkl joined #nim |
16:54:27 | FromDiscord | <Generic> wow, threads:on destroyed performance in my emulator |
16:55:52 | FromDiscord | <Generic> like I thought I didn't even allocate that much |
17:24:07 | NimEventer | New thread by Pietroppeter: How to call a function (that works on the dom) in karax after page is loaded, see https://forum.nim-lang.org/t/9345 |
18:05:25 | FromDiscord | <krisppurg> When I compile my code with `--threads:on` I only get Execution of program failed error and that's it? Why's that? |
18:06:55 | FromDiscord | <Rika> Your program is probably getting a signal of some sort and dying without any output |
18:09:41 | FromDiscord | <krisppurg> how could I avoid that? |
18:15:28 | FromDiscord | <Prestige> Declaring a const _inside_ a proc declaration I'm assuming is similar to declaring a const at top-level, with the difference being scope, right? |
18:16:16 | FromDiscord | <Rika> In reply to @krisppurg "how could I avoid": You’ll have to figure that out somehow because it could be for any reason, try using GDB or Valgrind to analyse what’s happening |
18:23:16 | FromDiscord | <krisppurg> and what command would I need to execute when inspecting with the complier using gdb? |
18:26:43 | FromDiscord | <Rika> Is your compiler failing or your program |
18:26:56 | FromDiscord | <Rika> Just run your program under GDB if latter |
18:27:14 | FromDiscord | <Rika> I can’t really tell you how but it’s just like any other C binary so you can search it |
18:27:32 | FromDiscord | <Rika> If the compiler is failing then there’s a different way |
18:28:32 | FromDiscord | <krisppurg> the program is failing |
18:30:17 | NimEventer | New thread by Jasonfi: Threads dying, memory issues?, see https://forum.nim-lang.org/t/9346 |
18:30:58 | FromDiscord | <auxym> debugging: https://nim-lang.org/blog/2017/10/02/documenting-profiling-and-debugging-nim-code.html |
18:31:10 | FromDiscord | <Rika> @jasonfi maybe try using Clang ASan and MSan |
18:46:46 | * | rockcavera quit (Remote host closed the connection) |
18:49:18 | * | cyraxjoe quit (Ping timeout: 264 seconds) |
18:49:32 | * | cyraxjoe joined #nim |
18:53:50 | * | cyraxjoe quit (Ping timeout: 240 seconds) |
18:55:12 | * | cyraxjoe joined #nim |
19:06:55 | * | Guest2776 quit (Ping timeout: 268 seconds) |
19:07:45 | * | wallabra joined #nim |
19:08:35 | * | kenran joined #nim |
19:09:32 | * | Guest2776 joined #nim |
19:14:01 | * | kenran quit (Quit: WeeChat info:version) |
19:51:32 | * | jmdaemon joined #nim |
20:11:54 | * | krux02 quit (Remote host closed the connection) |
20:14:38 | * | ingy joined #nim |
20:14:47 | NimEventer | New question by azyx: Nim closure doesn't update captured variable when running in thread. Why?, see https://stackoverflow.com/questions/73227303/nim-closure-doesnt-update-captured-variable-when-running-in-thread-why |
20:21:15 | FromDiscord | <!Patitotective> how does inim works? |
20:37:48 | FromDiscord | <pietroppeter> can't remember how to transform a identifier into a string inside a template. e.g. a template `myVar(foo)` that does for example `var foo = "foo"` |
20:55:24 | * | rwb joined #nim |
20:57:19 | * | pch joined #nim |
20:59:11 | * | rwb quit (Client Quit) |
21:02:00 | * | rwb joined #nim |
21:02:21 | FromDiscord | <!Patitotective> In reply to @pietroppeter "can't remember how to": https://nim-lang.org/docs/system.html#astToStr%2CT ? |
21:03:10 | FromDiscord | <Phil> If I have a question about nim's fatal.nim module... does that belong under "internals"? |
21:04:24 | * | krux02 joined #nim |
21:06:58 | FromDiscord | <pietroppeter> In reply to @Patitotective "https://nim-lang.org/docs/system.html#astToStr%2CT ": thanks! |
21:07:03 | FromDiscord | <Phil> sent a code paste, see https://play.nim-lang.org/#ix=46At |
21:08:35 | FromDiscord | <Phil> What's weird as heck to me is that these consts are not exported. Yet if I do any search for usages of the variable in the file, I come up with no hits beyond when the variable gets declared. I'm not sure these 4 lines actually fulfil any purpose whatsoever |
21:09:39 | FromDiscord | <Elegantbeef> Phil that file is probably included in system |
21:10:46 | FromDiscord | <Phil> sent a code paste, see https://play.nim-lang.org/#ix=46Ax |
21:10:53 | FromDiscord | <Phil> You are indeed correct |
21:11:38 | FromDiscord | <Phil> Wait, that const is still never used in system itself... wait but now I have to check every single include of system |
21:12:01 | FromDiscord | <!Patitotective> just search through all files |
21:12:02 | FromDiscord | <Elegantbeef> https://github.com/nim-lang/Nim/search?q=gotoBasedExceptions |
21:13:32 | FromDiscord | <Phil> Wait... but then... but these use the const, why does the compiler state otherwise |
21:13:45 | FromDiscord | <Elegantbeef> What? |
21:13:49 | FromDiscord | <Phil> Does the compiler just complain about any variable that is never called at runtime? |
21:14:15 | FromDiscord | <Elegantbeef> What are you talking about? |
21:15:36 | FromDiscord | <Phil> sent a long message, see https://paste.rs/wym |
21:15:42 | FromDiscord | <Elegantbeef> sent a code paste, see https://paste.rs/aru |
21:16:11 | FromDiscord | <Elegantbeef> Oh right foreign package doesnt show the hint |
21:16:35 | FromDiscord | <Elegantbeef> yea i imagine using a constant in a `when` statement presently doesnt make it uused |
21:17:18 | FromDiscord | <Phil> How hard is it to make such a flag not apply to foreign packages (which includes nim core modules) ? |
21:17:44 | FromDiscord | <Elegantbeef> No clue |
21:17:56 | FromDiscord | <Elegantbeef> It'd be better to make when statements mark symbols as used 😄 |
21:18:29 | FromDiscord | <Phil> I'll just open an issue and bring up possible approaches |
21:41:29 | FromDiscord | <Phil> Oh lord, part of an issue means rebuilding the compiler, well down that rabithole i gues |
21:42:11 | FromDiscord | <Phil> Right, now I remember again, last time I also got stuck at this koch.nim file thing |
21:42:22 | FromDiscord | <Elegantbeef> `choosenim devel`? |
21:42:39 | FromDiscord | <Phil> Tested on that one already, the bug form tells me to check on git head though |
21:42:50 | FromDiscord | <Phil> > please check whether the problem still exists in git head before posting,↵> see [rebuilding the compiler](https://nim-lang.github.io/Nim/intern.html#rebuilding-the-compiler). |
21:43:02 | FromDiscord | <Elegantbeef> You can install a specific commit |
21:43:03 | FromDiscord | <Phil> And that link immediately assumes you have the koch file |
21:43:06 | FromDiscord | <Elegantbeef> `choosenim #commit` |
21:43:57 | FromDiscord | <Phil> Wouldn't git devel have the most recent devel thingy already and basically be the most up to date thing there is? |
21:44:34 | FromDiscord | <Phil> Ohhhh and choosenim #head does work |
21:44:37 | * | rockcavera joined #nim |
21:44:37 | * | rockcavera quit (Changing host) |
21:44:37 | * | rockcavera joined #nim |
21:51:42 | * | rwb is now known as rb |
21:57:28 | FromDiscord | <Elegantbeef> Devel is nightly so it might |
21:58:53 | FromDiscord | <!&luke> In reply to @Isofruit "Ohhhh and choosenim #head": Yea |
22:01:48 | FromDiscord | <exelotl> In reply to @Elegantbeef "Phil that file is": I actually depend on this being the case, as it allows me to implement a custom panic handler for my projects (via `patchFile`) |
22:02:29 | FromDiscord | <exelotl> Similar to the "panicoverrides" thing from --os:standalone |
22:58:34 | FromDiscord | <LNSD> sent a long message, see http://ix.io/46B1 |
22:59:36 | FromDiscord | <LNSD> (edit) "http://ix.io/46B1" => "http://ix.io/46B2" |
23:05:15 | FromDiscord | <Elegantbeef> https://forum.nim-lang.org/t/9323 might interest you |
23:07:56 | FromDiscord | <Elegantbeef> Ah nvm |
23:07:59 | FromDiscord | <Elegantbeef> You want import graphs |
23:08:49 | FromDiscord | <Elegantbeef> I think hax has something working with source trail |
23:09:18 | FromDiscord | <Elegantbeef> https://github.com/haxscramper/nimtrail i think, might be wrong |
23:16:57 | FromDiscord | <!Patitotective> soooo beef, i dont think someone will ever answer to the issue soo↵whats the next step before work arounding it 🤨 ↵debugging? |
23:17:41 | FromDiscord | <Elegantbeef> Yes or looking at the generated code |
23:17:57 | FromDiscord | <!Patitotective> generated c code? |
23:18:01 | FromDiscord | <Elegantbeef> Yes |
23:18:04 | FromDiscord | <!Patitotective> ok |
23:18:44 | FromDiscord | <Elegantbeef> `-d:danger --gc:arc` helps a lot to make the code more readable |
23:18:48 | FromDiscord | <!Patitotective> its cpp actually |
23:18:51 | FromDiscord | <!Patitotective> In reply to @Elegantbeef "`-d:danger --gc:arc` helps a": :] |
23:25:27 | FromDiscord | <!Patitotective> sent a code paste, see https://play.nim-lang.org/#ix=46B6 |
23:39:33 | FromDiscord | <Girvo> Morning all 🙂 |
23:40:26 | * | tiorock joined #nim |
23:40:26 | * | tiorock quit (Changing host) |
23:40:26 | * | tiorock joined #nim |
23:40:26 | * | rockcavera quit (Killed (lead.libera.chat (Nickname regained by services))) |
23:40:26 | * | tiorock is now known as rockcavera |
23:40:45 | * | krux02 quit (Remote host closed the connection) |
23:42:41 | FromDiscord | <Girvo> How would one write a proc (or more likely, a generic type or concept) to disallow `ref` objects for a param -- that one I can do, but here's the more interesting bit: anyone know of a way to disallow `refs` as properties for that same type? We've got a C-level function called `xQueueSend` that is thread (well, Task) safe and passes messages to the queue by-copy, and I wanted to make a nicer Nim interface on top of it |
23:43:41 | FromDiscord | <Elegantbeef> A concept |
23:46:10 | FromDiscord | <!Patitotective> sooo beef↵generated code seems ok to me (i dont really know a lot of cpp but at least the padding is being set)↵so how would i go to do the debugging? |
23:48:06 | FromDiscord | <Elegantbeef> sent a code paste, see https://play.nim-lang.org/#ix=46Bi |
23:49:03 | FromDiscord | <Girvo> Sweet! Appreciate it |
23:50:04 | FromDiscord | <Girvo> @ElegantBeef I'll post up the PSRAM "allocator" once I've it today 😄 should be nice |