<< 05-11-2022 >>

00:06:11*jjido quit (Quit: My laptop has gone to sleep. ZZZzzz…)
00:37:34*xaltsc quit (Quit: WeeChat 3.7.1)
00:40:00*xaltsc joined #nim
00:50:53*xaltsc quit (Ping timeout: 246 seconds)
01:07:30alystairhector my concern was debuggability if/when a compiled NIM project breaks in some way within the browser, looking at the compiled output it seems overly complex and not easy to follow
01:10:08alystairI'll eventually join Discord instead... proxy chat feels odd to me :)
01:10:31*alystair quit (Remote host closed the connection)
01:12:15*Guest61 joined #nim
01:13:02*Guest61 quit (Client Quit)
01:17:26FromDiscord<Elegantbeef> Compiling with `-d:danger` does make it a bit more manageable but that removes some checks
01:18:13FromDiscord<Elegantbeef> https://forum.nim-lang.org/t/9525 there is also the stuff here
01:24:29FromDiscord<Lorin> Hi, moved over ~
01:24:45FromDiscord<Lorin> is this the official server?
01:25:24FromDiscord<Elegantbeef> Yes
01:34:44FromDiscord<sOkam!> sent a code paste, see https://play.nim-lang.org/#ix=4eZ5
01:34:52FromDiscord<Elegantbeef> Same typedef yes
01:35:04FromDiscord<sOkam!> what do you mean?
01:35:42FromDiscord<Elegantbeef> sent a code paste, see https://play.nim-lang.org/#ix=4eZ6
01:36:09FromDiscord<sOkam!> oh, by being inside the same `type` block it works? 👀
01:37:23FromDiscord<sOkam!> very unexpected behavior, but happy that its there
01:46:49*rockcavera quit (Remote host closed the connection)
01:52:42FromDiscord<Elegantbeef> It's documented and encourages not having code smell 😄
01:58:06FromDiscord<John Novak> hi there, it seems to me that the 1.6.8 win32 distribution package is broken somehow
01:58:09FromDiscord<Elegantbeef> Oh hey it's john novak
01:58:23FromDiscord<John Novak> just trying to compile a simple hello world app fails on 1.6.8 / 32-bit on windows
01:58:29FromDiscord<John Novak> while it works fine with 1.6.6
01:58:34FromDiscord<John Novak> the error
01:58:38FromDiscord<John Novak> https://media.discordapp.net/attachments/371759389889003532/1038271088184012891/image.png
01:58:56FromDiscord<Elegantbeef> What about 1.6.10?
01:58:58FromDiscord<John Novak> i'm using the same mingw32 compiler in both cases
01:59:15FromDiscord<John Novak> haven't tried 1.6.10
01:59:29FromDiscord<John Novak> tbh i'm fine with 1.6.6 for now, don't wanna waste time investigating this
01:59:32FromDiscord<Elegantbeef> The release candidate forum post has an issue that might be related iirc
01:59:33FromDiscord<John Novak> just wanted to flag it for you guys
02:00:08FromDiscord<John Novak> not many people might be using the 32-bit win version, so i thought i'd let you know. i'm personally fine with 1.6.6 for now, i don't need anything from 1.6.8 or later
02:00:29FromDiscord<John Novak> anyway, now you know 😄 lunchtime 😄
02:00:49FromDiscord<Elegantbeef> Well a bug report i think exists and this isnt #internals
02:09:17FromDiscord<Bung> there's one already https://github.com/nim-lang/Nim/issues/19957
02:09:49FromDiscord<Bung> I almost viewed all issues.
02:21:34FromDiscord<ringabout> In reply to @John Novak "not many people might": Using `_setjmp` on Windows becomes default since 1.6.8 => https://github.com/nim-lang/Nim/pull/20758
02:34:35FromDiscord<banan|crab> whats the nim analagous of pythons os.rename in nim
02:34:44FromDiscord<banan|crab> moveFile doesnt really do what i expected
02:36:37*lucerne quit (Ping timeout: 268 seconds)
02:41:24FromDiscord<John Novak> cool, i'll stay on 1.6.6 for 32-bit until this gets resolved, thanks guys
02:43:20FromDiscord<John Novak> i'll use #internals next time @ElegantBeef 👍
03:12:42*disso_peach joined #nim
03:21:02FromDiscord<sOkam!> sent a code paste, see https://play.nim-lang.org/#ix=4eZr
03:21:34FromDiscord<Elegantbeef> No
03:21:50FromDiscord<Elegantbeef> Like i said C defaults to by copy Nim does the right thing
03:21:55FromDiscord<sOkam!> (edit) "https://play.nim-lang.org/#ix=4eZt" => "https://play.nim-lang.org/#ix=4eZs"
03:22:27FromDiscord<sOkam!> kk, so if i change all ptr proc inputs, and remove the bycopy from the types, it should work the same?
03:22:44FromDiscord<Elegantbeef> Yes `var T` is `T`
03:23:23FromDiscord<sOkam!> oh, so passing ptr and var is the same?
03:23:36FromDiscord<Elegantbeef> Well `var T` is safer but yes
03:23:45FromDiscord<sOkam!> ✍️
03:35:45*arkurious quit (Quit: Leaving)
03:36:40*xaltsc joined #nim
03:58:45*via__ quit (Ping timeout: 268 seconds)
03:59:12*via_ joined #nim
04:08:00*wallabra_ joined #nim
04:09:19*wallabra quit (Ping timeout: 272 seconds)
04:09:42*wallabra_ is now known as wallabra
04:39:34FromDiscord<fancy plants> If you want to manually alloc/dealloc a Nim object separate from ref counting, how would one do so? Maybe like an arena for allocating multiple objects, computing something, and then deallocing at the end?
04:40:28FromDiscord<Elegantbeef> Manual memory management is done with `alloc` and `create`
04:43:49FromDiscord<fancy plants> Would the performance difference be negligible compared to the earlier refcount example alloc/dealloc we talked about earlier?
04:44:22FromDiscord<Elegantbeef> Correct non cyclical types have no overhead compared to manual
04:50:29*lucerne joined #nim
04:51:18NimEventerNew thread by JeysonFlores: Can't manipulate HashSet of complex types, see https://forum.nim-lang.org/t/9578
05:03:19*via_ quit (Ping timeout: 260 seconds)
05:03:40*via_ joined #nim
05:05:21*xet7 quit (Ping timeout: 268 seconds)
05:06:25*xet7 joined #nim
05:09:09*via_ quit (Ping timeout: 260 seconds)
05:13:53*pech joined #nim
05:16:44*disso_peach quit (Ping timeout: 260 seconds)
05:24:52*via_ joined #nim
06:21:56FromDiscord<ShalokShalom> @ElegantBeef#0000 Did you write anything of your own? Like a tutorial, guides, or a blog?
06:23:13FromDiscord<Elegantbeef> I've got a macro tutorial, and a pointer thing but nothing overly indepth
06:23:40FromDiscord<ShalokShalom> Macro tutorial sounds awesome
06:23:48FromDiscord<ShalokShalom> Can I see it?
06:23:58FromDiscord<Elegantbeef> https://dev.to/beef331/demystification-of-macros-in-nim-13n8
06:29:28*derpydoo joined #nim
06:39:49*lucerne quit (Read error: Connection reset by peer)
06:41:42FromDiscord<ShalokShalom> Cool 😃
06:42:04FromDiscord<ShalokShalom> I like your writing style 😄
06:47:45FromDiscord<Elegantbeef> Thanks
06:56:14*wallabra quit (Ping timeout: 268 seconds)
06:56:30*wallabra joined #nim
07:09:13FromDiscord<ShalokShalom> Do you agree on this one? https://media.discordapp.net/attachments/371759389889003532/1038349249571717190/Screenshot_20221105-080840.png
07:09:27FromDiscord<Elegantbeef> Of course
07:09:30FromDiscord<ShalokShalom> Since I see people doing macros all the time, and templates quite less
07:09:32FromDiscord<ShalokShalom> Ok
07:10:02FromDiscord<Elegantbeef> They all have use cases
07:10:09FromDiscord<Elegantbeef> But they're limited in regards
07:12:34FromDiscord<ShalokShalom> That guy in the video is treeform?
07:12:42FromDiscord<Elegantbeef> Correct
07:12:52FromDiscord<ShalokShalom> Since he looks and sounds entirely different as this treeform:↵↵https://youtu.be/nyhkhB23tOQ
07:18:54FromDiscord<ShalokShalom> Probably just subjective 😅
07:23:14FromDiscord<ChocolettePalette> Has nim 2.0 released? o.o
07:23:19FromDiscord<Elegantbeef> Nope
07:23:39FromDiscord<ChocolettePalette> Good, no need to update then
07:24:00FromDiscord<Elegantbeef> Araq wants it out this year though
07:24:35FromDiscord<ChocolettePalette> Omg that's kinda epic doe
07:25:13FromDiscord<Elegantbeef> I mean it's not as big of a change as some might imagine
07:38:38*derpydoo quit (Ping timeout: 246 seconds)
07:48:10*jjido joined #nim
07:51:23FromDiscord<Phil> Well, nim devel is like one CLI command away!
07:51:59FromDiscord<Elegantbeef> Some people dont use choosenim!
07:52:06FromDiscord<Elegantbeef> Or even gitnim
07:52:38FromDiscord<Phil> heresy
07:53:05FromDiscord<Elegantbeef> Yea it's wild, some people want a ball ache to change language versions it seems
07:56:00FromDiscord<Phil> that reminds me I need to update my devel version since IIRC ringabout said the datetime thing is fixed
07:58:17FromDiscord<Phil> > (base) ~/dev/playground % choosenim update devel↵> could not import: SSL_get_peer_certificate↵Erm... any ideas on what this is?
07:59:32FromDiscord<ringabout> It is not fully fixed for `distinct` though. The VM seems to screw up the types, which cannot be sem checked again.
07:59:44FromDiscord<Phil> Ah, shoot
08:00:26FromDiscord<ringabout> In reply to @Isofruit "> (base) ~/dev/playground %": I'm experienced with that, when `choosenim` doesn't work, I'm trying over and over again.
08:00:46FromDiscord<Phil> In reply to @flywind "I'm experienced with that,": Ah, basically just repeat the command until it gives up?
08:01:16FromDiscord<ringabout> Yeah, sometimes it is caused by internet.
08:02:14FromDiscord<ringabout> sent a code paste, see https://play.nim-lang.org/#ix=4f03
08:04:22FromDiscord<Elegantbeef> I dont think that binary operators are documented in the manual like that
08:04:37FromDiscord<nocturn9x> I found what caused my bug
08:04:49FromDiscord<nocturn9x> I was never setting the `kind` discriminant of my object variant
08:04:59FromDiscord<Elegantbeef> What code?
08:05:08FromDiscord<nocturn9x> it was just out of luck that the right enum value was the first one, so as lon as memory was zeroed it would work
08:05:08FromDiscord<Phil> In reply to @flywind "I'm experienced with that,": Wait, so immediately try over and over or try every 10 minutes?
08:05:11FromDiscord<Elegantbeef> Whoops i misread so i guess disregard
08:05:22FromDiscord<nocturn9x> I had to use an ugly template but now it works
08:05:25FromDiscord<nocturn9x> (edit) "lon" => "long"
08:05:43FromDiscord<nocturn9x> sent a code paste, see https://play.nim-lang.org/#ix=4f04
08:06:48FromDiscord<Elegantbeef> Is that better than just `uncheckedAssign`?
08:06:55FromDiscord<Elegantbeef> https://nim-lang.org/docs/manual.html#types-cast-uncheckedassign
08:06:59FromDiscord<nocturn9x> I don't know, haven't tried
08:07:02FromDiscord<ringabout> In reply to @Isofruit "Wait, so immediately try": I will give up, download nightlies and finally drag the executables to the `.choosenim/toolchains` directory.
08:07:13FromDiscord<nocturn9x> does uncheckedAssign not raise `FieldDefect`
08:07:21FromDiscord<nocturn9x> when setting the discriminant of an object variant
08:07:34FromDiscord<Elegantbeef> Exactly it's point
08:07:35FromDiscord<ringabout> In reply to @flywind "I will give up,": It is probably something wrong with choosenim.
08:07:40FromDiscord<nocturn9x> lemme see
08:08:30FromDiscord<ringabout> ARC doesn't check them though.
08:08:47FromDiscord<Elegantbeef> What?
08:09:20FromDiscord<ringabout> https://github.com/nim-lang/Nim/issues/18977
08:09:46FromDiscord<Elegantbeef> Wild
08:10:25FromDiscord<nocturn9x> nope
08:10:26FromDiscord<nocturn9x> `Error: unhandled exception: assignment to discriminant changes object branch [FieldDefect]`
08:10:53FromDiscord<nocturn9x> the code
08:10:54FromDiscord<nocturn9x> sent a code paste, see https://paste.rs/SsM
08:12:09*derpydoo joined #nim
08:12:20FromDiscord<ringabout> There is a bug regarding `unCheckedAssign` in 1.6 irrc
08:13:10FromDiscord<ringabout> https://github.com/nim-lang/Nim/pull/19567
08:13:10FromDiscord<Elegantbeef> I do have to ask cause i'm silly, why do you not just use Nim's string?
08:13:36FromDiscord<ringabout> In reply to @flywind "There is a bug": It should work on the devel branch.
08:13:51*jjido quit (Quit: My laptop has gone to sleep. ZZZzzz…)
08:24:59FromDiscord<nocturn9x> In reply to @Elegantbeef "I do have to": uhm
08:25:05FromDiscord<nocturn9x> because I'm running my own VM
08:25:07FromDiscord<nocturn9x> with its own GC
08:25:14FromDiscord<nocturn9x> using nim's memory management would be no fun :)
08:25:35FromDiscord<nocturn9x> some of internal VM structures as well as the lexer, parser and compiler will keep using it
08:25:43FromDiscord<nocturn9x> but the core of the language will be GC'ed by me
08:25:53FromDiscord<nocturn9x> (edit) "some of ... internal" added "the"
08:25:56FromDiscord<Elegantbeef> I mean `ref string` and `GcRef` and `GcUnRef` is the same as `alloc`/`free`
08:26:12FromDiscord<nocturn9x> yes but where's the fun if you don't get at least one segfault
08:26:22FromDiscord<Elegantbeef> Ok
08:26:25FromDiscord<nocturn9x> jk ofc
08:26:32FromDiscord<nocturn9x> I just want to write a GC
08:26:34FromDiscord<Elegantbeef> Was just asking cause it was odd, to me. Carry on
08:26:37FromDiscord<nocturn9x> it's fun and a learning experience
08:26:45FromDiscord<nocturn9x> I mean
08:26:46FromDiscord<Elegantbeef> I mean you still can write a GC using Nim's string 😄
08:26:50FromDiscord<nocturn9x> I already _have_ a GC
08:26:53FromDiscord<nocturn9x> In reply to @Elegantbeef "I mean you still": fair
08:27:02FromDiscord<nocturn9x> but I wanna be a lil more independent
08:27:04FromDiscord<nocturn9x> just cause
08:27:11FromDiscord<Elegantbeef> It's the same thing it's just using a different allocation method that lets you more easily get operations you might want
08:27:15FromDiscord<nocturn9x> this code can be ported to C fairly easily
08:27:24FromDiscord<nocturn9x> ref strings? not so much
08:27:30FromDiscord<nocturn9x> In reply to @Elegantbeef "It's the same thing": like?
08:27:50FromDiscord<Elegantbeef> The entirety of `strutils` `parseUtils` and so forth
08:28:07FromDiscord<nocturn9x> I mean fair
08:28:13FromDiscord<nocturn9x> but I'll reimplement those anyway
08:28:35FromDiscord<Elegantbeef> Sure but the point is it's much easier to just directly call the operations you're going to reimplement 😄
08:28:47FromDiscord<Elegantbeef> So like i said disregard me
08:29:27FromDiscord<Elegantbeef> If i had it my way the entire stdlib would use `openArray[char]` but araq said no
08:29:40FromDiscord<Elegantbeef> So i might make copies of the stdlib modules now that do that
08:30:03FromDiscord<Elegantbeef> \Atleast with 2.0 we get `parseutils` and `unicode` to work with `openArray[char]`
08:30:11FromDiscord<nocturn9x> nice
08:30:13FromDiscord<Elegantbeef> Finally get some reusable code in the stdlib
08:30:22FromDiscord<nocturn9x> lul
08:34:26FromDiscord<Elegantbeef> As an aside is Peon a Warcraft reference?
08:35:23FromDiscord<Elegantbeef> I know it's a real word, but cmon it's a green orc that doesnt want you to touch him
08:38:50*derpydoo quit (Ping timeout: 246 seconds)
08:39:55*derpydoo joined #nim
08:53:34*lucerne joined #nim
09:00:17FromDiscord<nocturn9x> nope
09:00:26FromDiscord<nocturn9x> https://git.nocturn9x.space/nocturn9x/peon
09:00:29FromDiscord<nocturn9x> see for yourself :d
09:00:33FromDiscord<nocturn9x> (edit) ":d" => ":D"
09:31:14*jjido joined #nim
10:20:58*derpydoo quit (Ping timeout: 268 seconds)
10:39:42*jjido quit (Quit: My laptop has gone to sleep. ZZZzzz…)
10:40:12*wallabra quit (Quit: ZNC 1.8.2 - https://znc.in)
11:08:55*jjido joined #nim
11:13:29*jmdaemon quit (Ping timeout: 276 seconds)
11:16:32FromDiscord<Phil> TFW nimble is down once again
11:17:36FromDiscord<Generic> huh
11:17:42FromDiscord<Generic> is github down?
11:17:53FromDiscord<Phil> Nah, just the nimble.directory page
11:17:55FromDiscord<Generic> ah
11:18:02FromDiscord<Phil> That's what I normally mean when I talk about nimble being down
11:18:20FromDiscord<Phil> I was wondering whether anybody made an essentially compile-time checked SQL DSL in nim
11:18:42FromDiscord<Phil> I know Ormin exists but the syntax in the examples I'm reading is...odd
11:19:16FromDiscord<Phil> Wait, no, I was looking at the wrong nim file, god damnit that thing needs a readme
11:19:19FromDiscord<Phil> (edit) "Wait, no, I was looking at the wrong nim file, god damnit that thing needs a ... readme" added "better"
11:22:23FromDiscord<Phil> Anyway, <@&371760044473319454> I wasn't reprimanded for using this one last time so unless somebody tells me it's the wrong way to try to contact anybody I'll do it anytime I see nimble being down.↵Well, nimble is down. See the nimble.directory page. https://media.discordapp.net/attachments/371759389889003532/1038412963666731098/image.png
11:23:24FromDiscord<Generic> `nimble search whatever` is never down
11:24:08FromDiscord<Phil> that is some fantastic advice right there, thanks!
11:24:40FromDiscord<Phil> (On third reading I realize that might be read sarcastically, I did mean it honestly, I wasn't aware of the search functionality)
11:41:27FromDiscord<PMunch> @Phil it's federico which maintains nimble.directory
11:41:27FromDiscord<Generic> thanks for the clarification, because I did in fact interpreted it sarcastically when I read it
11:42:53FromDiscord<Phil> Sometimes it needs that third, fourth or fifth reading for me to notice that the message if only given in text may be sounding sarcastically
11:44:11FromDiscord<ringabout> Here is the project => https://github.com/FedericoCeratto/nim-package-directory
11:47:52*derpydoo joined #nim
11:48:45FromDiscord<Phil> What name does he go by on discord? federico3?
11:54:56FromDiscord<PMunch> I don't think he has Discord
12:11:03FromDiscord<Rika> That’s his name on IRC
12:26:28FromDiscord<dlesnoff> Is there a way to redirect the ouput of a shell command into a Nim string?↵I have used execShellCmd so far.↵What I could do as a circumvention is redirecting the output to a temporary file, but I wonder if I can use execProcess or another functions from std/osproc to fetch stdout into a string ?
12:30:06FromDiscord<PMunch> @dlesnoff https://nim-lang.org/docs/osproc.html#execCmdEx%2Cstring%2Cset%5BProcessOption%5D%2CStringTableRef%2Cstring%2Cstring
12:32:30*jjido quit (Quit: My laptop has gone to sleep. ZZZzzz…)
12:33:49FromDiscord<banan|crab> whats the nim analagous of pythons os.rename in nim
12:34:05FromDiscord<banan|crab> `moveFile` doesnt do what i wanted
12:41:29FromDiscord<dlesnoff> In reply to @PMunch "<@610977647601909781> https://nim-lang.org/docs/osp": thanks ! I realized that I printed out the Nim cheatsheet and hanged on my wall just above my head and managed to not see it had my answer 😅
12:51:23FromDiscord<PMunch> There's a Nim cheatsheet?
12:51:50FromDiscord<PMunch> In reply to @banan|crab "`moveFile` doesnt do what": What doesn't it do that you want it to do?
12:53:57*lucerne quit (Ping timeout: 255 seconds)
13:03:27FromDiscord<dlesnoff> In reply to @PMunch "There's a Nim cheatsheet?": Yes, @juan_carlos made it a long time ago. https://github.com/nim-lang/Nim/wiki/Nim-for-Python-Programmers third column fourth item from the bottom to the top in the very first table.
13:04:20FromDiscord<dlesnoff> https://www.overleaf.com/project/5ec86bd3f01cd200019aaaf9 It links to the overleaf project that is visible only if you have an overleaf account
13:05:13FromDiscord<dlesnoff> I asked him and he made me a Black & White version.
13:05:29FromDiscord<dlesnoff> (edit) "Black" => "printable (Black" | "White" => "White)"
13:05:38FromDiscord<dlesnoff> (edit) "version." => "version https://www.overleaf.com/project/5ecfe6de1824ae0001dfdb2a."
13:07:28FromDiscord<banan|crab> sent a code paste, see https://play.nim-lang.org/#ix=4f0T
13:16:41*derpydoo quit (Quit: derpydoo)
13:20:23*oprypin quit (Quit: Bye)
13:20:40*oprypin joined #nim
13:20:54FromDiscord<sOkam!> sent a code paste, see https://play.nim-lang.org/#ix=4f0Y
13:22:40FromDiscord<sOkam!> Also, you don't need to do open() and close() in most of the file i/o functions. only in a very specific few of them↵when they take a string as a path, instead of a `File` type, then they just open and close the file themselves
13:22:57FromDiscord<banan|crab> In reply to @sOkam! "`writeFile("Filename", "Contents")` aka you": oh
13:25:09FromDiscord<sOkam!> sent a code paste, see https://play.nim-lang.org/#ix=4f10
13:25:26FromDiscord<sOkam!> the `\\` stuff is not needes if you import os and use / operator instead
13:26:41FromDiscord<sOkam!> (edit) "import os" => "`import os`" | "/" => "`/`"
13:26:53FromDiscord<sOkam!> (edit) "needes" => "needed"
13:27:40FromDiscord<deech> sent a code paste, see https://play.nim-lang.org/#ix=4f11
13:28:15FromDiscord<deech> (edit) "https://play.nim-lang.org/#ix=4f11" => "https://play.nim-lang.org/#ix=4f12"
13:30:51FromDiscord<banan|crab> sent a code paste, see https://play.nim-lang.org/#ix=4f14
13:32:47FromDiscord<sOkam!> In reply to @banan|crab "it does the correct": yep
13:53:56*arkurious joined #nim
14:14:40FromDiscord<Rika> In reply to @deech "How do I pass": I don’t think you can, you’re just gonna have to convert the parameter you pass in to the right type I think
14:14:54FromDiscord<Rika> Are there even generic lambdas
14:58:16*jjido joined #nim
15:35:32FromDiscord<dlesnoff> sent a code paste, see https://play.nim-lang.org/#ix=4f1M
15:36:31FromDiscord<dlesnoff> sent a code paste, see https://play.nim-lang.org/#ix=4f1N
15:39:28FromDiscord<dlesnoff> Do you know what I have done wrong in my overloading procedure ?
15:40:48FromDiscord<dlesnoff> (edit) "overloading" => "overloaded dollar"
15:46:29FromDiscord<dlesnoff> nvm, I think the \n come from my strings itself
15:47:26*jjido quit (Quit: My laptop has gone to sleep. ZZZzzz…)
15:50:11FromDiscord<treeform> In reply to @ShalokShalom "Since he looks and": both are me, probably different rooms/microphones.
15:54:26FromDiscord<treeform> In reply to @Elegantbeef "Again jsony doesnt take": That could be an interesting tool to write though... maybe next time I need a ton of foreign json parsed.
15:56:46*tinystoat quit (Remote host closed the connection)
15:56:50FromDiscord<Horizon [She/Her]> I wonder how i could even improve the WASM3 bindings...
15:56:56*tinystoat joined #nim
15:57:49*arkurious quit (Ping timeout: 260 seconds)
15:58:15FromDiscord<Horizon [She/Her]> sent a code paste, see https://play.nim-lang.org/#ix=4f1R
16:10:24*arkurious joined #nim
16:16:32FromDiscord<Require Support> if i have a seq of object and I would like to find the object based on its id attribute and delete it from the seq, whats the best way to do this
16:32:49*Zevv joined #nim
16:33:12Zevvis Varriount ever around here?
16:43:29FromDiscord<Require Support> `Error: 'myTypeRef' is of type <var myTypeRef> which cannot be captured as it would violate memory safety, using '-d:nimNoLentIterators' helps in some cases` try to pass my object into a proc with `var` so i can add to a sequence in one of the attributes. Ex: `myTypeRef.myAttribute.add("hi")` but getting this error. Object type is declared as `ref object`
16:52:53FromDiscord<auxym> In reply to @Require Support "if i have a": you could use `filter` or `keepIf` from sequtils but it will iterate the full list. If you know you're removing only 1 item at most, you might want to do it manually. iterate over the seq, stop when you find the id, then call `delete` with the index.
16:53:28FromDiscord<auxym> Though if you're doing a lot of that, might want to consider using a `Table` or `OrderedTable`, both the search and the removal will be faster.
17:02:56FromDiscord<Require Support> In reply to @auxym "you could use `filter`": yep this is what I did eventually, just thought there might be a better way of doing it
17:07:23*xet7 quit (Remote host closed the connection)
17:09:30*pech is now known as disso_peach
17:50:50*jjido joined #nim
18:13:36FromDiscord<haxscramper> PMunch: https://forum.nim-lang.org/t/8629 is there a finalized version of community guidelines right now?
18:14:19*arkurious quit (Ping timeout: 260 seconds)
18:14:42*krux02 joined #nim
18:26:53*arkurious joined #nim
19:16:24FromDiscord<Horizon [She/Her]> In Nim am i able to declare a proc within another proc, that returns another proc using something from the first method?
19:16:48FromDiscord<Horizon [She/Her]> And I don't think i can structure it differently, i already need to use 2 procs due to wasm3 bindings
19:19:24FromDiscord<Phil> In reply to @Event Horizon "In Nim am i": So like... how many levels of procs?
19:19:29FromDiscord<Phil> 3?
19:20:15FromDiscord<Phil> Anyway, feels like it should be possible, given from what I experimented with of procs generating procs with other procs
19:20:57FromDiscord<Horizon [She/Her]> In reply to @Isofruit "3?": Yup
19:20:58FromDiscord<Horizon [She/Her]> sent a code paste, see https://play.nim-lang.org/#ix=4f2R
19:21:19FromDiscord<Horizon [She/Her]> Since each WASI interface is specific to the machine it's running on
19:21:32FromDiscord<Horizon [She/Her]> 'machine' just being a container in a way
19:22:15FromDiscord<Phil> I'd honestly put the proc definitions on the same level and then only stack their usages inside one another
19:22:43FromDiscord<Phil> Unless they need to access the environment of the other proc?
19:28:36FromDiscord<Horizon [She/Her]> Wdym?
19:31:28FromDiscord<Horizon [She/Her]> `proc_exit` needs access to `machine` for example, so
19:46:56FromDiscord<Enc1nt> Can some one help me on how to use the std/math GDC function?
19:49:20FromDiscord<dlesnoff> sent a code paste, see https://play.nim-lang.org/#ix=4f2V
19:49:48FromDiscord<dlesnoff> (edit) "https://play.nim-lang.org/#ix=4f2V" => "https://play.nim-lang.org/#ix=4f2W"
19:50:46FromDiscord<Enc1nt> sent a code paste, see https://play.nim-lang.org/#ix=4f2X
19:51:32FromDiscord<dlesnoff> output of `nim -v` ? Which error ?
19:51:57FromDiscord<Enc1nt> In reply to @Jiezron "output of `nim -v`": all of this ones https://media.discordapp.net/attachments/371759389889003532/1038541197658030130/image.png
19:52:25FromDiscord<dlesnoff> remove your code, and copy paste correctly mine
19:53:07FromDiscord<dlesnoff> you have a typo writing problem. It is gcd and not gdc for `greatest common denominator`
19:54:10FromDiscord<Enc1nt> sent a code paste, see https://play.nim-lang.org/#ix=4f2Z
19:54:10FromDiscord<Enc1nt> this outputs even longer erros
19:54:39FromDiscord<Phil> In reply to @Event Horizon "Wdym?": One sec, phoning in parallel can't really do code questions in parallel
19:57:23FromDiscord<Horizon [She/Her]> Ah fair lol
19:57:25FromDiscord<dlesnoff> aren't there threads in discord to discuss things in parallel? Does it break IRC bridge?↵Sorry for the inconvenience of answering another code question and starting another thread.
19:57:38FromDiscord<Horizon [She/Her]> Does anyone know if you can get the name of a type in Nim?
19:57:43FromDiscord<Horizon [She/Her]> as a string
19:57:51FromDiscord<Elegantbeef> `$typeof(x)`?
20:00:30FromDiscord<Horizon [She/Her]> Thanks! Does that work with ref objects?
20:02:32FromDiscord<Elegantbeef> Why wouldnt it
20:06:02FromDiscord<Horizon [She/Her]> Like i mean
20:07:02FromDiscord<Horizon [She/Her]> sent a code paste, see https://play.nim-lang.org/#ix=4f31
20:07:08FromDiscord<Horizon [She/Her]> Would it print `BaseEvent` or `EventTwo`?
20:07:30FromDiscord<Elegantbeef> That's inheritance, `typeof` is compile time
20:07:40FromDiscord<Elegantbeef> So no it wouldnt
20:08:40*wallabra joined #nim
20:09:23*krux02 quit (Remote host closed the connection)
20:11:03FromDiscord<Elegantbeef> You can do `proc printEventName[T: BaseEvent](e: T)`
20:11:17FromDiscord<Elegantbeef> Instead of converting up it remains `EventTWo`
20:11:59FromDiscord<dlesnoff> sent a code paste, see https://play.nim-lang.org/#ix=4f35
20:13:39*wallabra quit (Ping timeout: 255 seconds)
20:13:55FromDiscord<Enc1nt> In reply to @Jiezron "I found your error:": Yeah i first thought its like python but its kina like java but i found that `.parseInt()` is the solution, Thanks for the spelling mistake!
20:14:00FromDiscord<dlesnoff> sent a code paste, see https://play.nim-lang.org/#ix=4f37
20:16:19FromDiscord<dlesnoff> I have changed gcdorlcm variable to its english version sorry 😅 ↵Also, maybe it is better to let gcdorlcm as a string and compare to "1", like you did. Just in case, the program does not crash this way if the user input is not parsable as an integer.
20:18:28FromDiscord<Enc1nt> In reply to @Jiezron "I have changed gcdorlcm": Thank you! I started today so i dont know what is going on soo it helps!
20:21:52FromDiscord<ShalokShalom> In reply to @Elegantbeef "As an aside is": Really fits it well xD↵↵Good catch 😅
20:22:30FromDiscord<dlesnoff> In reply to @Enc1nt "Thank you! I started": I must confess that the error message was really confusing.
20:23:02*wallabra joined #nim
20:23:17FromDiscord<Enc1nt> In reply to @Jiezron "I must confess that": Yeah its like an essay lol
20:24:58FromDiscord<Horizon [She/Her]> In reply to @Elegantbeef "You can do `proc": Ah neat! Thanks!
20:29:15*wallabra_ joined #nim
20:30:34FromDiscord<haywireSSC> how would I wait for an event using asyncdispatch?
20:32:05*wallabra quit (Ping timeout: 268 seconds)
20:32:06*wallabra_ is now known as wallabra
20:33:48FromDiscord<Enc1nt> Also 1 more question how do you make for example a 1 second delay?
20:34:25FromDiscord<dlesnoff> @Enc1nt sleep(1000)
20:35:05FromDiscord<dlesnoff> sent a code paste, see https://paste.rs/RPl
20:35:48FromDiscord<Enc1nt> sent a code paste, see https://play.nim-lang.org/#ix=4f3d
20:36:47FromDiscord<Enc1nt> sent a code paste, see https://play.nim-lang.org/#ix=4f3e
20:37:03FromDiscord<Enc1nt> https://media.discordapp.net/attachments/371759389889003532/1038552549365661859/image.png
20:37:44FromDiscord<Elegantbeef> Did you `import std/os`?
20:37:54FromDiscord<dlesnoff> Well, it miss import std/os indeed
20:37:59FromDiscord<Enc1nt> os?
20:38:13FromDiscord<Enc1nt> sent a code paste, see https://play.nim-lang.org/#ix=4f3f
20:38:13FromDiscord<Enc1nt> isnt it times?
20:38:27FromDiscord<dlesnoff> https://nim-lang.org/docs/os.html#sleep%2Cint
20:38:28FromDiscord<Elegantbeef> Sleep is in `os`
20:38:35FromDiscord<Elegantbeef> As it's an OS feature
20:38:37FromDiscord<Enc1nt> In reply to @Elegantbeef "Sleep is in `os`": ohh
20:39:01FromDiscord<Enc1nt> i got a bit confused in the documentation ig https://media.discordapp.net/attachments/371759389889003532/1038553040912912424/image.png
20:39:35FromDiscord<dlesnoff> I believed it was in `system` so I did not mention the import
20:39:49FromDiscord<Enc1nt> And ti works now
20:39:53FromDiscord<Enc1nt> (edit) "ti" => "it"
20:40:31FromDiscord<dlesnoff> In reply to @Enc1nt "i got a bit": I would not have thought this to be confusing. You have to know that contrarily to Python you don't have to (and don't want to) specify the library you import your functions.
20:44:28FromDiscord<Enc1nt> In reply to @Jiezron "I would not have": yeah
20:45:33*wallabra quit (Ping timeout: 255 seconds)
20:46:26*wallabra joined #nim
20:47:52FromDiscord<dlesnoff> sent a code paste, see https://play.nim-lang.org/#ix=4f3h
20:55:38*wallabra quit (Quit: ZNC 1.8.2 - https://znc.in)
20:58:39*thomasross joined #nim
21:04:12FromDiscord<Enc1nt> In reply to @Jiezron "We don't write `os.sleep(1000)`": i see
21:05:40FromDiscord<Enc1nt> ammm am i doing something wrong? https://media.discordapp.net/attachments/371759389889003532/1038559749043658902/image.png
21:06:02FromDiscord<Enc1nt> (probably)
21:08:23FromDiscord<Enc1nt> apparently if i put the full path it works
21:13:25FromDiscord<that_dude> It looks like the project and terminal directories are different
21:14:36FromDiscord<that_dude> Ie pwd is .../programming/nim but you're compiling ".../ascii art spam/spam.nim"
21:36:13FromDiscord<demotomohiro> @Enc1nt The relative path given to `readFile` is relative to current working directly.
21:36:33FromDiscord<Raynei486> `string.len` returns a int and the compiler doesn't like it when I compare it against `length` which is a uint https://media.discordapp.net/attachments/371759389889003532/1038567521671979008/image.png
21:36:47FromDiscord<Raynei486> is a cast the appropriate solution here?
21:38:11FromDiscord<Rika> In reply to @Jiezron "We don't write `os.sleep(1000)`": os.sleep(n) is supported
21:38:37FromDiscord<Rika> Import qualification is supported even without import nil
21:39:33FromDiscord<Rika> In reply to @Raynei486 "is a cast the": No, convert it by using the type name like a function instead
21:39:35FromDiscord<!!sharpcdf!!> just restarted my laptop after an update and now i get this error when i try to run my app, what do i need to fix it? im on arch linux https://media.discordapp.net/attachments/371759389889003532/1038568282355159080/image.png
21:39:58FromDiscord<Rika> Install an older version of open SSL
21:40:13FromDiscord<Rika> Perhaps there is a version with a 1 at the end
21:40:18FromDiscord<Rika> That is what you’re looking for
21:40:22FromDiscord<Raynei486> In reply to @Rika "No, convert it by": I'm not exactly sure what that means
21:40:25FromDiscord<!!sharpcdf!!> ah ok
21:40:28FromDiscord<!!sharpcdf!!> let me try that
21:40:32FromDiscord<Raynei486> like `it.len.uint`?
21:40:42FromDiscord<!!sharpcdf!!> In reply to @Raynei486 "I'm not exactly sure": uint(it)
21:40:48FromDiscord<Raynei486> ah
21:40:55FromDiscord<Rika> temp.filterIt(it.len.uint, ...
21:41:18FromDiscord<Raynei486> 👍
21:42:53FromDiscord<!!sharpcdf!!> how can i install a specific version of openssl with yay again
21:43:10FromDiscord<Rika> Is there no "openssl1"
21:43:43*rlr left #nim (The Lounge - https://thelounge.chat)
21:43:50FromDiscord<dlesnoff> vs code
21:43:58FromDiscord<!!sharpcdf!!> theres openssl1-1.1 and openssl1-1.0
21:44:20FromDiscord<!!sharpcdf!!> why does nim not support the latest openssl anyways
21:45:14FromDiscord<!!sharpcdf!!> oh wait its openssl-1.1 and openssl-1.0
21:45:45FromDiscord<Rika> 1.1 is good
21:45:57FromDiscord<Rika> In reply to @sharpcdf "why does nim not": Because it’s relatively big of a change
21:46:00FromDiscord<Rika> It’s on the way
21:46:05FromDiscord<!!sharpcdf!!> ok
21:46:10FromDiscord<!!sharpcdf!!> looks good now
21:47:05*wallabra joined #nim
21:55:12*jkl1337 quit (Quit: Gone.)
21:56:28*jkl joined #nim
21:59:12FromDiscord<AmjadHD> Is there an option for `koch docs` to make it not compile `runnableExamples` ?
21:59:25FromDiscord<Enc1nt> I am trying to compile to JS but i cannot find why is this error happening anyone know? https://media.discordapp.net/attachments/371759389889003532/1038573275275591710/image.png
22:09:01*ehmry quit (Ping timeout: 260 seconds)
22:15:33*wallabra quit (Quit: ZNC 1.8.2 - https://znc.in)
22:17:46*wallabra joined #nim
22:18:02*ehmry joined #nim
22:26:20*wallabra quit (Quit: ZNC 1.8.2 - https://znc.in)
22:30:38*ltriant joined #nim
22:36:31*jmdaemon joined #nim
22:37:13*jjido quit (Quit: My laptop has gone to sleep. ZZZzzz…)
22:44:56*wallabra joined #nim
23:11:41FromDiscord<Rika> No I don’t think so
23:12:05FromDiscord<dlesnoff> There is no syntax highlighting for nim in Stack Overflow ?! `lang-nim` keyword only partially highlights my code.
23:14:27FromDiscord<dlesnoff> I have answered the Stack Overflow question from yesterday, I am curious to have your opinion on my answer: https://stackoverflow.com/questions/74320430/getting-hardware-info-in-nim-lang/74332136#74332136
23:15:29FromDiscord<Elegantbeef> Dont a lot of those utilities just read files directly?
23:16:10FromDiscord<Elegantbeef> Using shell programs is best to be avoided when writing Nim, you generally use either the files directly or linux exposed APIs
23:19:36FromDiscord<Raynei486> Is there a way to assign variables to values produced by expressions?
23:20:16FromDiscord<Elegantbeef> If you make the expression a proc that returns `var T` yes
23:24:15*wallabra quit (Quit: ZNC 1.8.2 - https://znc.in)
23:26:50FromDiscord<auxym> In reply to @Raynei486 "Is there a way": as in... `let a = 2 + 2` ? Not sure I understand the question
23:28:05FromDiscord<Rika> Probably bad wording
23:33:24FromDiscord<dlesnoff> sent a long message, see http://ix.io/4f3X
23:33:39FromDiscord<Elegantbeef> It also requires having awk on the system
23:33:42FromDiscord<dlesnoff> (edit) "http://ix.io/4f3X" => "http://ix.io/4f3Y"
23:33:47FromDiscord<Elegantbeef> `strscans` `regex` both exist
23:36:08*wallabra joined #nim
23:39:25FromDiscord<dlesnoff> I'll look into it tomorrow.
23:41:12FromDiscord<dlesnoff> (edit) "tomorrow." => "tomorrow, if I finish my C++ program for the PhD first."
23:50:22FromDiscord<Phil> sent a code paste, see https://play.nim-lang.org/#ix=4f43
23:51:02FromDiscord<Phil> (edit) "https://play.nim-lang.org/#ix=4f43" => "https://play.nim-lang.org/#ix=4f44"
23:51:15FromDiscord<Phil> (edit) "https://play.nim-lang.org/#ix=4f44" => "https://play.nim-lang.org/#ix=4f45"
23:56:07FromDiscord<Phil> sent a code paste, see https://play.nim-lang.org/#ix=4f46
23:58:09FromDiscord<ChocolettePalette> There's a bug in your code it doesn't compile on bubuntu