<< 16-06-2022 >>

00:03:21*joast quit (Quit: Leaving.)
00:05:12*derpydoo quit (Ping timeout: 248 seconds)
00:06:39FromDiscord<!Patitotective> why does `readError` also gives me the stack trace? 🤨 ↵i only want the exception msg (the stack trace is like 100 lines long) https://nim-lang.org/docs/asyncfutures.html#readError%2CFuture%5BT%5D
00:07:23FromDiscord<!Patitotective> (if i raise the the error and catch it again and print the current exception msg it does not include the stack trace)
00:09:24FromDiscord<!Patitotective> how do remove the stack trace from an exception? is there a way to parse it or something
00:09:24FromDiscord<!Patitotective> (edit) "something" => "something?"
00:09:41FromDiscord<!Patitotective> In reply to @Patitotective "(if i raise the": nvm, it also includes the stack trace
00:15:29FromDiscord<Rika> It only includes it if it is async
00:15:47FromDiscord<Rika> You can’t unless you manually parse and remove yourself I believe?
00:28:51FromDiscord<!Patitotective> it seems like the first line of the exception is enough
01:01:53*wallabra_ joined #nim
01:02:33*wallabra quit (Ping timeout: 244 seconds)
01:02:52*wallabra_ is now known as wallabra
01:08:40FromDiscord<!Patitotective> is `client.close()` necessary? does it cause any leaks?
01:09:00FromDiscord<!Patitotective> (edit) "is `client.close()` necessary? does ... it" added "not doing"
01:11:27FromDiscord<Rika> yes it causes leaks, iirc
01:13:01FromDiscord<!Patitotective> hmm, then ill need to store the clients somewhere to close them
01:13:04FromDiscord<!Patitotective> (edit) "hmm, then ill need to store the clients somewhere to close them ... " added ":/"
01:13:24FromDiscord<ElegantBeef> Damn matrix bridge
01:13:29FromDiscord<ElegantBeef> Yea it leaks file descriptors
01:14:14FromDiscord<!Patitotective> is there a way to know if a client is busy?
01:19:35FromDiscord<Elegantbeef> Dont think so
01:20:01FromDiscord<!Patitotective> huh
01:21:06FromDiscord<Rika> you can just close it once the download finishes?
01:23:55FromDiscord<!Patitotective> is creating one whole client for each download too much? because rn im not storing the anywhere so to close them id have to store them with each download or maybe in some stack that only pushes a new client when all the others are busy (but i cant know if they're busy)
01:24:15FromDiscord<Elegantbeef> That's generally what you do
01:24:24FromDiscord<!Patitotective> In reply to @Elegantbeef "That's generally what you": the first one?
01:24:44FromDiscord<Elegantbeef> You asked a single question
01:24:54FromDiscord<!Patitotective> lol
01:25:14FromDiscord<!Patitotective> then thanks :]
01:25:43FromDiscord<Elegantbeef> Damn with my stupid as fuck ECS toy I think I've ran into the same issue as zippy 😄
01:30:36*arkurious quit (Quit: Leaving)
01:33:10FromDiscord<Rika> wrong type punning leading to UB?
01:43:06FromDiscord<!Patitotective> what do you guys think? 🤔 ↵https://github.com/Patitotective/downit
01:43:29FromDiscord<!Patitotective> im pretty sure i should use objects here instead https://patitotective.github.io/downit/downit.html#Downloader
01:43:35FromDiscord<!Patitotective> (edit) "im pretty sure i should use objects here instead ... https://patitotective.github.io/downit/downit.html#Downloader" added "of a table"
01:47:32FromDiscord<!Patitotective> In reply to @Patitotective "im pretty sure i": or maybe a `Table[string, object]`
01:47:35FromDiscord<!Patitotective> (edit) removed "a"
02:16:53NimEventerNew Nimble package! downit - An asynchronous donwload system., see https://github.com/Patitotective/downit
03:54:08*rockcavera quit (Remote host closed the connection)
04:17:47*CyberTailor joined #nim
04:18:23CyberTailorwhat is the right place for compiler feature requests?
04:18:48FromDiscord<Elegantbeef> nim-lang/rfc
04:18:55FromDiscord<Elegantbeef> On github
04:27:19FromDiscord<Not Saucx> Hey is it possible to make a GUI for NIM product with a designer like QT?
04:31:30FromDiscord<Not Saucx> Nvm
05:29:29FromDiscord<ripluke> In reply to @Not Saucx "Hey is it possible": https://github.com/StefanSalewski/gintro↵High level GTK4 and GTK3 bindings for the Nim programming language
05:29:36FromDiscord<ripluke> These are for gtk
06:38:24*rockcavera joined #nim
06:38:24*rockcavera quit (Changing host)
06:38:24*rockcavera joined #nim
06:40:04FromDiscord<ripluke> can someone help me build this package https://github.com/PMunch/notificatcher
06:41:11FromDiscord<Elegantbeef> `nimble install notificatcher`
06:41:25FromDiscord<ripluke> In reply to @PMunch "New release of notificatcher": im not able to build this package lol
06:42:25FromDiscord<ripluke> that fails lol
06:43:04FromDiscord<Elegantbeef> Now imagine you gave the reason
06:43:10FromDiscord<ripluke> lol ok
06:44:02*PMunch joined #nim
06:44:35FromDiscord<ripluke> sent a code paste, see https://play.nim-lang.org/#ix=40gw
06:45:01FromDiscord<Elegantbeef> `nim -v`?
06:45:04*Guest68 joined #nim
06:45:30FromDiscord<ripluke> 1.6.6
06:46:36FromDiscord<Elegantbeef> works with 1.4.8
06:46:59FromDiscord<ripluke> ohhk i have choosenim so i should be able to switch
06:49:33FromDiscord<ripluke> thxx that fixes it
06:51:00*Guest68 quit (Quit: Client closed)
06:56:46FromDiscord<ripluke> it compiles but doesnt work 🤣
06:57:01FromDiscord<ripluke> afaik notify-send is dbus
06:57:13FromDiscord<ripluke> and when i use it it doesnt work
06:57:34FromDiscord<Elegantbeef> Do you already have a notification daemon running?
06:57:44FromDiscord<ripluke> ohh yea
06:57:47FromDiscord<ripluke> dnst
06:57:53FromDiscord<ripluke> (edit) "dnst" => "dunst"
06:58:01FromDiscord<ripluke> should i kill it?
06:58:12FromDiscord<Elegantbeef> You can only have one working at a time iirc
06:58:30FromDiscord<ripluke> ohh ok that solves it
06:58:50FromDiscord<ripluke> thx for all the help!
06:59:04*ltriant quit (Ping timeout: 248 seconds)
06:59:07*kenran joined #nim
07:00:03*kenran quit (Client Quit)
07:02:18FromDiscord<Elegantbeef> No problem, do make an issue that it cannot compile on 1.6.x though
07:05:36FromDiscord<ripluke> i will
07:07:27CyberTailormy first Request For Comments :) https://github.com/nim-lang/RFCs/issues/463
07:14:56PMunch@ripluke, hello :)
07:16:18PMunchI've already fixed the cannot compile on 1.6.x :)
07:16:35FromDiscord<ripluke> ok thanks
07:16:57PMunchHow do you plan on using notificatcher?
07:18:19FromDiscord<ripluke> making a notification menu with eww
07:18:38FromDiscord<ripluke> https://github.com/elkowar/eww
07:18:58FromDiscord<ripluke> https://github.com/elkowar/eww
07:19:41PMunchOh cool
07:20:23PMunchDefinitely the kind of use-case I was envisaging when I wrote notificatcher
07:20:57FromDiscord<ripluke> oh thanks! :P
07:21:16PMunchI'm actually thinking of rewriting how I do my notifications
07:21:39PMunchCurrently I just put them all into one file, but I think stored each of them to their own file based on ID would be nice
07:22:04PMunchThat way it's easier to handle notifications separately
07:23:08PMunchWhen I then complete https://github.com/PMunch/notificatcher/issues/1 notifications will even be able to dismiss themselves, something which is unfortunately lacking at the moment
07:24:46PMunchI really should look into making a nice rice with notificatcher and notifishower: https://github.com/PMunch/notifishower
07:27:53CyberTailor(re: rfc) lmao that reply
07:28:08CyberTailordestroyed
07:52:44FromDiscord<Rika> what?
08:01:37CyberTailor> So write (and contribute!) a tool that translates the json file into whatever format that you need
08:10:41FromDiscord<Rika> yes, i mean what do you mean by "destroyed"?
08:13:31CyberTailorlong RFC defeated by one sentence
08:18:30FromDiscord<Prestige> PMunch do you have any experience talking directly to usb devices? The solutions I'm finding are kind of painful, e.g. libusb
08:20:16FromDiscord<Rika> In reply to @CyberTailor "long RFC defeated by": maybe i dont see how its destroyed exactly, i guess
08:25:05PMunch@Prestige, well I've done some stuff with it
08:25:28PMunchBut it's quite low level, so it's likely going to be a bit of a pain anyways :P
08:25:58FromDiscord<Prestige> hm a high level interface would really be nice
08:26:13FromDiscord<Prestige> What route did you take?
08:27:07PMunchI just wrapped some C files with Futhark and used the C interface
08:27:21PMunchWhat kind of stuff do you need to do?
08:27:41FromDiscord<Prestige> reading data + getting device names, atm
08:27:56PMunchReading data from where?
08:28:02PMunchUSB can be pretty much anything :P
08:28:24FromDiscord<Prestige> Specifically reading data from a controller, user inputs
08:28:42FromDiscord<Prestige> like, a game controller
08:28:43PMunchAh like a gamepad kind of situation?
08:28:46PMunchRight
08:29:02PMunchThen you might find all you need in something like SDL2s implementation for gamepads
08:29:40FromDiscord<Prestige> Well I was doing that at first, and found out some buttons that are essentially macros, aren't reported
08:29:41PMunchOtherwise you'd probably have to implement HID handling yourself, I don't think libusb does that
08:29:51PMunchAah
08:30:59PMunchMaybe hidapi (from libusb) is what you need? https://github.com/libusb/hidapi
08:31:41PMunchHmm, still pretty low level
08:32:02FromDiscord<Prestige> oh, that looks cool though
08:32:54FromDiscord<Prestige> sdl has a hidapi but I was having issues wrapping it because of wide c strings
08:36:53FromDiscord<ripluke> If I read a multiline file in nim using the readfile function, and then I wanted to separate each line could I do a split("/n")?
08:41:01FromDiscord<Elegantbeef> Yes, you could also use the more efficient `lines("fileName.txt")`
08:41:11FromDiscord<ripluke> Oh
08:41:27FromDiscord<Elegantbeef> `for x in lines("filename.txt")` to be more exact
08:41:36FromDiscord<Elegantbeef> It efficiently iterates and yields each line
08:41:43FromDiscord<Elegantbeef> It's not the fastest implementation possible but it's ok
08:41:51PMunchThat will avoid copying lines from the full string into substrings at least
08:42:22FromDiscord<Elegantbeef> Yea pmunch i know someone a few months ago was asking why Nim's lines was so slow and within a few minutes i had something faster than their fast implementation
08:42:22PMunchIf @ripluke is still working on notification stuff then it's plenty fast
08:42:35FromDiscord<ripluke> In reply to @PMunch "If <@704106773660827690> is still": Yea that's what I'm working on
08:42:41FromDiscord<Elegantbeef> It's a very messay function
08:42:51PMunch@Elegantbeef, huh, you'd think it was a super simple thing
08:42:52FromDiscord<Elegantbeef> `readLine` i think was the slowdown dont recall atm
08:43:11PMunchI assume you made a PR for it ;)
08:43:29FromDiscord<Elegantbeef> No cause I think i didnt match the base implementation
08:43:54FromDiscord<Elegantbeef> https://github.com/nim-lang/Nim/blob/version-1-6/lib/system/io.nim#L376-L495
08:43:57FromDiscord<Elegantbeef> It's a massive function
08:44:18FromDiscord<Elegantbeef> I dont know what most of it does
08:45:56FromDiscord<ripluke> What would I do if I only wanted the last few lines of a file?
08:46:09FromDiscord<ripluke> Cuz I want to avoid loading the whole fipe
08:46:12FromDiscord<ripluke> (edit) "fipe" => "file"
08:46:54FromDiscord<Elegantbeef> Make an array of the amount of lines you want read each line into that until you hit eof
08:46:54PMunchA filestream and seek to the end
08:47:16FromDiscord<Elegantbeef> Pmunch for reference https://play.nim-lang.org/#ix=40gN is why my fast lines impl is
08:47:24PMunchI mean you can't skip to end -10 lines though
08:47:47FromDiscord<Elegantbeef> Seek to end and iterate backwards until you find the N number of newlines
08:48:07FromDiscord<Elegantbeef> Ideally you read 128 characters or something to limit IO
08:48:07FromDiscord<ripluke> How do you seek to the end lol
08:48:59FromDiscord<Elegantbeef> If it's a file that's not getting written to you can just use the file size then `seek` or `setPosition` using the file stream
08:50:12FromDiscord<Elegantbeef> IIRC that fastLines took Nim from 22s down to 7s on their test data
08:50:22FromDiscord<Elegantbeef> Their highest benchmark at the time was like 10s
08:50:26FromDiscord<Elegantbeef> Well lowest i guess
08:51:42PMunchHuh, that's a nice speedup :)
08:52:11FromDiscord<Elegantbeef> Yea i couldnt read the source code of readlines to know if it's feature comparable
08:53:07*oprypin quit (Quit: Bye)
08:53:23*oprypin joined #nim
09:05:32*eull joined #nim
09:23:20NimEventerNew Nimble package! nimFF - Farbfeld Encoder and Decoder written in Nim., see https://github.com/egeoz/nimFF
09:26:32FromDiscord<FireLite> How do I grab a path to the user folder? I need to create and manage the folder there.
09:26:48FromDiscord<Elegantbeef> `os.getHomeDir()`
09:26:55FromDiscord<FireLite> Thanks
09:42:30*ltriant joined #nim
09:53:29FromDiscord<ripluke> This is what I plan on doing in terms of ui for the notification menu https://media.discordapp.net/attachments/371759389889003532/986931511536267274/IMG_1235.png
09:54:21FromDiscord<Rika> That looks like the standard design
10:36:52FromDiscord<abdulbadii (abdulbadii)> Where is the nimgen comprehensive documentation or explanatory tutorial, preferably in PDF ?
10:40:20PMunch@ripluke, so you have a "normal" status bar on top, with a button to show notifications. When you hit that you get a window scrolling in from the side with notifications in a list with title and description?
10:40:31PMunchOr am I reading that drawing wrong?
10:41:12PMunchabdulbadii_(abdulbadii), from the docs "Nimgen has been superseded by nimterop. Existing wrappers are slowly being migrated over to nimterop. No new features will be implemented going forward."
10:42:16PMunchHowever if you only need to interop with C I would recommend Futhark (although I'm about as biased as can be seeing how I wrote Futhark because I was frustrated with nimterop and c2nim)
10:58:17CyberTailorhow do you do regression testing in nim?
11:06:33*firq quit (Ping timeout: 258 seconds)
11:16:02*kenran joined #nim
11:21:01*kenran quit (Quit: WeeChat info:version)
11:21:29*firq joined #nim
11:25:12FromDiscord<ripluke> In reply to @PMunch "<@704106773660827690>, so you have": Yea
12:13:15*gsalazar joined #nim
12:26:08*arkurious joined #nim
12:35:34*CyberTailor quit (Ping timeout: 240 seconds)
12:36:49*CyberTailor joined #nim
12:46:03*Lord_Nightmare quit (Quit: ZNC - http://znc.in)
12:48:57*Lord_Nightmare joined #nim
12:53:14*kenran joined #nim
13:04:43FromDiscord<FireLite> How do I add one string to another? Shouldn't `"test1" + "test2"` just work?
13:06:00FromDiscord<demotomohiro> Nim use `&` to concatenate strings.
13:06:23FromDiscord<FireLite> Oh, ok
13:07:10FromDiscord<demotomohiro> !evsl echo "Hello" & " world
13:07:34FromDiscord<demotomohiro> !eval echo "Hello" & " world"
13:07:37NimBotHello world
13:07:40FromDiscord<aph> irc bot down?
13:07:41FromDiscord<aph> hmmm
13:07:42FromDiscord<aph> oh nvm
13:14:58*ltriant quit (Ping timeout: 258 seconds)
13:17:12FromDiscord<FireLite> Wait... Why `createDir` just crashing my process (I am making dll for app).
13:29:21*eull quit (Quit: Konversation terminated!)
13:57:43*xet7 quit (Remote host closed the connection)
14:00:09*xet7 joined #nim
14:03:07*PMunch quit (Quit: Leaving)
14:05:15*eull joined #nim
14:08:12*CyberTailor quit (Remote host closed the connection)
14:09:45FromDiscord<retkid> a part of me thinks iterators in nim should use -> rather than : to denote the type it yields
14:09:54FromDiscord<retkid> because of the yields keyword
14:25:26*PMunch joined #nim
15:37:44FromDiscord<Rika> Why?
15:47:34*kenran quit (Quit: WeeChat info:version)
16:01:07*vicfred joined #nim
16:03:35FromDiscord<retkid> In reply to @Rika "Why?": because in chemistry -> means to yieldf
16:03:36FromDiscord<retkid> (edit) "yieldf" => "yield"
16:03:37FromDiscord<retkid> :)
16:05:42FromDiscord<retkid> its a joke / pun dont take it serious
16:12:08FromDiscord<treeform> minus grater?
16:12:18FromDiscord<Rika> Arrow
16:57:12FromDiscord<Alea> In reply to @treeform "minus grater?": https://tenor.com/view/grater-happy-gif-21739362
17:04:50*kayabaNerve quit (Ping timeout: 240 seconds)
17:07:06*kayabaNerve joined #nim
17:11:01*ltriant joined #nim
17:12:58*derpydoo joined #nim
17:16:09*ltriant quit (Ping timeout: 276 seconds)
17:30:55*eull quit (Quit: Konversation terminated!)
18:07:55*ehmry quit (Quit: https://quassel-irc.org - Chat comfortably. Anywhere.)
18:08:47*ehmry joined #nim
18:25:27FromDiscord<Phil> In reply to @FireLite "How do I add": For punching strings together, I highly recommend string std/strformat↵allows you to do fmt"{str1} {str2}" assuming str1 and str2 are variables
18:25:39FromDiscord<Phil> (edit) removed "string" | "fmt"{str1} {str2}"" => "`fmt"{str1} {str2}"`"
18:28:04FromDiscord<FireLite> Thanks
18:28:17FromDiscord<FireLite> In reply to @FireLite "Wait... Why `createDir` just": What about this problem tho?
18:28:45FromDiscord<FireLite> My process just dipping if I am trying to create a file using it with dll
18:28:49*PMunch quit (Quit: leaving)
18:28:54*rockcavera quit (Remote host closed the connection)
18:32:01*pro joined #nim
18:34:59FromDiscord<Phil> Sorry, I do linux webdev, I don't really deal with dll or windows for that matter
18:35:12FromDiscord<Phil> (edit) "Sorry, I do linux webdev, I don't really deal with dll or windows for that matter ... " added "and as such haven't faced the problem"
18:47:39*pro quit (Quit: pro)
18:52:59*kayabaNerve quit (Ping timeout: 256 seconds)
18:54:55FromDiscord<!Patitotective> In reply to @Isofruit "For punching strings together,": `&"{str1} {str2}"` 💀
18:55:45*rockcavera joined #nim
18:55:45*rockcavera quit (Changing host)
18:55:45*rockcavera joined #nim
18:56:05FromDiscord<Phil> In reply to @Patitotective "`&"{str1} {str2}"` 💀": ... what would that even do?
18:57:19FromDiscord<Rika> Same thing, dude, but the string isn’t raw
18:57:37FromDiscord<!Patitotective> confuse you `&"{str1}" & &"{str2}"`
20:55:55FromDiscord<!Patitotective> sent a code paste, see https://play.nim-lang.org/#ix=40jv
20:59:03*vicfred quit (Remote host closed the connection)
20:59:22*vicfred joined #nim
21:04:29NimEventerNew thread by Flint: Implicit conversions from float literals to float32?, see https://forum.nim-lang.org/t/9239
21:06:10FromDiscord<demotomohiro> No. Use if elif else branches. You can use range like ``of 0..9:`.
21:06:53FromDiscord<Elegantbeef> sent a code paste, see https://play.nim-lang.org/#ix=40jB
21:08:28FromDiscord<demotomohiro> sent a code paste, see https://play.nim-lang.org/#ix=40jE
21:08:30FromDiscord<demotomohiro> is simpler.
21:09:11FromDiscord<Elegantbeef> Though less intentful as you need to read each branch 😄
21:10:27FromDiscord<Prestige> Does the compiler throw an error if you were to add another case like `of 8:`?
21:13:56FromDiscord<demotomohiro> In reply to @Avahe "Does the compiler throw": You can try it on: https://play.nim-lang.org
21:14:04FromDiscord<Prestige> I'm just asking cuz I'm on my phone
21:15:02FromDiscord<demotomohiro> If you use android phone, you can install Nim using termux.
21:16:20FromDiscord<demotomohiro> In reply to @Avahe "Does the compiler throw": https://play.nim-lang.org/#ix=40jH↵Compiler says: /usercode/in.nim(9, 4) Error: duplicate case label
21:19:43*xet7 quit (Remote host closed the connection)
21:34:51*xet7 joined #nim
22:01:46*derpydoo quit (Quit: derpydoo)
22:10:58FromDiscord<Prestige> neat, good
22:11:11FromDiscord<Elegantbeef> Sadly it doesnt unpack slices
22:12:01FromDiscord<Elegantbeef> sent a code paste, see https://play.nim-lang.org/#ix=40jU
22:15:38FromDiscord<Alea> can you use an enum with holes as the indexes for an array?
22:15:47FromDiscord<Elegantbeef> No
22:15:52FromDiscord<Alea> oof
22:16:00FromDiscord<Elegantbeef> Dont use holey enums problem solved
22:18:09FromDiscord<michaelb.eth> suppose I have a synchronous (not async) `proc foo` that I invoke at time t1 and it returns at time t2, does/can GC happen on the thread where `foo` was invoked between times t1 and t2? does the answer depend on whether it's `refc` vs. arc/orc?
22:18:43FromDiscord<michaelb.eth> (edit) "it's `refc`" => "the GC is refc"
22:19:25FromDiscord<Elegantbeef> Well refc isnt deterministic so i think it's "it depends" Arc/orc are deterministic and you can see with `expandArc:foo`
22:19:52FromDiscord<michaelb.eth> ok, thanks
22:19:58FromDiscord<Elegantbeef> Remember that Arc/orc are scoped based injected destructors/refcounters so at the end of `foo`'s scope any resources it uses are destructed
22:20:38FromDiscord<Elegantbeef> If you want to extend the lifetime of references you can use `GCRef` which makes it behave more like manual memory management
22:47:32*joast joined #nim
23:28:59*ltriant joined #nim
23:54:35*kayabaNerve joined #nim