<< 18-04-2022 >>

00:00:12*tk quit (Quit: Well, this is unexpected.)
00:00:37*tk joined #nim
00:09:04*flynn quit (Ping timeout: 246 seconds)
00:09:45FromDiscord<huantian> I'd personally just not convert it in get
00:09:51FromDiscord<huantian> and manually write to myself
00:09:59FromDiscord<huantian> (edit) "to myself" => "`to` myself, just as explicit"
00:10:02FromDiscord<huantian> (edit) "explicit" => "explicit, if not more"
00:10:30FromDiscord<Elegantbeef> You mean pass `var T` into it?
00:10:31*flynn joined #nim
00:10:52*vicfred quit (Quit: Leaving)
00:11:26FromDiscord<huantian> no just do `c.get(url).await.to(T)` each time
00:11:41FromDiscord<Elegantbeef> Ah
00:12:24FromDiscord<Elegantbeef> Also wait a minute try you're using http requests for IPC
00:12:34FromDiscord<Elegantbeef> Jesus that's gotta be overlkill and a half
00:13:20FromDiscord<huantian> ipc = intra program communication?
00:13:39FromDiscord<Elegantbeef> inter
00:13:49FromDiscord<huantian> mk
00:13:53FromDiscord<Elegantbeef> intra is internal, inter is external
00:14:31FromDiscord<Rika> In reply to @Elegantbeef "Also wait a minute": Lol
00:14:38FromDiscord<Elegantbeef> Yes it's funny internal starts with inter
00:15:36FromDiscord<Elegantbeef> I've never seen anyone use http for IPC so this is super odd
00:16:08FromDiscord<huantian> just used named pipes ez
00:16:40FromDiscord<huantian> what is normally used for ipc?
00:16:59FromDiscord<Elegantbeef> Sockets, memfiles, stdin/stdou
00:19:58FromDiscord<Elegantbeef> Then they use either like json, protobuf or similar for parsing commands and the like
00:19:58FromDiscord<Elegantbeef> Or their own internal format
00:22:34*flynn quit (Read error: Connection reset by peer)
00:23:46*flynn joined #nim
00:37:03*flynn quit (Read error: Connection reset by peer)
00:38:15*flynn joined #nim
00:43:21FromDiscord<Infinidoge> Out of curiosity, is it possible/are there any libraries to format disks with Nim, outside of just shelling out to something like parted?
00:43:38FromDiscord<Elegantbeef> It's possible
00:44:38FromDiscord<Elegantbeef> You'll probably end up using system calls to do it so only half true
00:44:44FromDiscord<Infinidoge> Ah
00:44:45FromDiscord<Infinidoge> Hmm
00:44:52FromDiscord<Infinidoge> Probably easiest to shell out then, I suppose
00:53:43*flynn quit (Ping timeout: 256 seconds)
00:58:16*flynn joined #nim
01:02:40*Lord_Nightmare quit (Quit: ZNC - http://znc.in)
01:04:48*vicfred joined #nim
01:05:27*Lord_Nightmare joined #nim
01:09:36FromDiscord<!Patitotective> hey leorize ~~beef~~↵now i need to download hundreds of images and i need to use async, right? cause creating hundreds of threads is not great (?)
01:09:54FromDiscord<Yardanico> async is better for that, yes, since it's about IO
01:09:58FromDiscord<Elegantbeef> Like we said yesterday you should be using async for it presently
01:10:10FromDiscord<Yardanico> using threads is possible, but it'll have much more overhead and be harder to use
01:10:19NimEventerNew Nimble package! metatag - A metadata reading & writing library, see https://github.com/sauerbread/metatag
01:10:25FromDiscord<!Patitotective> In reply to @Elegantbeef "Like we said yesterday": do you mean for fetching json stuff?
01:10:34FromDiscord<leorize> run async on your IO thread, basically
01:10:50*flynn quit (Read error: Connection reset by peer)
01:12:01*flynn joined #nim
01:12:59FromDiscord<!Patitotective> so i create only one thread (apart from the ui one) in which i download the images asynchronously sending them through channels to the ui thread? 🤔
01:13:19FromDiscord<leorize> yep
01:13:26FromDiscord<!Patitotective> 🙃
01:13:28FromDiscord<!Patitotective> thanks
01:14:48*vicecea quit (Remote host closed the connection)
01:15:14FromDiscord<!Patitotective> also, where should i save those images? is there some _cache_?
01:15:18*vicecea joined #nim
01:16:58FromDiscord<!Patitotective> cause when my app is built as an appimage saving them next to it would be not good hehe
01:23:24*flynn quit (Read error: Connection reset by peer)
01:24:35*flynn joined #nim
01:27:30*lumo_e quit (Ping timeout: 250 seconds)
01:28:22*lumo_e joined #nim
01:31:13FromDiscord<!Patitotective> sent a code paste, see https://play.nim-lang.org/#ix=3Vp6
01:31:48FromDiscord<!Patitotective> (edit) "https://play.nim-lang.org/#ix=3Vp8" => "https://play.nim-lang.org/#ix=3Vp7"
01:39:01*flynn quit (Read error: Connection reset by peer)
01:39:43FromDiscord<huantian> https://github.com/huantianad/rd-downloader/blob/24d8f811778cf637a1ab12db261ff5d03d57d670/src/rd_downloader.nim#L63-L113↵this is what I did for concurrent downloads, not exactly what you want to do but the general idea remains
01:40:06FromDiscord<huantian> though actually it's a lot simplier if you wanna just download all you images at the same time
01:40:12*flynn joined #nim
01:40:26FromDiscord<huantian> in that case you can use all: https://nim-lang.org/docs/asyncfutures.html#all%2Cvarargs%5BFuture%5BT%5D%5D
01:42:03FromDiscord<huantian> actually I have no idea what I'm saying
01:44:28FromDiscord<huantian> ok so
01:45:42FromDiscord<!Patitotective> In reply to @huantian "https://github.com/huantianad/rd-downloader/blob/24": what you are doing here is creating 8 threads?
01:47:21FromDiscord<huantian> sent a code paste, see https://play.nim-lang.org/#ix=3Vpa
01:47:48FromDiscord<huantian> In reply to @Patitotective "what you are doing": well not actual "threads", but 8 concurrent downloads↵but thinking about it, you probably ahve a different usecase so the linked code is probably not too helpful
01:48:28FromDiscord<!Patitotective> In reply to @huantian "if you have a": oh, clients can only download one file?
01:48:40FromDiscord<!Patitotective> (edit) "file?" => "file at once?"
01:48:45FromDiscord<!Patitotective> (edit) "once?" => "the same itme?"
01:48:47FromDiscord<!Patitotective> (edit) "itme?" => "time?"
01:49:02FromDiscord<huantian> yeah
01:49:12FromDiscord<huantian> you'll want a different client for each download you're doing at a time
01:49:18FromDiscord<!Patitotective> ok, thanks, let me try to implement _your_ code
01:49:44FromDiscord<huantian> another thing you could probably do is use callbacks, so at the end of each callback, you can send something through the channel
01:49:53FromDiscord<huantian> (edit) "end" => "completion" | "callback," => "download,"
01:51:31FromDiscord<!Patitotective> like `cliend.downloadFile(...).addCallback`?
01:53:06*flynn quit (Read error: Connection reset by peer)
01:54:17*flynn joined #nim
02:00:59*jkl quit (Quit: Gone.)
02:02:21*jkl joined #nim
02:02:37*flynn quit (Read error: Connection reset by peer)
02:03:47*flynn joined #nim
02:05:12*lumo_e quit (Ping timeout: 250 seconds)
02:05:38FromDiscord<huantian> yeah
02:06:04FromDiscord<!Patitotective> sent a code paste, see https://play.nim-lang.org/#ix=3Vpe
02:09:12FromDiscord<Yardanico> you also don't need to forget to close `client` after downloading the file
02:09:16FromDiscord<Yardanico> otherwise you'll leak FDs
02:11:23FromDiscord<huantian> sent a code paste, see https://paste.rs/Vo7
02:11:29*flynn quit (Read error: Connection reset by peer)
02:11:45FromDiscord<huantian> (edit) "https://play.nim-lang.org/#ix=3Vpf" => "https://paste.rs/FgF"
02:12:39*flynn joined #nim
02:12:55FromDiscord<!Patitotective> sent a code paste, see https://play.nim-lang.org/#ix=3Vpg
02:13:07FromDiscord<huantian> (edit) "https://paste.rs/3YI" => "https://paste.rs/Xnk"
02:13:14FromDiscord<huantian> (edit) "https://paste.rs/qXm" => "https://play.nim-lang.org/#ix=3Vph"
02:15:23FromDiscord<huantian> maybe cus I deleted dataType accedientaly
02:15:27FromDiscord<huantian> wow I can't type
02:16:00FromDiscord<!Patitotective> In reply to @huantian "maybe cus I deleted": i corrected that lol↵still the same error
02:16:17FromDiscord<!Patitotective> In reply to @huantian "wow I can't type": ~~i cant spell donwload correctly~~
02:17:50FromDiscord<huantian> that's weird??
02:20:29FromDiscord<huantian> I don't do threads much so I have no idea
02:21:02FromDiscord<!Patitotective> 😕
02:21:05FromDiscord<Elegantbeef> `Thread[datatype]` is invalid
02:21:27FromDiscord<Elegantbeef> Actually it might not be but you're better to do `(ptr data, len)`
02:21:44*flynn quit (Read error: Connection reset by peer)
02:22:42FromDiscord<!Patitotective> In reply to @Elegantbeef "`Thread[datatype]` is invalid": why? does it need to be an array or?
02:22:55*flynn joined #nim
02:22:55FromDiscord<Elegantbeef> I need to check if it's safe
02:23:04FromDiscord<Elegantbeef> I think it might be, but could be wrong
02:25:58FromDiscord<Elegantbeef> Yea the issue is openarray
02:27:55FromDiscord<huantian> sent a code paste, see https://play.nim-lang.org/#ix=3Vpi
02:28:36FromDiscord<huantian> (edit) "https://play.nim-lang.org/#ix=3Vpi" => "https://paste.rs/Ema"
02:29:16FromDiscord<Elegantbeef> Shows you how to do it
02:29:19FromDiscord<Elegantbeef> sent a code paste, see https://play.nim-lang.org/#ix=3Vpj
02:30:51FromDiscord<huantian> Btw for where to download the files, you might wanna look at getCacheDir and maybe std/tempfiles
02:31:57FromDiscord<!Patitotective> In reply to @huantian "Btw for where to": :OOOOOOOOOO exactly what i needed, thanks
02:33:21*flynn quit (Read error: Connection reset by peer)
02:34:31*flynn joined #nim
02:36:43FromDiscord<!Patitotective> sent a code paste, see https://paste.rs/nRB
02:44:11FromDiscord<huantian> hmmm
02:44:11FromDiscord<huantian> it's just not printing the messages for me what
02:44:44FromDiscord<!Patitotective> sent a code paste, see https://play.nim-lang.org/#ix=3Vpl
02:45:22*flynn quit (Read error: Connection reset by peer)
02:46:18FromDiscord<huantian> oh it's cus recv is blocking
02:46:34*flynn joined #nim
02:46:53FromDiscord<!Patitotective> yea but it should block until `toDown` sends something, shouldn't it?
02:49:21FromDiscord<huantian> sent a code paste, see https://play.nim-lang.org/#ix=3Vpm
02:54:37FromDiscord<huantian> Actually might be right forgot waitForDoenloadss wasn’t a sync
02:54:44FromDiscord<huantian> (edit) "a sync" => "async"
02:57:35FromDiscord<!Patitotective> actually its not downloading anything
02:57:42FromDiscord<!Patitotective> if you pass an invalid url, it will return true
02:57:47FromDiscord<!Patitotective> (edit) "if you pass an invalid url, it will return true ... " added "as well"
02:57:49*flynn quit (Read error: Connection reset by peer)
02:58:18FromDiscord<huantian> I thought it was cus recv doesn’t pass execution to the event loop
02:58:25FromDiscord<huantian> Not sure
02:59:01*flynn joined #nim
03:02:55FromDiscord<huantian> The future might be failing causing it to run the callback
03:07:03*flynn quit (Read error: Connection reset by peer)
03:07:06FromDiscord<!Patitotective> to get the future error message we would need to store it somewhere right? :confsu
03:07:11FromDiscord<!Patitotective> (edit) ":confsu" => "😕"
03:08:02*zeus-supreme quit (Ping timeout: 250 seconds)
03:08:13*flynn joined #nim
03:13:41FromDiscord<huantian> sent a code paste, see https://paste.rs/STe
03:15:03FromDiscord<!Patitotective> oooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooh
03:15:12FromDiscord<!Patitotective> we are not compiling with `-d:ssl`
03:15:14FromDiscord<Yardanico> oooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooh?
03:15:23FromDiscord<Yardanico> In reply to @Patitotective "we are not compiling": wait are you not checking for errors
03:15:23FromDiscord<!Patitotective> In reply to @Yardanico "ooooooooooooooooooooooooooooooooooooooooooooooooooo": yes oooooooooooooooooooooooooooooooooooh
03:15:28FromDiscord<Yardanico> ah right you just set the callback
03:15:35FromDiscord<Yardanico> you must also check for exceptions
03:15:37FromDiscord<Yardanico> yourself
03:15:43FromDiscord<Yardanico> if you use`callback`
03:16:11FromDiscord<huantian> i mean you should but downloadFile should handle that↵but yeah you probably should anywyas
03:16:23FromDiscord<huantian> the base issue is still that Channel.recv() is, asyncwise, blocking
03:16:26FromDiscord<Yardanico> @huantian no it's not about downloadFile
03:16:31FromDiscord<huantian> (edit) "anywyas" => "anyways"
03:16:35FromDiscord<Yardanico> it's about the fact that async exceptions are hidden in future error field
03:16:41FromDiscord<Yardanico> so if you don't check that and don't raise, you'll never know about them
03:17:17FromDiscord<Yardanico> need to use https://nim-lang.org/docs/asyncfutures.html#failed,FutureBase in callback
03:17:37FromDiscord<Yardanico> sent a code paste, see https://paste.rs/4Ii
03:18:22FromDiscord<huantian> yeah i see what you mean
03:19:35FromDiscord<!Patitotective> did you mean `getStackTrace`? cause `Error: undeclared identifier: 'injectStacktrace'`
03:19:46*flynn quit (Read error: Connection reset by peer)
03:19:55FromDiscord<Yardanico> that's because injectStacktrace is an internal asyncfutures proc
03:20:11FromDiscord<Yardanico> you can just use getStackTrace but your stack trace will be different from the usual async one
03:20:37FromDiscord<!Patitotective> but how do i use injectStacktrace?
03:20:57*flynn joined #nim
03:21:25FromDiscord<Yardanico> just use something like `fut.read()`, it'll raise if future has an error
03:21:59FromDiscord<Yardanico> sent a code paste, see https://play.nim-lang.org/#ix=3Vpt
03:22:29FromDiscord<!Patitotective> three let statements? 🤮
03:22:37FromDiscord<Yardanico> ??
03:22:46FromDiscord<Yardanico> ah yeah you can group them, but I don't do that usually
03:22:53FromDiscord<!Patitotective> but i can do `fut.asyncCheck()` as well, right?
03:23:02FromDiscord<huantian> sent a code paste, see https://play.nim-lang.org/#ix=3Vpu
03:23:10FromDiscord<Yardanico> In reply to @Patitotective "but i can do": true
03:23:32FromDiscord<Yardanico> but the problem is, asyncCheck sets the callback for the future
03:23:33FromDiscord<!Patitotective> sent a code paste, see https://paste.rs/B9k
03:23:52FromDiscord<Yardanico> sent a code paste, see https://paste.rs/Fbl
03:23:57FromDiscord<Yardanico> ehh i mean in the callback future is already done
03:23:59FromDiscord<huantian> (edit) "https://play.nim-lang.org/#ix=3Vpw" => "https://play.nim-lang.org/#ix=3Vpv"
03:24:04FromDiscord<Yardanico> no need for asyncCheck which sets another callback for the future
03:24:36FromDiscord<!Patitotective> but i can but `fut.asyncCheck` before adding the callback, right?
03:24:40FromDiscord<!Patitotective> (edit) removed "but"
03:24:56FromDiscord<Yardanico> but then you won't be able to _catch_ that exception
03:24:57FromDiscord<huantian> yeah you should be able to
03:25:00FromDiscord<huantian> yeah
03:25:02FromDiscord<Yardanico> and I assume you want to
03:25:03FromDiscord<!Patitotective> lmao
03:25:28FromDiscord<!Patitotective> In reply to @Yardanico "but then you won't": i wont need to cause asyncCheck would raise it (?)
03:25:38FromDiscord<Yardanico> yes, but then your whole program will shut down
03:25:47*nsyd joined #nim
03:26:01FromDiscord<!Patitotective> does this count no connection exceoption?
03:26:04FromDiscord<!Patitotective> (edit) "exceoption?" => "exception?"
03:26:05FromDiscord<Yardanico> yes of course
03:26:08FromDiscord<!Patitotective> :[
03:26:09FromDiscord<Yardanico> and i don't think you want your application crashing just because it couldn't download an image for some app
03:26:42FromDiscord<!Patitotective> In reply to @Yardanico "and i don't think": some app? i need exactly 1312 (or more) images
03:30:06FromDiscord<huantian> sent a code paste, see https://play.nim-lang.org/#ix=3Vpx
03:30:16FromDiscord<!Patitotective> sent a code paste, see https://play.nim-lang.org/#ix=3Vpy
03:30:53FromDiscord<!Patitotective> cause im receiving one file (never finishes) and nothing else happens :confsu
03:30:58FromDiscord<!Patitotective> (edit) ":confsu" => "😕"
03:31:34*arkurious quit (Quit: Leaving)
03:32:58FromDiscord<!Patitotective> In reply to @huantian "maybe use a result?": even more elegant 🧐: create a `NoException` exception so it can be `tuple[error: Exception, path: string]`
03:33:00*flynn quit (Read error: Connection reset by peer)
03:33:21FromDiscord<huantian> sent a code paste, see https://play.nim-lang.org/#ix=3Vpz
03:34:10*flynn joined #nim
03:36:23FromDiscord<huantian> now it gives bad file descriptor what
03:36:50FromDiscord<!Patitotective> sent a code paste, see https://play.nim-lang.org/#ix=3VpA
03:36:53FromDiscord<!Patitotective> (edit)
03:37:25FromDiscord<!Patitotective> (edit) "https://play.nim-lang.org/#ix=3VpA" => "https://play.nim-lang.org/#ix=3VpB"
03:37:49FromDiscord<huantian> hm that error seems to be from the client.close()???
03:38:14FromDiscord<!Patitotective> sent a code paste, see https://play.nim-lang.org/#ix=3VpC
03:38:29FromDiscord<!Patitotective> (edit) "https://play.nim-lang.org/#ix=3VpC" => "https://play.nim-lang.org/#ix=3VpD"
03:39:51*flynn quit (Read error: Connection reset by peer)
03:40:03FromDiscord<huantian> sent a code paste, see https://play.nim-lang.org/#ix=3VpE
03:40:16FromDiscord<!Patitotective> why are you not closing the client?
03:40:25FromDiscord<huantian> because that gives an error for soem reason
03:40:59FromDiscord<huantian> might be a weird it using a previous variable thingy whatever you call it
03:41:02*flynn joined #nim
03:41:59FromDiscord<huantian> closure that's the word
03:42:01FromDiscord<huantian> yeah I messed that up
03:42:55FromDiscord<huantian> cus that closes the same client multiple times
03:43:22FromDiscord<!Patitotective> maybe keep a stack with the clients?
03:43:58FromDiscord<!Patitotective> no, it wouldnt work, cause one client can start first and finish first so it would break the stack
03:46:54FromDiscord<Yardanico> i don't think it's due to client.close
03:46:59FromDiscord<Yardanico> it fails with that error even without it
03:47:08FromDiscord<!Patitotective> sent a code paste, see https://paste.rs/5q5
03:47:14FromDiscord<huantian> what's the way to capture the current client and path into the callback?
03:47:25FromDiscord<Yardanico> they are captured already, it's working correctly
03:47:30FromDiscord<Yardanico> probably
03:47:35FromDiscord<Yardanico> if not we can try closureScope
03:47:56FromDiscord<!Patitotective> In reply to @Patitotective "yea, it breaks because": (if you swap them so `feed.json` starts first it works)
03:48:11FromDiscord<Yardanico> seems to work
03:48:20FromDiscord<Yardanico> sent a code paste, see https://paste.rs/k58
03:48:52FromDiscord<Yardanico> fun fact - `closureScope` literally just creates an empty proc and calls it immediately afterwards, but it captures the needed variables that way
03:49:10FromDiscord<huantian> yep closure scope works for me
03:49:14FromDiscord<Yardanico> and yeah, not sure about sending `ref Exception` through channels - refc is local heap
03:49:26FromDiscord<Yardanico> with arc it might work if you GC_ref, but I doubt it's that useful
03:49:26FromDiscord<huantian> yeah probably not a good idea
03:49:33FromDiscord<Yardanico> you can always get the error right in the callback itself
03:50:45FromDiscord<!Patitotective> :DDDDDDDDDDD
03:50:51FromDiscord<!Patitotective> thank you so much guys
03:51:20FromDiscord<Yardanico> you should probably limit it somewhat so it doesn't download images for all apps at the same time, but that's up for you to decide
03:52:06FromDiscord<huantian> Complexity goes ⤴️ a bit tho
03:52:06*flynn quit (Read error: Connection reset by peer)
03:52:31FromDiscord<Yardanico> can't he just download images for apps that are in view and about to appear in view?
03:52:34FromDiscord<!Patitotective> i need to see how it performs, and maybe is not worth cause once you downloaded them they got stored in cache
03:52:43FromDiscord<huantian> In reply to @Yardanico "can't he just download": Actually yeah that’s probably not too hard
03:52:56FromDiscord<!Patitotective> In reply to @huantian "Complexity goes ⤴️ a": i dont know if i have another choice lol
03:53:18*flynn joined #nim
03:53:19FromDiscord<!Patitotective> In reply to @Yardanico "can't he just download": 👍
03:53:34FromDiscord<Yardanico> btw, any reason you're creating so many apps with your imgui app framework? :P to get people interested in it?
03:53:40FromDiscord<Yardanico> or you're planning on making a linux distro? :D
03:55:18FromDiscord<Yardanico> i quite like the idea, but for some reason I don't like using imgui for "normal" GUI apps because it doesn't integrate with the rest of the OS that well
03:55:44FromDiscord<Yardanico> but these are just my taste preferences, of course yours are different
03:56:21FromDiscord<!Patitotective> actually i just like to make app images and now you say, its also a nice way to get people interested↵and making a linux distro sounds like a lot of work on something i dont know how to do, which im not going to be able to maintain (or even get stable), also adding more "noise" to linux distros↵im fine with ubuntu hehe (no, arch no)
03:58:38FromDiscord<!Patitotective> In reply to @Yardanico "i quite like the": yea, id also like to be _native_ but i dont think its worth cause it adds a lot of dependencies, you need to limit the widgets a lot, it wont look the same as you planned it to look (at least you test it on various systems which would be a hell to change the GUI depending on the os)
03:58:56FromDiscord<!Patitotective> plus imgui is super fast and small
03:59:27FromDiscord<Yardanico> i guess my biggest problem with imgui is that it doesn't natively support multiple windows in the main branch
03:59:31FromDiscord<Yardanico> and same for modals, etc
03:59:47FromDiscord<Yardanico> there is a branch with separate windows support, and I might try it, but I will need to update nimgl's bindings for that
03:59:51FromDiscord<huantian> Hm I wonder can you send closures through channels
04:00:07FromDiscord<Yardanico> they're GC'd so that'd be quite dangerous :P
04:00:17FromDiscord<Yardanico> but might work with ARC if you somehow trick it into not destroying the closure
04:00:25FromDiscord<Elegantbeef> Just gcref them and go to town 😛
04:00:35FromDiscord<Yardanico> does gcref work on closures? I haven't really checked
04:00:55FromDiscord<Elegantbeef> I imagine you can just `GcRef(cast[ref int](myClosure))`
04:00:56FromDiscord<!Patitotective> In reply to @Yardanico "i guess my biggest": yea, ive saw people having trouble with that but i never needed them
04:01:00FromDiscord<Elegantbeef> Perhaps not
04:01:18FromDiscord<!Patitotective> In reply to @Yardanico "there is a branch": if you updated the bindings please fix `NonUDT` procs
04:01:21FromDiscord<!Patitotective> (edit) "In reply to @Yardanico "there is a branch": if you updated the bindings please fix `NonUDT` procs ... " added "lol"
04:01:35FromDiscord<Yardanico> but yes, imgui is nice, I've used it for a game hack in C++ cough (only for educational purposes)
04:01:54FromDiscord<Yardanico> easy to change the theme as well
04:02:06*flynn quit (Read error: Connection reset by peer)
04:02:14FromDiscord<!Patitotective> In reply to @Yardanico "easy to change the": https://github.com/Patitotective/ImStyle 😳
04:02:59FromDiscord<!Patitotective> In reply to @Yardanico "but yes, imgui is": one thing that imgui lacks, horribly is alignment↵cause to center things you need to pre-calculate their size and thats fricking horrible and sometimes hard
04:03:17*flynn joined #nim
04:03:22FromDiscord<Yardanico> In reply to @Patitotective "https://github.com/Patitotective/ImStyle 😳": doesn't imgui also allow you to save its settings to imgui.ini or something?
04:03:32FromDiscord<Elegantbeef> Yes
04:03:36FromDiscord<Elegantbeef> I think it does it by default
04:04:01FromDiscord<Elegantbeef> Almost like imgui isnt really good for proper applications↵(@!Patitotective)
04:04:29FromDiscord<!Patitotective> In reply to @Elegantbeef "Almost like imgui isnt": well, yeah, i think its for (dev) _tools_
04:04:40FromDiscord<Yardanico> yeah for that it's amazing
04:05:04FromDiscord<Yardanico> I really like the idea of https://sciter.com/ but it's still closed-source sadly, since there wasn't enough interest (and money) from people to make it go open-source
04:05:36FromDiscord<Yardanico> you can think of it as lightweight electron with a custom html/css engine + quickjs for UI layout or simple scripts
04:05:52FromDiscord<Yardanico> the whole DLL with everything compiled in is ~5mb
04:05:54FromDiscord<huantian> money is so often the issue with open source 😔
04:05:58FromDiscord<!Patitotective> web stuff scares me 💀
04:06:05FromDiscord<Yardanico> In reply to @Patitotective "web stuff scares me": this isn't real "web" stuff
04:06:17FromDiscord<Yardanico> it's written from ground up for desktop applications, it just happens to use html/css as those are generally good tools for design
04:06:18FromDiscord<!Patitotective> it scares me as it were 💀
04:06:19FromDiscord<Elegantbeef> I atleast like the declarative part of owlkettle though would be nice if it was crossplatform 😄
04:06:29FromDiscord<huantian> I was like onivim2 looks decent but then it's also somewhat dead 😔
04:06:34FromDiscord<Elegantbeef> Debian says "No mingw-gtk"
04:06:35FromDiscord<Yardanico> In reply to @huantian "money is so often": well, the dev of sciter gets a lot of money even if his app is closed source :)
04:06:40FromDiscord<Yardanico> most antiviruses use sciter :DD
04:06:43FromDiscord<!Patitotective> In reply to @Elegantbeef "I atleast like the": d-declarative imgui? 😳
04:06:45FromDiscord<Yardanico> so there's definitely enough money
04:07:00FromDiscord<Elegantbeef> Yea onivim2 didnt get enough patreon funding so it is now on the back burner
04:07:05FromDiscord<Yardanico> In reply to @Elegantbeef "Yea onivim2 didnt get": lol
04:07:07FromDiscord<Elegantbeef> Declarative imgui doesnt make much sense
04:07:18FromDiscord<Yardanico> isn't it already "declarative" as it's "immediate"
04:07:25FromDiscord<Yardanico> the start/end blocks
04:07:44FromDiscord<Elegantbeef> Kinda i mean it's not nealy as ergonomic as owlkettle's
04:08:16FromDiscord<!Patitotective> In reply to @Yardanico "isn't it already "declarative"": fidget was declarative and inmediate though
04:08:36FromDiscord<Yardanico> treeform is still busy writing fidget 2 or his game (I think?)
04:08:48FromDiscord<Yardanico> at least he said before that fidget 1 is effectively dead
04:08:51FromDiscord<!Patitotective> In reply to @Yardanico "treeform is still busy": he has so many cool projects
04:08:59FromDiscord<Yardanico> yes, all of them are for his main project
04:09:01FromDiscord<Yardanico> which is still secret :P
04:09:11FromDiscord<!Patitotective> sus ඞ
04:09:30FromDiscord<!Patitotective> _conquering the world with nim?_
04:09:39FromDiscord<!Patitotective> _kill go?_
04:11:17FromDiscord<!Patitotective> sent a code paste, see https://paste.rs/LCz
04:11:22FromDiscord<Yardanico> i used huantian's example i guess
04:11:27FromDiscord<!Patitotective> (edit) "https://play.nim-lang.org/#ix=3VpK" => "https://play.nim-lang.org/#ix=3VpJ"
04:11:28FromDiscord<Yardanico> you will close them yourself, right?
04:11:35FromDiscord<!Patitotective> hehe
04:12:09FromDiscord<huantian> in the example it's hard to see exactly where to close the channels
04:12:18FromDiscord<!Patitotective> In reply to @huantian "in the example it's": after the main loop
04:12:18FromDiscord<huantian> you can close them whenever you want
04:12:29FromDiscord<huantian> ok but I didn't add anythign to exit the main loop cus lazy
04:12:59FromDiscord<!Patitotective> In reply to @Yardanico "you will close them": yes, i will in my `proc terminate(app: var App) = ` that i can easily find because of a minimap 😁
04:14:37*flynn quit (Read error: Connection reset by peer)
04:15:25FromDiscord<!Patitotective> In reply to @Yardanico "doesn't imgui also allow": i-ini? 🤮
04:15:34FromDiscord<Yardanico> eh, ini isn't so bad
04:15:40FromDiscord<!Patitotective> lmfao
04:15:41FromDiscord<Yardanico> I actually like TOML
04:15:47FromDiscord<Yardanico> which is the logical continuation of ini
04:15:48*flynn joined #nim
04:15:56FromDiscord<Yardanico> In reply to @Patitotective "lmfao": nim has an ini parser (with some extensions) in the stdlib as well
04:15:57FromDiscord<!Patitotective> i actually like niprefs 💀
04:16:00FromDiscord<huantian> toml's cool
04:16:08FromDiscord<Yardanico> In reply to @Patitotective "i actually like niprefs": => seems weird for me 🤷
04:16:13FromDiscord<Yardanico> https://nim-lang.org/docs/parsecfg.html
04:16:27FromDiscord<Yardanico> https://github.com/toml-lang/toml↵https://github.com/toml-lang/toml
04:16:31FromDiscord<Yardanico> (edit) "https://github.com/toml-lang/toml↵https://github.com/toml-lang/toml" => "https://github.com/toml-lang/toml↵https://github.com/NimParsers/parsetoml"
04:16:47FromDiscord<!Patitotective> In reply to @Yardanico "=> seems weird for": thats because niprefs was a python library 💀
04:16:47FromDiscord<huantian> but parsetoml isn't as cool of a name as tomly
04:17:03FromDiscord<huantian> (edit) "tomly" => "tomly, treeform needs to make a toml parser"
04:17:06FromDiscord<Yardanico> it's in style with the stdlib
04:17:06FromDiscord<!Patitotective> In reply to @Patitotective "thats because niprefs was": and python = weird
04:17:28FromDiscord<!Patitotective> In reply to @huantian "but parsetoml isn't as": haha, sure he loves cute names
04:19:09FromDiscord<!Patitotective> maybe even tommy
04:19:10FromDiscord<!Patitotective> lmfao
04:21:52*slowButPresent quit (Quit: leaving)
04:23:39FromDiscord<!Patitotective> In reply to @Yardanico "btw, any reason you're": also ive always wanted to have _decent yet simple_ gui apps for my _portfolio_
04:26:16FromDiscord<!Patitotective> does puppy have a downloadFile-like proc?
04:26:41FromDiscord<!Patitotective> (edit) "downloadFile-like" => "downloadFile equivalent"
04:27:13*flynn quit (Read error: Connection reset by peer)
04:28:24*flynn joined #nim
04:28:28FromDiscord<huantian> you can always just fetch and write the body to a file
04:29:40FromDiscord<huantian> though that comes with the side effect of loading the file into memory
04:29:46FromDiscord<!Patitotective> sent a code paste, see https://play.nim-lang.org/#ix=3VpL
04:29:58FromDiscord<!Patitotective> (edit) "https://play.nim-lang.org/#ix=3VpL" => "https://paste.rs/fVD"
04:31:21FromDiscord<Yardanico> get data
04:31:28FromDiscord<Yardanico> write data to file
04:31:32FromDiscord<Yardanico> done
04:32:37FromDiscord<huantian> https://media.discordapp.net/attachments/371759389889003532/965469879165657098/unknown.png
04:32:40FromDiscord<huantian> you gotta use this thingy
04:32:47FromDiscord<huantian> maybe
04:33:01FromDiscord<huantian> actually I don't know you can probably just directly write the result from fetch into your file
04:33:21FromDiscord<!Patitotective> oh, but it's not async? :[
04:33:39FromDiscord<huantian> I think puppy just isn't async
04:34:21FromDiscord<huantian> so yeah no async
04:35:13FromDiscord<!Patitotective> actually, is it important that its async? wouldnt just work with a thread and fetches
04:35:15FromDiscord<!Patitotective> (edit) "fetches" => "fetches?"
04:35:26FromDiscord<!Patitotective> (edit) "that its" => "for it to be"
04:35:26FromDiscord<Rika> it doesnt say its threadsafe
04:35:34FromDiscord<Rika> so it might not be
04:36:11FromDiscord<!Patitotective> @huantian and using normal http clients?
04:36:18FromDiscord<huantian> in an issue they mention that they plan on adding async parallel requests to puppy, but it seems like it doesn't support async rn
04:36:40FromDiscord<!Patitotective> In reply to @Patitotective "<@300050030923087872> and using normal": i mean the `waitForDownloads` stuff
04:36:47FromDiscord<!Patitotective> does it really need async?
04:37:00FromDiscord<huantian> i mean it has to be async if you want it to download asynchronously
04:37:13FromDiscord<Rika> i saw you guys use callbacks
04:37:17FromDiscord<Rika> you guys are sick
04:37:18FromDiscord<Rika> in the mind
04:37:27FromDiscord<!Patitotective> In reply to @huantian "i mean it has": would it take the same time?
04:37:33FromDiscord<Rika> In reply to @Patitotective "would it take the": no
04:37:37FromDiscord<Rika> it will take longer
04:37:41FromDiscord<Elegantbeef> Well rewrite it better rika
04:37:43FromDiscord<Rika> much longer
04:37:50FromDiscord<!Patitotective> In reply to @Elegantbeef "Well rewrite it better": haha, yes
04:37:54FromDiscord<Rika> which version
04:37:57FromDiscord<huantian> yes show us the way rika without callbacks
04:38:00FromDiscord<Rika> i can
04:38:07FromDiscord<Rika> give me the one to base on tho
04:38:11FromDiscord<!Patitotective> wait
04:38:25FromDiscord<Elegantbeef> async is single threaded but it gives up the cpu at points marked `await` code without async is called synchronously if there isnt an `await`
04:38:27FromDiscord<Rika> expect it within a few hours, i have to leave for now xd
04:39:02*flynn quit (Ping timeout: 250 seconds)
04:39:03FromDiscord<Elegantbeef> `await` is basically "give up the cpu and we'll continue when the procedure finishes" if code doesnt have it you're running a blocking operation
04:40:28*flynn joined #nim
04:41:09FromDiscord<!Patitotective> sent a code paste, see https://play.nim-lang.org/#ix=3VpM
04:41:23FromDiscord<!Patitotective> dont forget `-d:ssl` :]
04:41:54FromDiscord<huantian> you should move `let (url, path) = maybe.msg` inside your closure scope
04:42:13FromDiscord<huantian> maybe
04:42:19FromDiscord<!Patitotective> :[
04:43:05FromDiscord<huantian> also the callback isn't sending into the channel?
04:43:57FromDiscord<!Patitotective> what, who changed that? 💀
04:44:08FromDiscord<huantian> yard probably when he was testing
04:44:16FromDiscord<Elegantbeef> Dont look now but you're the author
04:44:21FromDiscord<Elegantbeef> If you arent auditing the code who is?
04:45:29FromDiscord<!Patitotective> are you talking to me beef? ;-;
04:46:31FromDiscord<huantian> I beleef so
04:46:46FromDiscord<!Patitotective> LMFAO
04:47:08FromDiscord<Elegantbeef> Quite possibly i am
04:48:46FromDiscord<!Patitotective> its just that discord doesn't have a minimap so i needed to scroll up but its toooo late, im tired and that was the first snippet i found :[
04:49:37*flynn quit (Read error: Connection reset by peer)
04:50:48*flynn joined #nim
04:51:25FromDiscord<Rika> Let me see if I can program on my iPad
04:51:35FromDiscord<!Patitotective> i-pad? 💀
04:51:39FromDiscord<!Patitotective> (edit) "i-pad?" => "i-ipad?"
04:53:35FromDiscord<Rika> The playground is down
04:55:23FromDiscord<huantian> Yep
04:55:24FromDiscord<!Patitotective> frick yeaaaaaaaaaaaaaaaaaaaaaaaaah↵thank you yard and huantian ❤️ ↵im done for today :]]]]]]]]]]] https://media.discordapp.net/attachments/371759389889003532/965475610153599027/ImAppImage.mp4
04:55:41FromDiscord<Rika> Still cursed for using callbacks
04:55:46FromDiscord<!Patitotective> and beef :]
04:55:49FromDiscord<!Patitotective> and rika :]
04:55:53FromDiscord<!Patitotective> good night
04:55:55FromDiscord<!Patitotective> 🌃
04:56:01FromDiscord<!Patitotective> In reply to @Rika "Still cursed for using": :[
04:56:07FromDiscord<Rika> Good night, I’ll fix it sooner or later
04:56:17FromDiscord<huantian> Soon™️
04:56:23FromDiscord<!Patitotective> lmfao gngngngnngng
05:02:33*flynn quit (Read error: Connection reset by peer)
05:03:43*flynn joined #nim
05:13:20*flynn quit (Read error: Connection reset by peer)
05:14:32*flynn joined #nim
05:16:06*rockcavera quit (Remote host closed the connection)
05:22:33*flynn quit (Read error: Connection reset by peer)
05:23:46*flynn joined #nim
05:28:28FromDiscord<Skaruts> sent a code paste, see https://paste.rs/wCp
05:28:52FromDiscord<Skaruts> (edit) "https://paste.rs/uLg" => "https://play.nim-lang.org/#ix=3VpQ"
05:28:57FromDiscord<Rika> [0] / index it
05:29:03FromDiscord<Skaruts> (edit)
05:29:21FromDiscord<Rika> Naturally this won’t work if you want a many digit numbers
05:29:31FromDiscord<Rika> I’m which case use parseInt in strutils
05:29:36FromDiscord<Skaruts> ah that worked
05:29:37FromDiscord<Rika> In
05:30:10FromDiscord<Skaruts> but won't parseInt error if the param isn't a number?
05:30:35FromDiscord<Rika> It will, I guess, so catch it and handle the exception
05:30:56FromDiscord<Rika> Try except can be used as an expression
05:32:19*flynn quit (Read error: Connection reset by peer)
05:33:32*flynn joined #nim
05:34:34FromDiscord<Skaruts> hmm... I totally skipped then exception handling class lol
05:34:39FromDiscord<Skaruts> (edit) "then" => "the"
05:34:54FromDiscord<Skaruts> for years
05:35:13FromDiscord<Skaruts> I'll see if can manage it
05:35:14FromDiscord<Skaruts> thanks
05:37:19FromDiscord<Rika> That doesn’t sound good
05:37:26FromDiscord<Rika> Good luck I guess
05:41:58*flynn quit (Read error: Connection reset by peer)
05:43:09*flynn joined #nim
05:43:47*nrds quit (*.net *.split)
05:43:47*systemdsucks quit (*.net *.split)
05:43:48*NimEventer quit (*.net *.split)
05:43:58*NimEventer joined #nim
05:44:00*systemdsucks joined #nim
05:44:00*nrds joined #nim
05:46:40FromDiscord<Skaruts> seems like I got it 🙂
05:48:17*Amun-Ra quit (*.net *.split)
05:48:17*gshumway quit (*.net *.split)
05:48:54*Amun-Ra joined #nim
05:51:30*gshumway joined #nim
05:52:17*flynn quit (Read error: Connection reset by peer)
05:53:29*flynn joined #nim
05:55:44FromDiscord<Skaruts> what would be the appropriate exception to raise there, `ValueError`?
05:57:49FromDiscord<Rika> In this case you don’t raise again, if you get a parse error that means it’s not a number and therefore you return false
05:58:53FromDiscord<Rika> So it’s like↵`…and (try: discard paramStr(2).parseInt; true except: false) and…`
05:59:23FromDiscord<Rika> I mean, there are better ways to do this (I’m not sure if there’s an is number) but this is what came to mind first
06:01:08FromDiscord<TryAngle> In reply to @Rika "Let me see if": I did some programming on my ipad
06:01:11*flynn quit (Read error: Connection reset by peer)
06:01:13FromDiscord<Skaruts> well I do want to stop the program if the param is invalid in this case
06:01:14FromDiscord<TryAngle> works pretty well
06:01:16FromDiscord<Rika> In reply to @TryAngle "I did some programming": It’s not fun
06:01:25FromDiscord<Rika> In reply to @Skaruts "well I do want": Ah, okay
06:01:44FromDiscord<TryAngle> In reply to @Rika "It’s not fun": I mean just use vim on a linux server u ssh into
06:01:49FromDiscord<TryAngle> XD
06:01:52FromDiscord<Rika> I don’t have a keyboard with me
06:02:00FromDiscord<TryAngle> oh, I have keyboard
06:02:04FromDiscord<TryAngle> so it works well
06:02:24*flynn joined #nim
06:12:28*flynn quit (Read error: Connection reset by peer)
06:13:40*flynn joined #nim
06:23:28*flynn quit (Read error: Connection reset by peer)
06:24:41*flynn joined #nim
06:29:18FromDiscord<Yayko> Hello everyone, I tried to create an object with a "pos" for the name's field, it's a tuple.↵I can't declare this tuple in the "()", can someone help me? https://media.discordapp.net/attachments/371759389889003532/965499241265000508/unknown.png
06:32:06FromDiscord<Rika> can you show how you do it
06:32:13FromDiscord<Yayko> https://media.discordapp.net/attachments/371759389889003532/965499977143042078/unknown.png
06:33:19FromDiscord<Yayko> sorry i didn't see that i deleted it
06:34:28FromDiscord<Rika> `pos: (x: 10, y: 10\)`
06:34:30FromDiscord<Rika> (edit) "10\)`" => "10)`"
06:37:10FromDiscord<Yayko> it doesn't work ... https://media.discordapp.net/attachments/371759389889003532/965501223719567380/unknown.png
06:38:19*flynn quit (Read error: Connection reset by peer)
06:39:31*flynn joined #nim
06:40:11FromDiscord<Yayko> In reply to @Rika "`pos: (x: 10, y:": it works thank you, I thought this syntax could work everywhere ^^
06:45:44*flynn quit (Read error: Connection reset by peer)
06:46:56*flynn joined #nim
06:56:19*flynn quit (Read error: Connection reset by peer)
06:57:32*flynn joined #nim
06:58:05FromDiscord<Yayko> In reply to @Rika "`pos: (x: 10, y:": I tried replacing the ints with cint, it doesn't work anymore ^^
06:58:17FromDiscord<Rika> where
06:58:24FromDiscord<Rika> show code again
07:01:46FromDiscord<Yayko> https://media.discordapp.net/attachments/371759389889003532/965507414478708746/unknown.png
07:02:05FromDiscord<Rika> integer literals arent coerced into cint
07:02:09FromDiscord<Rika> `10.cint` for both
07:04:14FromDiscord<Yayko> Oh thank you again, it's not always easy to be a newbie ^^
07:04:45FromDiscord<Rika> sometimes the issue isnt obvious
07:04:56FromDiscord<Rika> why are you using cint btw?
07:05:06FromDiscord<Rika> theres not much reason to use it unless you're doing interop with other languages
07:08:09FromDiscord<Yayko> Yes, I use Raylib 8)
07:08:26FromDiscord<Yayko> (edit) removed "8)"
07:08:29*flynn quit (Read error: Connection reset by peer)
07:09:41*flynn joined #nim
07:11:46*gsalazar joined #nim
07:17:11*flynn quit (Read error: Connection reset by peer)
07:18:23*flynn joined #nim
07:26:49*flynn quit (Read error: Connection reset by peer)
07:28:01*flynn joined #nim
07:37:56*flynn quit (Read error: Connection reset by peer)
07:39:08*flynn joined #nim
07:45:49*flynn quit (Read error: Connection reset by peer)
07:47:00*flynn joined #nim
07:50:48NimEventerNew thread by Sauerbread: Metatag - an audio metadata library, see https://forum.nim-lang.org/t/9112
07:52:35FromDiscord<aph> ah i should've found this earlier `http://kaitai.io/`, would have 200% less work for my mmd parser↵i might want to help with their nim code gen later probably, if i manage to do that
07:54:15*flynn quit (Read error: Connection reset by peer)
07:55:27*flynn joined #nim
08:02:18*flynn quit (Read error: Connection reset by peer)
08:03:30*flynn joined #nim
08:10:48*flynn quit (Read error: Connection reset by peer)
08:12:00*flynn joined #nim
08:19:34*flynn quit (Read error: Connection reset by peer)
08:20:45*flynn joined #nim
08:26:35*Gustavo6046 quit (Quit: Goodbye! Leave messages at my XMPP @ [email protected] or my Discord Gustavo6046#9009 or possibly my Mastodon [email protected] – I don't check my email often since it's full of crap, but in any case, [email protected])
08:30:07*flynn quit (Read error: Connection reset by peer)
08:31:19*flynn joined #nim
08:36:35*nsyd quit (Quit: WeeChat 3.5)
08:40:58*flynn quit (Read error: Connection reset by peer)
08:42:11*flynn joined #nim
08:50:47*neceve joined #nim
08:50:59*flynn quit (Read error: Connection reset by peer)
08:52:10*flynn joined #nim
08:59:50*flynn quit (Read error: Connection reset by peer)
09:01:01*flynn joined #nim
09:12:41*flynn quit (Read error: Connection reset by peer)
09:13:53*flynn joined #nim
09:21:14*flynn quit (Read error: Connection reset by peer)
09:22:26*flynn joined #nim
09:23:56FromDiscord<morgan> so i have made some mildly cursed code, but it does compile. no clue if it’ll work when i call it i didn’t get that far https://media.discordapp.net/attachments/371759389889003532/965543187995295774/unknown.png https://media.discordapp.net/attachments/371759389889003532/965543188301488168/unknown.png
09:24:34FromDiscord<morgan> maybe the three back to back could be one when expression
09:25:11FromDiscord<morgan> also as of tonight i have 4 concurrent open prs on saem’s extension lmao
09:30:20*flynn quit (Read error: Connection reset by peer)
09:31:33*flynn joined #nim
09:36:27FromDiscord<d4rckh> sent a code paste, see https://play.nim-lang.org/#ix=3Vqu
09:36:55FromDiscord<d4rckh> (edit) "https://play.nim-lang.org/#ix=3Vqu" => "https://play.nim-lang.org/#ix=3Vqv"
09:39:24*flynn quit (Read error: Connection reset by peer)
09:40:36*flynn joined #nim
09:45:10FromDiscord<Rika> because fgWhite and fgYellow arent actually written in the string
09:45:33FromDiscord<Rika> styledwriteline processes them and does the right thing depending on the os
09:46:21FromDiscord<d4rckh> i could split logArgument by `[]` and do it like `part[0], fgYellow, "[]", part[1], fgWhite` but logArgument might have multiple `[]`s that need to be highlighted
09:46:50FromDiscord<Rika> use styledwrite (not the one with line) and write each part via for loop
09:47:37FromDiscord<d4rckh> okay, thanks
09:47:38*flynn quit (Read error: Connection reset by peer)
09:48:51*flynn joined #nim
09:53:21*lumo_e joined #nim
09:56:28*flynn quit (Read error: Connection reset by peer)
09:57:41*flynn joined #nim
09:58:07*jmdaemon quit (Ping timeout: 240 seconds)
09:59:48*lumo_e quit (Ping timeout: 276 seconds)
10:00:37FromDiscord<m4ul3r> sent a code paste, see https://play.nim-lang.org/#ix=3Vqz
10:00:49FromDiscord<m4ul3r> (edit) "https://play.nim-lang.org/#ix=3Vqz" => "https://paste.rs/g6K"
10:01:01FromDiscord<m4ul3r> (edit) "https://play.nim-lang.org/#ix=3VqA" => "https://play.nim-lang.org/#ix=3Vqz"
10:01:39FromDiscord<m4ul3r> My current solution is a bunch of if-elif-elif-else. case seems like it would be cleaner
10:05:00*flynn quit (Read error: Connection reset by peer)
10:06:12*flynn joined #nim
10:07:20FromDiscord<lantos> nim playground dead or just for me?
10:07:25FromDiscord<lantos> (edit) "me?" => "me?↵https://play.nim-lang.org/"
10:11:39FromDiscord<Rika> not just you
10:11:52FromDiscord<Rika> In reply to @m4ul3r "Is there anyway to": no, you need to use ifs here
10:12:47FromDiscord<Yayko> In reply to @lantos "nim playground dead or": I went to see and it's the same for me, I think it's general.
10:14:13*flynn quit (Read error: Connection reset by peer)
10:14:13FromDiscord<lantos> found dis, actually quite nice https://doongjohn.github.io/nim-playground/
10:15:24*flynn joined #nim
10:15:42FromDiscord<Phil> In reply to @m4ul3r "Is there anyway to": The "case" statement is for covering all cases of an variable's values (e.g. when using an enum). What you're doing is you're checking a condition, and for that you'll need to use if/else statements
10:15:53FromDiscord<Phil> (edit) "values" => "value"
10:16:05FromDiscord<Phil> (edit) "an" => "a"
10:16:11FromDiscord<Phil> (edit) "In reply to @m4ul3r "Is there anyway to": The "case" statement is for covering all cases of a variable's value (e.g. when using an enum). What you're doing is you're checking a condition, and for that you'll need to use if/else statements ... " added "as Rika suggested"
10:17:21FromDiscord<m4ul3r> I'm currently 10 elifs deeps and I'm expecting about 10-15 more 😆
10:17:37FromDiscord<Phil> Hmmm what are you precisely trying to do? as in, why so many conditions?
10:17:45FromDiscord<Phil> That many elifs hint towards there being a simpler solution
10:20:38FromDiscord<m4ul3r> There probably is. I'm creating an interactive prompt to take a user input and do stuff based on the input
10:21:31FromDiscord<Phil> Is the number of allowed inputs finite in the sense that you could throw them in an enum??
10:21:33FromDiscord<Phil> (edit) "enum??" => "enum?"
10:21:56FromDiscord<Phil> Oh wait, the if-elses come about because of the user having to make that many choices
10:21:58FromDiscord<Phil> Nevermind
10:24:12FromDiscord<m4ul3r> Yeah the user input is limiting me but I do need it to be interactive. I'm doing something like `get apple 1`, `set apple 2`, `mov banana 3`. ↵I'm calling functions based off of the startsWith and handling the input with split(' ')
10:24:30FromDiscord<m4ul3r> (edit) "apple 1`," => "apple_1`," | "apple" => "apple_2"
10:25:24*flynn quit (Read error: Connection reset by peer)
10:26:36*flynn joined #nim
10:35:23*flynn quit (Read error: Connection reset by peer)
10:36:35*flynn joined #nim
10:40:51NimEventerNew Nimble package! pantry - Client library for https://getpantry.cloud/, see https://github.com/ire4ever1190/pantry-nim
10:45:51*flynn quit (Read error: Connection reset by peer)
10:47:03*flynn joined #nim
10:53:32*flynn quit (Read error: Connection reset by peer)
10:54:44*flynn joined #nim
11:00:36*flynn quit (Read error: Connection reset by peer)
11:01:48*flynn joined #nim
11:04:42FromDiscord<ShalokShalom> In reply to @Isofruit "The "case" statement is": Then this error message is not very specific
11:07:43NimEventerNew thread by Veksha: Async stdin/stdout errors (compiling nimlsp on Windows), see https://forum.nim-lang.org/t/9113
11:10:59*flynn quit (Read error: Connection reset by peer)
11:12:11*flynn joined #nim
11:19:12*flynn quit (Read error: Connection reset by peer)
11:20:23*flynn joined #nim
11:25:39*flynn quit (Read error: Connection reset by peer)
11:26:51*flynn joined #nim
11:28:43FromDiscord<Phil> Errr.... how do I write a macro again to resolve to the code `obj.fieldName` for a given obj with fieldName as a static string?↵I had a macro for that once upon a time, but I refactored that out and I can't find it anymore.↵I still have the discussion I had with beef about this, but I can't find it for the life of me:↵` macro getField(it: untyped, fieldName: static string): untyped = nnkDotExpr.newTree(ident("it"), ident fieldName)` T
11:29:29FromDiscord<Phil> (edit) "Errr.... how do I write" => "sent" | "macro again to resolve to the code `obj.fieldName` for a given obj with fieldName as a static string?↵I had a macro for that once upon a time, but I refactored that out and I can't find it anymore.↵I still have the discussion I had with beef about this, but I can't find it for the life of me:↵` macro getField(it: untyped, fieldName: static string): untyped = nnkDotExpr.newTree(ident("it")
11:33:44*flynn quit (Remote host closed the connection)
11:34:55*flynn joined #nim
11:37:47NimEventerNew thread by Didlybom: Installing choosenim (on Windows) on a custom folder does not seem to work, see https://forum.nim-lang.org/t/9114
11:41:56*flynn quit (Read error: Connection reset by peer)
11:43:08*flynn joined #nim
11:49:37FromDiscord<Rika> https://media.discordapp.net/attachments/371759389889003532/965579852822499348/Japanese_Goblin_Phonk_Edit480P.mp4
11:49:58FromDiscord<Rika> https://media.discordapp.net/attachments/371759389889003532/965579940231786506/06BA8DB5-C8DD-4033-B9BD-763A43C4DAA1.jpg
11:51:24*flynn quit (Read error: Connection reset by peer)
11:51:58FromDiscord<Phil> blinks
11:52:36*flynn joined #nim
11:54:39FromDiscord<Rika> Pop
11:54:42FromDiscord<Rika> Oops
11:54:44FromDiscord<Rika> Wrong server
11:54:47FromDiscord<Rika> My bad lmao
11:57:45FromDiscord<amadan> sent a code paste, see https://play.nim-lang.org/#ix=3VqX
11:57:57FromDiscord<amadan> (edit) "https://play.nim-lang.org/#ix=3VqX" => "https://play.nim-lang.org/#ix=3VqY"
11:59:34*flynn quit (Read error: Connection reset by peer)
12:00:46*flynn joined #nim
12:04:06FromDiscord<Phil> sent a code paste, see https://play.nim-lang.org/#ix=3Vr0
12:04:26FromDiscord<Phil> sent a code paste, see https://play.nim-lang.org/#ix=3Vr1
12:08:21*flynn quit (Read error: Connection reset by peer)
12:09:32*flynn joined #nim
12:16:07*flynn quit (Read error: Connection reset by peer)
12:17:19*flynn joined #nim
12:19:55*jjido joined #nim
12:23:05*flynn quit (Read error: Connection reset by peer)
12:24:16*flynn joined #nim
12:27:44*rockcavera joined #nim
12:27:44*rockcavera quit (Changing host)
12:27:44*rockcavera joined #nim
12:32:35*flynn quit (Read error: Connection reset by peer)
12:33:47*flynn joined #nim
12:36:11FromDiscord<Phil> Heck yeah! Give it a couple more weeks and this'll be the basis of a convenience proc to query multiple many-to-X relationships in one go
12:41:59*flynn quit (Read error: Connection reset by peer)
12:43:11*flynn joined #nim
12:48:27*v9fk quit (Remote host closed the connection)
12:49:22*flynn quit (Read error: Connection reset by peer)
12:50:33*flynn joined #nim
12:59:36*flynn quit (Read error: Connection reset by peer)
13:00:47*flynn joined #nim
13:02:08*kayabaNerve_ joined #nim
13:04:27*kayabaNerve quit (Ping timeout: 240 seconds)
13:08:45*flynn quit (Read error: Connection reset by peer)
13:09:56*flynn joined #nim
13:12:32*v9fk joined #nim
13:13:18*v9fk quit (Remote host closed the connection)
13:13:44*v9fk joined #nim
13:18:49*flynn quit (Read error: Connection reset by peer)
13:20:01*flynn joined #nim
13:29:58*flynn quit (Read error: Connection reset by peer)
13:31:10*flynn joined #nim
13:32:39*arkurious joined #nim
13:39:17*flynn quit (Read error: Connection reset by peer)
13:39:55*tiorock joined #nim
13:39:55*tiorock quit (Changing host)
13:39:55*tiorock joined #nim
13:39:55*rockcavera is now known as Guest5429
13:39:55*tiorock is now known as rockcavera
13:40:09*Guest5429 quit (Ping timeout: 276 seconds)
13:40:28*flynn joined #nim
13:46:44*flynn quit (Read error: Connection reset by peer)
13:47:57*flynn joined #nim
13:50:15*noeontheend joined #nim
13:56:38*flynn quit (Read error: Connection reset by peer)
13:57:50*flynn joined #nim
14:03:47FromDiscord<pmunch> Rebooted the server↵(@lantos)
14:03:59FromDiscord<pmunch> I really should look into getting us something better..
14:04:16FromDiscord<lantos> In reply to @pmunch "I really should look": what do you mean by this?
14:04:21*lumo_e joined #nim
14:04:57*flynn quit (Read error: Connection reset by peer)
14:06:10*flynn joined #nim
14:08:18FromDiscord<demotomohiro> !eval echo static staticExec "uptime"
14:08:21NimBot 14:08:20 up 4 min, load average: 0.60, 0.80, 0.36
14:13:36FromDiscord<deech> Any Emacs' users here? I use nim-mode via Doom Emacs (https://github.com/hlissner/doom-emacs/tree/master/modules/lang/nim) and I've noticed that indentation doesn't work well, it often goes to the beginning of the line and resists when I try to align manually with spaces. If anyone has tips on config I'd appreciate it.
14:15:47*flynn quit (Read error: Connection reset by peer)
14:16:59*flynn joined #nim
14:22:37*flynn quit (Read error: Connection reset by peer)
14:23:49*flynn joined #nim
14:30:04*flynn quit (Read error: Connection reset by peer)
14:31:17*flynn joined #nim
14:37:38*flynn quit (Read error: Connection reset by peer)
14:38:50*flynn joined #nim
14:41:10FromDiscord<Jakraes> Quick question, how do you guys reduce cpu usage in while loops? My while loop is using 20% of my cpu
14:41:21FromDiscord<Jakraes> Should I just sleep for a certain time?
14:41:57FromDiscord<Rika> Why do you want to reduce usage? Are you waiting by spinning?
14:42:08FromDiscord<Rika> You can do sleep yes
14:43:18FromDiscord<Jakraes> Because it's just a terminal game, it shouldn't be using that much cpu tbh
14:43:18FromDiscord<pmunch> Get a better server↵(@lantos)
14:43:31FromDiscord<Jakraes> Yeah I'll try sleep
14:43:43FromDiscord<Phil> In reply to @pmunch "Get a better server": Ah, is your stuff running on the equivalent of a Linode 5$/month plan?
14:44:05FromDiscord<Phil> Which is basically you get a potato that can serve webpages with 20 gigs of storage space
14:45:38*flynn quit (Read error: Connection reset by peer)
14:46:24FromDiscord<Jakraes> Yeah sleep worked, went from 20 to 10
14:46:50*flynn joined #nim
14:47:52FromDiscord<Jakraes> Still, it's pretty weird how much cpu it uses
14:53:18FromDiscord<TricolorHen061> Is it feasible to write an operating system in Nim
14:53:21FromDiscord<TricolorHen061> (edit) "Nim" => "Nim?"
14:54:08FromDiscord<pmunch> Yes, there has even been written one↵(@TricolorHen061)
14:54:18FromDiscord<pmunch> Just a toy one though
14:54:50FromDiscord<pmunch> Why is it weird? You tell it to go as fast as it can, so that's exactly what it does↵(@Jakraes)
14:55:09*flynn quit (Read error: Connection reset by peer)
14:55:11FromDiscord<Jakraes> Yeah that is true
14:55:26FromDiscord<pmunch> No idea actually, it's Dom who set it up↵(@Phil)
14:55:33FromDiscord<Jakraes> I need to create some sort of fps lock
14:55:42FromDiscord<pmunch> But the machine is pretty potato
14:56:15FromDiscord<pmunch> @Jakraes\: is there stuff always happening on screen?
14:56:21*flynn joined #nim
14:56:25FromDiscord<pmunch> Or just when the user provides input?
14:56:26FromDiscord<Jakraes> Yup
14:56:45FromDiscord<Jakraes> There's something constantly being drawn on screen
14:57:07FromDiscord<pmunch> An FPS lock is trivial enough, just time how long this iteration of the loop took, figure out how long it should take given the FPS you want, and then sleep the remainder
14:58:08FromDiscord<TricolorHen061> Yeah, but it wouldn't be feasible to write a real one in it, would it?
14:58:21FromDiscord<huantian> Define feasible
14:58:55FromDiscord<TricolorHen061> If Linux was written in Nim would it be as popular as it today?
14:59:10FromDiscord<TricolorHen061> That's my "feasible"
14:59:29FromDiscord<TricolorHen061> (edit) "Nim" => "Nim," | "it" => "Linux"
14:59:29FromDiscord<pmunch> Sure, why not?
14:59:31FromDiscord<Rika> How would that have happened
14:59:47FromDiscord<TricolorHen061> It couldn't because t didn't exist
14:59:53FromDiscord<TricolorHen061> I'm just saying IF it was
14:59:56FromDiscord<Rika> Well I don’t see why you can’t
15:00:01FromDiscord<Rika> You would just need a lot of planning
15:00:06FromDiscord<TricolorHen061> Like will it be slow
15:00:16FromDiscord<Rika> Slow is dependent on implementation
15:00:18FromDiscord<Rika> Not language
15:00:36FromDiscord<pmunch> Nim can be as fast as C
15:00:42FromDiscord<pmunch> So that wouldn't be an issue
15:00:56FromDiscord<Rika> Lua the language is not slow, the Lua reference implementation “is”, compared to LuaJIT
15:01:34FromDiscord<Rika> Speed can evolve as time passes, even if the language does not ultimately
15:02:06*drewr quit (Remote host closed the connection)
15:02:40FromDiscord<pmunch> Nim could even end up being faster if there are slow patterns in the Linux codebase which could be replaced by faster patterns by templates or macros
15:04:00FromDiscord<Rika> There are situations where unrolled code is slower than rolled code, like when your constraint is memory and not the CPU
15:04:56*flynn quit (Read error: Connection reset by peer)
15:06:07*flynn joined #nim
15:06:24*slowButPresent joined #nim
15:12:20*flynn quit (Read error: Connection reset by peer)
15:13:32*flynn joined #nim
15:20:39*flynn quit (Read error: Connection reset by peer)
15:21:51*flynn joined #nim
15:26:59*flynn quit (Read error: Connection reset by peer)
15:28:10*flynn joined #nim
15:29:03*PMunch joined #nim
15:34:53*flynn quit (Read error: Connection reset by peer)
15:36:05*flynn joined #nim
15:41:49*flynn quit (Read error: Connection reset by peer)
15:43:00*flynn joined #nim
15:43:51FromDiscord<b4mbus> am I blind or does Nim stdlib really does not have any generic `.each`/`.eachIt` or `.forEach`/`.forEachIt`?
15:44:30FromDiscord<b4mbus> why cant I `collection.filterIt(it.sth == 0).eachIt(function_call(it))` or whatnot
15:47:03FromDiscord<Phil> There are Filter etc in sequtils, but regarding a foreach loop that looks the way map, filter and Co look I think you're out of luck
15:47:37*flynn quit (Read error: Connection reset by peer)
15:48:29FromDiscord<b4mbus> alright, `[1,2,3,4,5].filterIt(it mod 2 == 0).apply(echo)`
15:48:43FromDiscord<b4mbus> how come that doesn't work? There's `apply` for proc's that dont mutate
15:48:49*flynn joined #nim
15:49:07FromDiscord<b4mbus> bruh theres half the functional world but not `each` lol
15:49:48FromDiscord<Phil> I think that's because there's already for in loops that do that job
15:50:30FromDiscord<b4mbus> yeah but why should I use a for loop if I could use a fitting functional style algorithm that does that..
15:50:38FromDiscord<b4mbus> aight whatever
15:51:16FromDiscord<Phil> I wonder if somebody made a package for that
15:55:34FromDiscord<demotomohiro> sent a code paste, see https://play.nim-lang.org/#ix=3VrU
15:55:35*flynn quit (Read error: Connection reset by peer)
15:56:48*flynn joined #nim
15:57:49FromDiscord<b4mbus> ...
16:02:27FromDiscord<Daniel> https://castillodel.github.io/compile-time-evaluation/
16:02:27FromDiscord<Solitude> In reply to @b4mbus "am I blind or": map?
16:02:50FromDiscord<b4mbus> map is map
16:02:55FromDiscord<b4mbus> Im not talking about map
16:02:59FromDiscord<b4mbus> Im talking about for each :p
16:03:10FromDiscord<Solitude> yeah, in my brain map did somehting else
16:03:19*flynn quit (Read error: Connection reset by peer)
16:04:30*flynn joined #nim
16:08:25FromDiscord<Alea> In reply to @pmunch "An FPS lock is": I've just gone through this, it's not quite that easy because sleep alone isn't precise enough for frame pacing
16:08:46FromDiscord<b4mbus> sent a code paste, see https://play.nim-lang.org/#ix=3VrW
16:08:47FromDiscord<b4mbus> hmm
16:09:09FromDiscord<b4mbus> sent a code paste, see https://play.nim-lang.org/#ix=3VrX
16:11:04*flynn quit (Read error: Connection reset by peer)
16:11:38FromDiscord<Solitude> and?
16:12:17*flynn joined #nim
16:12:20FromDiscord<b4mbus> and Im wondering why cant I do that
16:12:53FromDiscord<b4mbus> sent a code paste, see https://play.nim-lang.org/#ix=3VrY
16:13:01FromDiscord<b4mbus> but it's sink, some kind of Nim's move semantics iirc
16:13:12FromDiscord<Solitude> why, your giggitycollector doesnt have add proc
16:13:16FromDiscord<Solitude> why would that fit
16:13:49FromDiscord<b4mbus> ah, sry
16:14:20FromDiscord<b4mbus> `seq` doesnt have too apparently ;d
16:14:45FromDiscord<Solitude> what
16:15:35FromDiscord<b4mbus> https://media.discordapp.net/attachments/371759389889003532/965646782702972928/unknown.png
16:15:37FromDiscord<b4mbus> idk u see the code..
16:15:56FromDiscord<Solitude> your collector is let
16:16:01FromDiscord<Solitude> read a tutorial maybe?
16:16:29FromDiscord<Phil> Let variables are immutable, see the lowest set of errors
16:16:30FromDiscord<b4mbus> hmm I happened to forget that indeed
16:17:53FromDiscord<demotomohiro> @Jakraes If you are using OpenGL, I think wglSwapIntervalEXT/glXSwapIntervalEXT is easiest way to keep fps: https://www.khronos.org/opengl/wiki/Swap_Interval
16:19:06*flynn quit (Read error: Connection reset by peer)
16:20:18*flynn joined #nim
16:21:09*fredrikhr joined #nim
16:25:19*noeontheend quit (Ping timeout: 256 seconds)
16:25:45*flynn quit (Read error: Connection reset by peer)
16:26:56*flynn joined #nim
16:30:34*flynn quit (Read error: Connection reset by peer)
16:31:30FromDiscord<dom96> In reply to @pmunch "Get a better server": what are we being limited by with the current server?
16:31:37FromDiscord<dom96> is it not just the playground crashing?
16:31:45*flynn joined #nim
16:32:30PMunchWell it does keep running out of storage
16:32:46PMunchAnd if too many people use it at once it runs out of memory/cpu as well
16:33:06PMunchI've had to limit each process quite severely in order to not starve each user
16:34:50FromDiscord<dom96> good timing on this though, our Digital Ocean credits are running out
16:35:48*flynn quit (Read error: Connection reset by peer)
16:36:59*flynn joined #nim
16:39:36FromDiscord<codic> sent a code paste, see https://play.nim-lang.org/#ix=3Vsa
16:39:37FromDiscord<codic> is there any workaround for tihs?
16:39:39FromDiscord<codic> sent a code paste, see https://paste.rs/NZs
16:39:40FromDiscord<codic> (edit) "tihs?" => "this?"
16:43:27*flynn quit (Read error: Connection reset by peer)
16:44:38*flynn joined #nim
16:45:17FromDiscord<demotomohiro> Add dpy parameter to that proc and pass it as third argument of createThread?
16:46:02FromDiscord<demotomohiro> By the way, XQueryPointer is thread safe?
16:46:10FromDiscord<Jakraes> In reply to @demotomohiro "<@291701542694944771> If you are": Ah nah nah, I'm just using the good ol' windows terminal
16:47:39FromDiscord<Jakraes> Also, I'm curious, can nim create windows all by itself? I was wondering if it was possible to create a terminal window to draw on with a defined size and font size
16:48:01FromDiscord<demotomohiro> @Jakraes Then you cannot use wglSwapIntervalExt.
16:48:10FromDiscord<Jakraes> Yup, that's unfortunate
16:48:59FromDiscord<ShalokShalom> First result when I type 'proc' in the search bar of the the manual: ↵jsffi: `.()`[K: cstring; V: proc](obj: JsAssoc[K, V]; field: untyped; args: varargs[untyped]): auto
16:49:08FromDiscord<ShalokShalom> Documentation 1A
16:49:14FromDiscord<ShalokShalom> 👍 😆
16:49:27FromDiscord<ShalokShalom> (edit) "↵jsffi:" => "↵`jsffi:" | "auto" => "auto`"
16:49:31FromDiscord<codic> In reply to @demotomohiro "By the way, XQueryPointer": Xlib is thread-safe enough I think for getting things, certainly not for non-pure calls though (which send X events)
16:49:34FromDiscord<codic> thanks!
16:49:44*flynn quit (Read error: Connection reset by peer)
16:50:56*flynn joined #nim
16:51:05*fallback quit (Ping timeout: 248 seconds)
16:51:59FromDiscord<demotomohiro> @Jakraes Nim can use any windows API. So that should be possible if there is APIs to create such a terminal window.
16:55:57FromDiscord<codic> In reply to @codic "Xlib is thread-safe enough": lolno
16:55:59FromDiscord<codic> [xcb] Unknown sequence number while appending request↵[xcb] You called XInitThreads, this is not your fault↵[xcb] Aborting, sorry about that.
16:56:31FromDiscord<codic> i wish I used xcb now
16:57:07*flynn quit (Read error: Connection reset by peer)
16:58:19*flynn joined #nim
17:01:38FromDiscord<Solitude> In reply to @ShalokShalom "First result when I": manual doesnt have search bar. the only search bar there is searches stdlib.
17:02:29FromDiscord<m4ul3r> sent a code paste, see https://paste.rs/Suo
17:03:27FromDiscord<ShalokShalom> In reply to @Solitude "manual doesnt have search": Yeah, I figured so much.
17:03:36FromDiscord<ShalokShalom> Thanks
17:04:12FromDiscord<Solitude> In reply to @m4ul3r "I have an issue": you have two `thing`'s in same scope. also, what?
17:04:29*flynn quit (Remote host closed the connection)
17:05:41*flynn joined #nim
17:08:48FromDiscord<m4ul3r> sent a code paste, see https://play.nim-lang.org/#ix=3Vsk
17:09:04FromDiscord<m4ul3r> (edit) "https://play.nim-lang.org/#ix=3Vsk" => "https://play.nim-lang.org/#ix=3Vsl"
17:10:20FromDiscord<Solitude> sorry, i dont understand whats the problem is and why passing data you work on to a function as parameter is an issue.
17:12:13*flynn quit (Read error: Connection reset by peer)
17:13:25*flynn joined #nim
17:14:25FromDiscord<m4ul3r> I'm just wanting to do weird things with the variable, but I realized I should just move everything outside of `when isMainModule` to do what I want - sorry!
17:19:26*flynn quit (Read error: Connection reset by peer)
17:20:37*flynn joined #nim
17:25:14*flynn quit (Read error: Connection reset by peer)
17:26:26*flynn joined #nim
17:27:54*Gustavo6046 joined #nim
17:33:02*flynn quit (Read error: Connection reset by peer)
17:34:15*flynn joined #nim
17:35:47FromDiscord<Yardanico> New thread by LLN13: Optimize parsing large file line-by-line, see https://forum.nim-lang.org/t/9115
17:35:53FromDiscord<Yardanico> (post was moderated so bot missed it :P)
17:39:19FromDiscord<codic> ``
17:39:33FromDiscord<codic> sent a code paste, see https://play.nim-lang.org/#ix=3Vsy
17:39:47FromDiscord<codic> why can't I cast evMasks to ptr XIEventMask? the compiler spits out an error
17:39:54FromDiscord<codic> ("expression cannot be cast to ptr XIEventMask")
17:39:58FromDiscord<Yardanico> because that's not the correct way of taking an address of an array value
17:40:02FromDiscord<codic> oh
17:40:03FromDiscord<Yardanico> you should use` addr evMasks[0]`
17:40:17FromDiscord<codic> yeah never mind im just dumb
17:40:29FromDiscord<codic> thanks!
17:40:35*flynn quit (Read error: Connection reset by peer)
17:40:38FromDiscord<Yardanico> In reply to @m4ul3r "I'm just wanting to": if you misunderstood, Solitude first told you that your code doesn't work because `when` does NOT create a new scope
17:40:51FromDiscord<Yardanico> so instead of using `when` you can declare a main procedure:
17:41:10FromDiscord<Yardanico> sent a code paste, see https://play.nim-lang.org/#ix=3Vsz
17:41:27FromDiscord<Yardanico> but shadowing global variables is still a bit wrong, although not that big of a deal
17:41:48*flynn joined #nim
17:43:21FromDiscord<m4ul3r> In reply to @Yardanico "if you misunderstood, Solitude": Thanks, this makes it more clear!
17:43:55FromDiscord<Yardanico> and generally usage of `when isMainModule` is kind of limited
17:44:05FromDiscord<Yardanico> the only intended usage if you want to have the same file as both a library and an application
17:44:24FromDiscord<Yardanico> and depending if you compile that file as the main module or not, it'll compile code inside `when isMainModule`
17:44:42FromDiscord<Yardanico> so if you only intend to it as your main application file, `when isMainModule` isn't needed
17:45:00FromDiscord<m4ul3r> I come from python, so i'm under the impression that is similar to `if name == "main":`
17:45:18FromDiscord<Yardanico> well, it is kind of, but it's compile-time only, so doesn't make much sense to use it
17:45:23FromDiscord<Yardanico> and generally it's not that big of an idiom in Nim
17:45:29FromDiscord<Yardanico> most apps/libs don't use it
17:46:45*flynn quit (Read error: Connection reset by peer)
17:47:58*flynn joined #nim
17:49:51FromDiscord<codic> sent a code paste, see https://play.nim-lang.org/#ix=3VsA
17:50:07FromDiscord<Yardanico> `evMasks[0].mask = cast[ptr cuchar](maskBytes) # ptr uint8 won't work here :(` this is wrong as well
17:50:12FromDiscord<Yardanico> addr maskBytes[0]
17:50:24FromDiscord<codic> damnit lol
17:50:30FromDiscord<Yardanico> you're casting the array _itself_ to the pointer type, you're not getting an address
17:50:44FromDiscord<Yardanico> also you don't need `cast[ptr XIEventMask](addr evMasks[0]),` cast here
17:50:48FromDiscord<Yardanico> just `addr evMasks[0]` will work
17:50:55FromDiscord<codic> i get it, I just always forget to do it
17:54:30*flynn quit (Read error: Connection reset by peer)
17:55:42*flynn joined #nim
17:58:42FromDiscord<ShalokShalom> So far as I can tell, only the documentation overview page is part of the repo. Tutorials and a ton of other stuff is not open source?
17:58:43FromDiscord<ShalokShalom> https://github.com/nim-lang/website/tree/master/jekyll
18:01:04FromDiscord<Solitude> tutorials and all the other stuff is right in the nim repo
18:01:14FromDiscord<ShalokShalom> Like, of the compiler?
18:01:19FromDiscord<Solitude> yes
18:02:37*flynn quit (Read error: Connection reset by peer)
18:03:50*flynn joined #nim
18:10:36*flynn quit (Read error: Connection reset by peer)
18:11:50*flynn joined #nim
18:17:51*flynn quit (Read error: Connection reset by peer)
18:19:03*flynn joined #nim
18:24:50*flynn quit (Read error: Connection reset by peer)
18:24:52*audiophile_ joined #nim
18:26:03*flynn joined #nim
18:29:29*audiophile_ quit (Client Quit)
18:29:46*jmdaemon joined #nim
18:30:30PMunch@ShalokShalom, they should all be open source, any tutorial in particular you are looking for?
18:31:14*flynn quit (Read error: Connection reset by peer)
18:32:07FromDiscord<Yardanico> In reply to @ShalokShalom "Like, of the compiler?": it's not just the compiler, nim is more or less a "monorepo"
18:32:17FromDiscord<Yardanico> all docs (even the ones that are separate .rst files), stdlib, compiler, tests are in the same repo
18:32:27*flynn joined #nim
18:34:06FromDiscord<ShalokShalom> Thanks all, I already found it
18:34:37FromDiscord<ShalokShalom> Basicially, the website is in the website repo, unless that part that is not
18:34:42FromDiscord<ShalokShalom> That is in the monorepo.
18:34:58FromDiscord<Yardanico> the website is in the separate repo, yes (the blog and landing basically)
18:35:02FromDiscord<Yardanico> actual docs are in the monorepo
18:35:42FromDiscord<ShalokShalom> I guess it would make sense to mention on the website repo, that the docs are in the nim repo.
18:35:49FromDiscord<ShalokShalom> So people dont look for it where it isnt.
18:37:18FromDiscord<ShalokShalom> I really love that quote at the beginning of the second part of the tutorial: ↵"Repetition renders the ridiculous reasonable." -- Norman Wildberger"
18:37:41FromDiscord<ShalokShalom> It`s kinda self-ironic. 😆
18:37:42FromDiscord<Solitude> which doc source you were looking for?
18:37:47FromDiscord<ShalokShalom> All them.
18:37:54FromDiscord<Solitude> most pages i look have source link at top
18:37:59FromDiscord<ShalokShalom> I download them and try to reorganize them
18:38:01FromDiscord<Solitude> https://media.discordapp.net/attachments/371759389889003532/965682631171796992/unknown.png
18:38:09*flynn quit (Read error: Connection reset by peer)
18:38:11FromDiscord<ShalokShalom> Yes, good call.
18:38:19FromDiscord<ShalokShalom> I started from the documentation landing page
18:38:28FromDiscord<ShalokShalom> Thats why I landed at the /website repo
18:39:21*flynn joined #nim
18:40:14FromDiscord<Yardanico> btw @ShalokShalom i know you've been around on this server for almost 2 years, have you made anything in nim yet? i'm just curious
18:45:13*flynn quit (Read error: Connection reset by peer)
18:46:25FromDiscord<Solitude> In reply to @Yardanico "btw <@208199869301522432> i know": thats codeshaming and its very insensitive, check chat rules number 23.2
18:46:26*flynn joined #nim
18:46:35FromDiscord<Yardanico> i'm sowwy
18:48:20FromDiscord<ShalokShalom> Its fine.
18:48:51FromDiscord<ShalokShalom> I had been on this server for 2 years, while most of the time not following.
18:49:08FromDiscord<Yardanico> it's just kind of weird that you've talked about nim and docs multiple times, but then just disappeared :P
18:49:15FromDiscord<ShalokShalom> In those years, I ported a small part of a code, that I love to port, whenever I find a language that interests me.
18:49:21FromDiscord<ShalokShalom> Otherwise not, no. 🙂
18:49:41FromDiscord<Yardanico> because IMO it's easier to follow docs and stuff if you're actually writing some project in the language
18:49:47FromDiscord<Yardanico> not just reading docs for the sake of docs
18:49:50FromDiscord<ShalokShalom> In reply to @Yardanico "it's just kind of": I dont want to invest too much time into projects, that I leave then anyway again.
18:50:14FromDiscord<ShalokShalom> In reply to @Yardanico "because IMO it's easier": Well, its a bit of a chicken and hen problem, here.
18:50:34FromDiscord<Yardanico> and generally it's much easier to learn the language if you already want to write something practical in it
18:50:38FromDiscord<Yardanico> be it some simple CLI tool or a bot
18:50:40FromDiscord<ShalokShalom> I read docs for the sake of understanding.
18:51:02FromDiscord<Yardanico> but the docs are meant to be used when you're writing Nim code as well, so you can understand the differences
18:51:03FromDiscord<ShalokShalom> In reply to @Yardanico "and generally it's much": I am a newbie to programming in general.
18:51:04FromDiscord<sOkam!> sent a code paste, see https://play.nim-lang.org/#ix=3VsO
18:51:09FromDiscord<Yardanico> In reply to @sOkam! "Is there another way": just use 'u32 for the first element
18:51:14FromDiscord<Yardanico> other elements will then be 'u32 as well implicitly
18:51:28FromDiscord<Solitude> the hell you need understanding for if you're not writing anything. manual is not a bible (it is).
18:51:43FromDiscord<sOkam!> In reply to @Yardanico "just use 'u32 for": can i signal it in some other way out of the numbers?
18:51:53FromDiscord<ShalokShalom> I am writing something, once I understand.
18:52:20FromDiscord<Yardanico> In reply to @ShalokShalom "I am writing something,": IMO the bare basics of nim are easy to grasp, and then you can just "follow the flow" and learn the more advanced concepts as you need them
18:52:23FromDiscord<ShalokShalom> Issue is, some languages use certain terms in very different ways. Particularly Nim, if I may say so
18:52:34FromDiscord<ShalokShalom> In reply to @Yardanico "IMO the bare basics": Everybody says so.
18:52:53FromDiscord<Yardanico> have you seen https://narimiran.github.io/nim-basics/ ?
18:52:58FromDiscord<ShalokShalom> If it would be that easy, programing would be far more accessible to the public.
18:53:01FromDiscord<ShalokShalom> Yep
18:53:03FromDiscord<ShalokShalom> Its good.
18:53:11FromDiscord<Solitude> and programming isnt?
18:53:11FromDiscord<Yardanico> I'm speaking from my experience as I learned Nim by writing a simple social network bot
18:53:17FromDiscord<Yardanico> with previous python experience
18:53:30*flynn quit (Read error: Connection reset by peer)
18:53:33FromDiscord<Yardanico> yes docs don't cover everything, but that's why the forum and this server (irc/etc) exist
18:53:36FromDiscord<Solitude> programming is probably the most accessible craft there is
18:53:56FromDiscord<Yardanico> In reply to @sOkam! "can i signal it": don't think so, maybe with a macro or a template
18:53:56FromDiscord<ShalokShalom> For the sake of the topic: I can simply port these lines of fsharp with let bindings in Nim, yes? https://github.com/ShalokShalom/fsharp-nim/blob/master/dev-aspect.nim#L65=
18:53:58FromDiscord<sOkam!> In reply to @ShalokShalom "I am writing something,": the best way to start is to write exercises when following a tutorial. its boring, but its really useful↵and then, you will slowly start to see what you could do with what you have learned
18:54:22FromDiscord<ShalokShalom> I am on it.
18:54:35FromDiscord<ShalokShalom> In reply to @Solitude "programming is probably the": Physically.
18:54:42*flynn joined #nim
18:54:47FromDiscord<Solitude> anythinglly
18:54:50FromDiscord<sOkam!> but learning programming without writing (even if you are just writing the tutorial like a parrot) its very unlikely to happen
18:54:51FromDiscord<ShalokShalom> And for some people, who are of a specific studing type.
18:55:03FromDiscord<Yardanico> In reply to @sOkam! "but learning programming without": exactly
18:55:04FromDiscord<ShalokShalom> In reply to @sOkam! "but learning programming without": I am not doing that.
18:55:08FromDiscord<Solitude> In reply to @ShalokShalom "And for some people,": thats gigacope, everyone can learn, people just make excuses
18:55:29FromDiscord<ShalokShalom> Its about specific approaches
18:55:32FromDiscord<Yardanico> In reply to @ShalokShalom "For the sake of": yes https://nim-lang.org/docs/tut1.html#advanced-types-objects
18:55:37FromDiscord<ShalokShalom> Like, there are visual learners, etc
18:55:42FromDiscord<Solitude> In reply to @ShalokShalom "Like, there are visual": there are not
18:55:56FromDiscord<ShalokShalom> Well, thats well documented in social studies.
18:56:00FromDiscord<sOkam!> In reply to @Solitude "there are not": hey, i am 🙂
18:56:01FromDiscord<Solitude> In reply to @ShalokShalom "Like, there are visual": no, its not
18:56:38FromDiscord<Solitude> not a single actual study has concerete conclusions about visual/pissual leaners. thats borderline astrology.
18:56:54FromDiscord<sOkam!> 🤷‍♂️
18:56:59FromDiscord<ShalokShalom> I assume I could even use const
18:59:59*flynn quit (Read error: Connection reset by peer)
19:01:12*flynn joined #nim
19:02:28FromDiscord<0ffh> Any trick to quickly reset the values in a preallocated sequence (thinge memset), or do I have to stick with a loop?
19:02:44FromDiscord<0ffh> (edit) "(thinge" => "(think"
19:03:59FromDiscord<Solitude> i think if you setLen 0 then setLen previous length, sequence gets zeroed, but i would just loop
19:04:16FromDiscord<Yardanico> yeah sol is right there
19:04:31FromDiscord<Yardanico> for efficiency use setLen, for easy-to-readiness use a loop
19:04:32FromDiscord<Solitude> or apply(reset) from sequtils
19:04:38FromDiscord<Yardanico> a C compiler should probably optimize it well enough
19:04:49FromDiscord<Yardanico> Clueless
19:06:00*flynn quit (Read error: Connection reset by peer)
19:06:37FromDiscord<0ffh> Okay, I think I'll time it and see if there's a measurable difference. Thanks!
19:06:54FromDiscord<Solitude> In reply to @Yardanico "for efficiency use setLen,": i dont think it would be more efficient. unless compiler optimises zeroing of non-ref values.
19:07:12*flynn joined #nim
19:07:53FromDiscord<Ayy Lmao> Is there a way to do something like `import foo except ` ?
19:08:25FromDiscord<Yardanico> you mean import a module so you can only refer to symbols by the module name?
19:08:33FromDiscord<Ayy Lmao> In reply to @Yardanico "you mean import a": Yeah
19:08:34FromDiscord<Yardanico> that's `from foo import nil`
19:08:41FromDiscord<Yardanico> but don't forget that some nim features won't work with this
19:08:50FromDiscord<Yardanico> like operators, UFCS and similar
19:08:57FromDiscord<Yardanico> (edit) "but don't forget that some nim features won't work ... with" added "well"
19:09:16FromDiscord<Yardanico> In reply to @Solitude "i dont think it": yeah you're right, nimZeroMem is also a loop in the end
19:09:27FromDiscord<Yardanico> ah actually no
19:09:34FromDiscord<Yardanico> with useLibC which is the default nim just calls C's `memset`
19:09:41FromDiscord<Ayy Lmao> Cool, thanks! Yeah I didn't think about operators and such. Maybe it's best to stick with explicit excluding of symbols.
19:14:46*flynn quit (Read error: Connection reset by peer)
19:15:41*ehmry quit (Remote host closed the connection)
19:15:58*flynn joined #nim
19:16:58*ehmry joined #nim
19:17:56*fallback joined #nim
19:20:50*flynn quit (Read error: Connection reset by peer)
19:21:28FromDiscord<ShalokShalom> In reply to @Yardanico "yes https://nim-lang.org/docs/tut1.html#advanced-ty": But how would I do the nesting? Just indenting and another let?
19:21:47FromDiscord<Yardanico> MyObject(myfield: MyOtherObject(myotherfield: 1))
19:21:51FromDiscord<Yardanico> and you can indent this
19:22:02FromDiscord<ShalokShalom> like, when describing the type of a type
19:22:03*flynn joined #nim
19:22:27FromDiscord<ShalokShalom> So all in one line (ugs) or indenting
19:22:30FromDiscord<ShalokShalom> Roger
19:28:12*flynn quit (Read error: Connection reset by peer)
19:29:24*flynn joined #nim
19:34:10*flynn quit (Read error: Connection reset by peer)
19:35:22*flynn joined #nim
19:40:18*flynn quit (Read error: Connection reset by peer)
19:41:31*flynn joined #nim
19:47:02*flynn quit (Read error: Connection reset by peer)
19:48:15*flynn joined #nim
19:52:42*flynn quit (Read error: Connection reset by peer)
19:53:54*flynn joined #nim
20:00:42*flynn quit (Read error: Connection reset by peer)
20:01:55*flynn joined #nim
20:05:16*flynn quit (Read error: Connection reset by peer)
20:06:29*flynn joined #nim
20:07:41*PMunch quit (Quit: leaving)
20:08:08*PMunch joined #nim
20:10:13*PMunch quit (Client Quit)
20:12:12*flynn quit (Read error: Connection reset by peer)
20:13:26*flynn joined #nim
20:19:58*flynn quit (Read error: Connection reset by peer)
20:21:00FromDiscord<creikey> is std/coro used anywhere?
20:21:12*flynn joined #nim
20:23:12*drewr joined #nim
20:26:44*flynn quit (Read error: Connection reset by peer)
20:27:27*vicecea quit (Remote host closed the connection)
20:27:57*flynn joined #nim
20:27:58*vicecea joined #nim
20:32:59*fredrikhr quit (Ping timeout: 240 seconds)
20:34:17*flynn quit (Read error: Connection reset by peer)
20:35:31*flynn joined #nim
20:40:40*flynn quit (Read error: Connection reset by peer)
20:41:53*flynn joined #nim
20:48:14*flynn quit (Read error: Connection reset by peer)
20:49:26*flynn joined #nim
20:54:06*flynn quit (Read error: Connection reset by peer)
20:55:19*flynn joined #nim
21:00:44*flynn quit (Read error: Connection reset by peer)
21:01:57*flynn joined #nim
21:07:41*flynn quit (Read error: Connection reset by peer)
21:08:54*flynn joined #nim
21:14:17*flynn quit (Read error: Connection reset by peer)
21:15:30*flynn joined #nim
21:20:20*flynn quit (Read error: Connection reset by peer)
21:21:33*flynn joined #nim
21:25:40*flynn quit (Read error: Connection reset by peer)
21:26:52*flynn joined #nim
21:34:27*flynn quit (Read error: Connection reset by peer)
21:35:40*flynn joined #nim
21:41:46*flynn quit (Read error: Connection reset by peer)
21:42:10NimEventerNew thread by Krakengore: Binding a closure to a std::function to call it from C++... safe to do ?, see https://forum.nim-lang.org/t/9116
21:42:59*flynn joined #nim
21:49:10*flynn quit (Read error: Connection reset by peer)
21:50:23*flynn joined #nim
21:55:27*flynn quit (Read error: Connection reset by peer)
21:56:39*flynn joined #nim
22:05:46*flynn quit (Read error: Connection reset by peer)
22:07:00*flynn joined #nim
22:09:37FromDiscord<!Patitotective> hey @Rika how are you doing with the callbacks cursed code? :)
22:13:20*flynn quit (Read error: Connection reset by peer)
22:14:32*flynn joined #nim
22:19:58*flynn quit (Read error: Connection reset by peer)
22:21:11*flynn joined #nim
22:27:34*flynn quit (Read error: Connection reset by peer)
22:28:46*flynn joined #nim
22:34:44*flynn quit (Read error: Connection reset by peer)
22:35:57*flynn joined #nim
22:42:06*flynn quit (Read error: Connection reset by peer)
22:42:11*jjido quit (Quit: My MacBook Air has gone to sleep. ZZZzzz…)
22:43:18*flynn joined #nim
22:48:37*flynn quit (Read error: Connection reset by peer)
22:49:50*flynn joined #nim
22:54:35FromDiscord<Yardanico> Does anyone use Kate for Nim? I'm curious how usable it is, especially with nimlsp
22:54:48FromDiscord<Elegantbeef> It's pretty good
22:55:58*flynn quit (Read error: Connection reset by peer)
22:57:11*flynn joined #nim
23:02:49*neceve quit (Ping timeout: 246 seconds)
23:05:17*flynn quit (Read error: Connection reset by peer)
23:06:31*flynn joined #nim
23:12:08*flynn quit (Read error: Connection reset by peer)
23:13:05*xet7 quit (Remote host closed the connection)
23:13:21*flynn joined #nim
23:13:27*Zectbumo joined #nim
23:18:36*flynn quit (Read error: Connection reset by peer)
23:19:48*flynn joined #nim
23:22:18FromDiscord<Yardanico> In reply to @Elegantbeef "It's pretty good": what color theme? :)
23:23:05FromDiscord<Elegantbeef> arc ark for the window and ayu-mirage for editor
23:23:12FromDiscord<Elegantbeef> image.png https://media.discordapp.net/attachments/371759389889003532/965754402600267856/image.png
23:23:19FromDiscord<Yardanico> oh nice
23:23:20FromDiscord<Elegantbeef> arc-dark\
23:23:30FromDiscord<Yardanico> i've been checking how style colors are made for nim in kate and it's kind of weird
23:24:57FromDiscord<Yardanico> for example, why is `result` stylized according to the "Other" style in Nim highlighting
23:25:12*flynn quit (Remote host closed the connection)
23:25:13FromDiscord<Yardanico> not "Normal text" like all other variables, but "Other" specifically
23:25:18FromDiscord<Yardanico> Others
23:26:26*flynn joined #nim
23:26:29FromDiscord<Elegantbeef> No clue i dont care that much for colouring as long as it's not a single colour
23:26:33FromDiscord<Yardanico> heh
23:26:59FromDiscord<Yardanico> the Nim highlighting in Kate takes colors from the global color them really weirdly
23:27:41FromDiscord<Yardanico> e.g. it takes color for String from the global config (sic!) and uses it for ProcDefs
23:27:49FromDiscord<Yardanico> ProcDefs being name of procedures/functions
23:28:16FromDiscord<exelotl> hmm, is it really not possible to have a proc or template that takes a static int as a generic parameter? https://play.nim-lang.org/#ix=3Vu7
23:28:50FromDiscord<Yardanico> "T: SomeInteger" means the value itself, not the type
23:29:01FromDiscord<Yardanico> or the type itself, hmm
23:32:29*flynn quit (Read error: Connection reset by peer)
23:32:30FromDiscord<Elegantbeef> Yea i dont think it's possible to take it as a generic parameter
23:33:11FromDiscord<exelotl> hmm, simplified example: https://play.nim-lang.org/#ix=3Vu9
23:33:20FromDiscord<exelotl> it does work if you change it to `proc`
23:33:41*flynn joined #nim
23:36:56FromDiscord<Elegantbeef> I think that makes sense
23:36:57FromDiscord<Elegantbeef> Templates cannot specialize on generic values, cause they dont run any code
23:36:57FromDiscord<Elegantbeef> If you want the template to have a static parameter you include it in the parameter list
23:38:23FromDiscord<Elegantbeef> sent a code paste, see https://play.nim-lang.org/#ix=3Vua
23:39:58*flynn quit (Read error: Connection reset by peer)
23:41:10*flynn joined #nim
23:43:12FromDiscord<exelotl> :(
23:43:44FromDiscord<Elegantbeef> Unless you want to fix static variable binding
23:44:05FromDiscord<exelotl> I don't 😅
23:44:33FromDiscord<exelotl> but my API does kinda suck if the operations can't have the same generic signature as the type
23:45:58*noeontheend joined #nim
23:46:32FromDiscord<Elegantbeef> Seems when you mix `static` and non static generic parameters it only binds by type
23:46:49*flynn quit (Read error: Connection reset by peer)
23:47:07FromDiscord<Elegantbeef> Guess i'll take a look, as i'm presently sick it's more ideal than working on anything else 😛
23:48:01*flynn joined #nim
23:49:45FromDiscord<exelotl> sent a code paste, see https://play.nim-lang.org/#ix=3Vuc
23:50:02FromDiscord<exelotl> Error: cannot instantiate: 'Fixed[T: SomeInteger, N]'; Maybe generic arguments are missing?
23:50:12FromDiscord<Elegantbeef> replace end with `auto`
23:50:21FromDiscord<exelotl> ohh
23:51:11FromDiscord<exelotl> nope
23:52:00FromDiscord<huantian> maybe cus T isn't static?
23:52:51FromDiscord<Elegantbeef> sent a code paste, see https://play.nim-lang.org/#ix=3Vud
23:53:16*flynn quit (Read error: Connection reset by peer)
23:54:29*flynn joined #nim
23:57:12FromDiscord<exelotl> ugh
23:57:13FromDiscord<exelotl> https://play.nim-lang.org/#ix=3Vuf
23:57:21FromDiscord<exelotl> doc comment was fucking things up xD
23:58:20FromDiscord<exelotl> this is super jank
23:58:30FromDiscord<exelotl> if you delete line 37 it crashes the playground
23:58:56FromDiscord<Elegantbeef> nice