<< 29-08-2022 >>

00:35:01FromDiscord<lamersc> What’s happened with this month in nim?
00:35:14FromDiscord<lamersc> (edit) "What’s" => "What"
00:35:42FromDiscord<Elegantbeef> It still exists
00:44:54*wallabra joined #nim
00:51:11FromDiscord<shoot_in_foot()> In reply to @@adrianperreault-58ab7b11d73408c "Have you heard about": 🤓
00:59:27FromDiscord<Bung> alloc0 type A (only one ptr field) while assign that field to type B addr is fine ?
01:06:56FromDiscord<sealmove> In reply to @lamersc "What happened with this": I made an sdk for spin :D (webassembly backend framework)
01:08:25FromDiscord<sealmove> ;o how can i add it in the next such article? https://nim-lang.org/blog/2022/06/01/this-month-with-nim.html
01:11:14FromDiscord<Elegantbeef> https://github.com/beef331/website/issues/new?assignees=beef331&labels=&template=this-month-with-nim.md&title=
01:15:03*wallabra quit (Ping timeout: 252 seconds)
01:34:45*wallabra joined #nim
01:37:05*rockcavera joined #nim
01:37:05*rockcavera quit (Changing host)
01:37:05*rockcavera joined #nim
01:41:04*wallabra_ joined #nim
01:42:46*wallabra quit (Ping timeout: 260 seconds)
01:42:52*wallabra_ is now known as wallabra
01:50:47FromDiscord<sealmove> oh thanks
01:55:02FromDiscord<sealmove> so they are submitted in your fork
01:58:29FromDiscord<sealmove> when is the next month? :D
02:00:10FromDiscord<Elegantbeef> I'm not astronomer but september is the next month
02:08:04FromDiscord<Rika> lmao
02:08:38*derpydoo joined #nim
02:15:55FromDiscord<ravinder387> In reply to @Elegantbeef "I'm not astronomer but": 👍
02:20:59FromDiscord<Shiba> In reply to @Elegantbeef "I'm not astronomer but": september🎵
02:27:28*wallabra quit (Ping timeout: 268 seconds)
02:29:55*arkurious quit (Quit: Leaving)
03:02:15*wallabra joined #nim
03:10:07FromDiscord<!Patitotective> In reply to @Elegantbeef "I'm not astronomer but": I'm not an oculist but you wrote two spaces
03:10:13FromDiscord<!Patitotective> my bad, thats canadian english
03:39:36FromDiscord<chmod> is nim reliable under heavy load like golang is? I would prefer using nim even at the cost of a lack of libraries I need, but I don't have a method of gauging nim's reliability at scale with lots of concurrency alongside heavy CPU usage, since go "solves" that question entirely with goroutines
03:57:29*kenran joined #nim
03:58:12*kenran quit (Client Quit)
04:01:08*jmdaemon joined #nim
04:02:28*jmdaemon quit (Remote host closed the connection)
04:16:27*jmdaemon joined #nim
05:05:09FromDiscord<tandy> is it posible to have a linebreak in a nimble file's `exec` string?
05:05:29FromDiscord<Elegantbeef> It should run directly in your shell so if it's allowed in your shell sure
05:05:54FromDiscord<tandy> ah i just needed """
05:08:26*rockcavera quit (Ping timeout: 268 seconds)
05:46:35*rockcavera joined #nim
05:46:36*rockcavera quit (Changing host)
05:46:36*rockcavera joined #nim
05:57:32NimEventerNew Nimble package! brightcove - Brightcove player parser, see https://github.com/thisago/brightcove
06:00:46FromDiscord<tandy> sent a code paste, see https://play.nim-lang.org/#ix=48ZR
06:01:23FromDiscord<tandy> so these two error messages are referencing the same cstring parameter which shouldnt be changing, so how the heck is this happening?
06:02:10FromDiscord<Elegantbeef> Incorrect code?
06:02:29FromDiscord<tandy> yes probably
06:02:42FromDiscord<tandy> i was hoping for some epic async bug
06:02:50FromDiscord<j-james> In reply to @Patitotective "my bad, thats canadian": damn lmao
06:03:07*rockcavera quit (Remote host closed the connection)
06:04:33FromDiscord<tandy> ok so the print issue was a lack of brackets aroudn ` logError "There was a problem getting " & $username & "'s listens!"`
06:06:25FromDiscord<tandy> huh every now and then it doesnt print correctly tho
06:15:00FromDiscord<tandy> hmm i think this is a cstring bug
06:15:54FromDiscord<tandy> wait no it was cos a func shouldve been a proc
06:38:34*PMunch joined #nim
06:45:36NimEventerNew Nimble package! pricecsv - Easily calculate the total of all products in csv, see https://github.com/thisago/pricecsv
06:45:36NimEventerNew Nimble package! studiobacklottv - Studio Backlot TV video extractor, see https://github.com/thisago/studiobacklottv
06:50:27PMunchWhat an oddly specific package :P
07:03:47NimEventerNew question by LingC: .exe has stopped working when use thread module, see https://stackoverflow.com/questions/73525170/exe-has-stopped-working-when-use-thread-module
07:04:04FromDiscord<Nalmyth> Is there some way to understand which filename a `type` was created inside?
07:04:26FromDiscord<Nalmyth> Like `typeof(T)` `sizeof(T)` `moduleof(T)`?
07:04:34FromDiscord<Nalmyth> (edit) "Like `typeof(T)` `sizeof(T)` ... `moduleof(T)`?" added " -->"
07:05:54FromDiscord<Elegantbeef> There's nothing in the stdlib that does that but you can make macro that gets the owner of a symbol
07:06:36FromDiscord<Nalmyth> In reply to @Elegantbeef "There's nothing in the": Hmm, how would I go about doing that?
07:08:33FromDiscord<Elegantbeef> sent a code paste, see https://play.nim-lang.org/#ix=4901
07:08:51FromDiscord<Elegantbeef> Though that doesnt work on generics
07:09:49FromDiscord<Nalmyth> sent a code paste, see https://play.nim-lang.org/#ix=4902
07:10:36PMunch(Not sure if you're actually sharing playground links or if that is just the bridge. But the filename of the playground input is `in.nim` so `in` would be the module name.
07:10:37PMunch)
07:11:30FromDiscord<Elegantbeef> Just the bridge
07:11:48FromDiscord<Nalmyth> I submitted a feature request for this also:↵↵https://github.com/nim-lang/Nim/issues/20282
07:12:16FromDiscord<Elegantbeef> Should probably be `newLit($owner)` probably
07:13:56FromDiscord<Nalmyth> Seems that gives me the same result as `instantiationInfo(-2)` 🤔
07:14:15FromDiscord<Nalmyth> Although perhaps that's the correct result for creation of the symbol
07:14:19FromDiscord<Elegantbeef> Are you after the path?
07:14:29FromDiscord<Elegantbeef> It returns the module name
07:15:22FromDiscord<Nalmyth> sent a long message, see http://ix.io/4903
07:15:50FromDiscord<Elegantbeef> You're doing `moduleOf` on a variable
07:16:09FromDiscord<Nalmyth> Actually on a type 🤔
07:16:23FromDiscord<Nalmyth> sent a code paste, see https://play.nim-lang.org/#ix=4905
07:16:41FromDiscord<Nalmyth> (edit) "https://play.nim-lang.org/#ix=4905" => "https://paste.rs/PX2"
07:18:20FromDiscord<Elegantbeef> It should return the module the type is from if you import them
07:19:01FromDiscord<Elegantbeef> Yea just tested it returns it properly
07:19:08FromDiscord<Nalmyth> Oh I will try to import
07:19:19FromDiscord<Elegantbeef> Were you including?\>
07:19:40FromDiscord<Elegantbeef> Never include
07:22:10FromDiscord<Nalmyth> No I was not including or importing in that file
07:22:17FromDiscord<Nalmyth> (edit) "not" => "neither"
07:22:20FromDiscord<Nalmyth> (edit) "or" => "nor"
07:22:34FromDiscord<Nalmyth> And seems it's hard to import the type files as now I have a recursive dependency 😢
07:38:31FromDiscord<sealmove> morning!
07:38:32*PMunch quit (Quit: Leaving)
07:38:51FromDiscord<aruZeta> Morning
07:39:09*PMunch joined #nim
07:39:28*PMunch quit (Client Quit)
07:40:20*PMunch joined #nim
07:44:16*jmdaemon quit (Quit: ZNC 1.8.2 - https://znc.in)
07:44:19FromDiscord<sealmove> @Forest I forgot to ask you: Do you have a public repo for the jvm stuff you're doing?
07:49:13*jmdaemon joined #nim
07:49:53FromDiscord<aruZeta> In reply to @รєคɭ๓๏שє "<@909883978717204561> I forgot to": https://github.com/Mythical-Forest-Collective/CodeGenLib
07:52:49FromDiscord<sealmove> "mythical forest collective" :DDD
07:52:55*jmdaemon quit (Client Quit)
07:55:12*jmdaemon joined #nim
07:57:08PMunchHmm, is the developer of taskopen in here?
07:57:31FromDiscord<Elegantbeef> Oh pmunch did you see my futhark issue, clang is doing a dumb 😄
07:57:50PMunchYeah I saw that one, but I was too tired to reply to it :P
07:59:36PMunchThat varargs thing was just in order to make macros executable. Basically a catch-all for "I don't know what the types of this is supposed to be, but I'll let you add arguments and pass them on to C for you"
08:02:29FromDiscord<Elegantbeef> Sure but isnt clang the issue?
08:03:26PMunchIt seems to be a bug yeah
08:03:51PMunchI'm not even sure why it comes into the macro code..
08:05:48FromDiscord<Elegantbeef> It just gets marked for is variadic and ruins the generated Nim
08:06:39FromDiscord<Elegantbeef> Would have just worked around it but yea i dont get what to do here, present idea is to emit a C file with the removed `own`
08:07:24PMunchWhat is `own` supposed to do anyways?
08:07:40FromDiscord<Elegantbeef> It's just a semantic for the code to document who owns the data
08:07:49FromDiscord<Elegantbeef> So it does nothing
08:08:29PMunchYou could also include a step to fiddle with the JSON file :P
08:15:56FromDiscord<sealmove> In reply to @aruZeta "https://github.com/Mythical-Forest-Collective/CodeG": I thought it was nim -> jvm bytecode, but this seems to be textual compilation? is this gonna work?
08:20:05FromDiscord<aru> ¯\\\_(ツ)\_/¯
08:20:46FromDiscord<aru> ig it's writing the actual .java file
08:23:06FromDiscord<sealmove> btw has nim -> jvm been attempted at all?
08:24:44FromDiscord<aru> hmm, idk
08:25:08PMunch@sealmove, not as a translation I don't think
08:25:22PMunchBut it's been achieved through a native bridge
08:26:39FromDiscord<ravinder387> In reply to @รєคɭ๓๏שє "btw has nim ->": what's your opinion on nim programming
08:28:23FromDiscord<sealmove> In reply to @PMunch "But it's been achieved": oh more details please!
08:29:02FromDiscord<sealmove> In reply to @ravinder387 "what's your opinion on": ? random question xD my opinion... I f#$king love it
08:29:47FromDiscord<sealmove> it looks like the only sane language to me
08:31:25PMunch@sealmove, stuff like this: https://github.com/GordonBGood/NimHelloJNI
08:32:54FromDiscord<sealmove> ah ok but this is android-specific, it's not nim for the jvm right?
08:33:24FromDiscord<sealmove> i mean you can write android apps in c++
08:34:30FromDiscord<sealmove> (edit) "ah" => "~~ah" | "right?" => "right?~~"
08:34:39FromDiscord<sealmove> I see, thanks PMunch
08:37:08FromDiscord<sealmove> Guys if you were making types for http (headers, body etc) would you use `Option` for the fields (or some of them)? I can't decide.
08:40:07*derpydoo quit (Quit: derpydoo)
08:41:28PMunchWell, I wouldn't make new ones, I'd just use those in the stdlib :P
08:41:58FromDiscord<sealmove> it doesn't have xD
08:42:44FromDiscord<sealmove> request details are embedded in the `HttpClient` type, and then you call `request` on it, that's the stdlib api
08:44:36FromDiscord<sealmove> sent a code paste, see https://play.nim-lang.org/#ix=490s
08:44:49PMunchAh.. Right..
08:49:50FromDiscord<sealmove> is there a document that keeps track of which types are initialized automatically?
08:50:03FromDiscord<Elegantbeef> All are intialised to 0
08:50:06NimEventerNew question by Alex Gustafson: c struct instantiation in c2nim wrapper, see https://stackoverflow.com/questions/73526255/c-struct-instantiation-in-c2nim-wrapper
08:51:09*jmdaemon quit (Quit: ZNC 1.8.2 - https://znc.in)
08:51:25FromDiscord<sealmove> sent a code paste, see https://play.nim-lang.org/#ix=490y
08:51:37FromDiscord<sealmove> it's a tableref
08:51:39FromDiscord<Elegantbeef> is `HttpHeaders` a value type or reference type
08:51:56FromDiscord<sealmove> ref
08:51:57FromDiscord<Elegantbeef> If it's a reference type you need to allocate the reference as 0 init'd pointer is nil
08:52:06FromDiscord<sealmove> ohhh
08:52:15FromDiscord<sealmove> thanks! very insightful
09:04:00FromDiscord<sealmove> hmm i see `system` does define operators for pointer arithmetic, is there any module that has it?
09:04:32FromDiscord<Elegantbeef> No generally you use `ptr UncheckedArray`, there is an external package though
09:05:29FromDiscord<sealmove> how do you move the ptr say x bytes?
09:06:19FromDiscord<Elegantbeef> `cast[ptr UncheckedArray[byte]](myPtr)[x]`
09:06:36FromDiscord<Elegantbeef> You can just use the external ptr\_math though
09:06:37FromDiscord<sealmove> oh ok thanks
09:07:22FromDiscord<sealmove> if i find myself using this cast a lot then i'll consider it ty
09:14:00FromDiscord<sealmove> sent a code paste, see https://play.nim-lang.org/#ix=490J
09:29:19FromDiscord<SouperZ> any good names for a nim bootloader?
09:32:01FromDiscord<Prestige> nim_bootloader
09:32:17FromDiscord<Prestige> not great but gets the job done, lol
09:32:45FromDiscord<Rika> Noot then put a penguin as an icon
09:32:58FromDiscord<Prestige> Not bad
09:33:03FromDiscord<Rika> I’m a genius
09:33:07FromDiscord<SouperZ> In reply to @Rika "Noot then put a": this was what i was thinking
09:33:16FromDiscord<SouperZ> im gonna use "noot"
09:33:17FromDiscord<Rika> Great minds think alike
09:33:28FromDiscord<Prestige> Have him wearing the nim crown
09:33:37FromDiscord<SouperZ> hah yes
09:50:52*arkurious joined #nim
09:52:43*Vladar joined #nim
10:08:38FromDiscord<aru> not much difference between public object fields (top) and private object fields with getters/setters (bottom)
10:08:38FromDiscord<aru> image.png https://media.discordapp.net/attachments/371759389889003532/1013752027450449930/image.png
10:09:19FromDiscord<aru> guess I will use the private approach
10:11:18FromDiscord<sealmove> oh my, I have to do mmm in nim... haven't wrote these malloc calls for years T_T
10:12:16FromDiscord<sealmove> btw @aruZeta don't forget to post your qrcode generator here!↵https://github.com/beef331/website/issues/new?assignees=beef331&labels=&template=this-month-with-nim.md&title=
10:12:42FromDiscord<aru> when I finish all I have to do lol
10:12:48FromDiscord<aru> nice docs and better code in the way
10:13:14FromDiscord<aru> and more print options, only text/terminal atm
10:14:43FromDiscord<aru> though it's actually quite easy (i think) to make a custom format print procedure, since I could just make a proc which receive 2 procs, one to print a dark square, and another to print a light square
10:15:23FromDiscord<aru> svg should be easy to implement, for other formats i guess i should take a look into pixie or smth
10:15:35FromDiscord<sealmove> it doesn't have to be perfect, that's not the point of "This Month With Nim" :p
10:15:49FromDiscord<aru> hmm
10:17:18FromDiscord<aru> i will wait for next month tho, how much days left for this one? 2?
10:21:52FromDiscord<aru> sent a code paste, see https://play.nim-lang.org/#ix=4914
10:23:38FromDiscord<sealmove> sent a code paste, see https://play.nim-lang.org/#ix=4916
10:23:55FromDiscord<sealmove> In reply to @aru "i will wait for": Not sure how strict deadlines are ;p
10:24:58FromDiscord<sealmove> sent a code paste, see https://play.nim-lang.org/#ix=4917
10:25:11FromDiscord<sealmove> 2nd proc looks redundant
10:25:22FromDiscord<aru> yep, that's what I was thinking
10:27:55FromDiscord<sealmove> In reply to @รєคɭ๓๏שє "what's wrong with this": ah I am missing a cast
10:29:27FromDiscord<aru> some nice macro to generate getters / setters ?
10:36:46FromDiscord<sealmove> but they are already there for you
10:36:59FromDiscord<sealmove> (edit) "but" => "~~but" | "you" => "you~~"
10:37:25FromDiscord<sealmove> what syntax do you have in mind?
10:38:05FromDiscord<sealmove> I mean how macro-heavy
10:39:10FromDiscord<aru> just wanted a macro to write for me some `get objField1` procs
10:39:21FromDiscord<aru> nothing too special
10:40:02FromDiscord<aru> but anyway I think it's better to write them by hand, it's not like they are 200 fields, and I have some custom setters
10:41:19FromDiscord<enthus1ast> write the proc you want, then use dumpAstGen to see the ast, copy paste this to a macro and change it to your needs
10:41:40FromDiscord<enthus1ast> sent a code paste, see https://play.nim-lang.org/#ix=491c
10:41:50FromDiscord<enthus1ast> sent a code paste, see https://play.nim-lang.org/#ix=491d
10:41:55FromDiscord<aru> yh ik how to make macros
10:41:58FromDiscord<sealmove> sent a code paste, see https://play.nim-lang.org/#ix=491e
10:42:02FromDiscord<enthus1ast> aru\: kkk
10:42:26FromDiscord<aru> i asked just to see if anyone of a simple already written one
10:42:30FromDiscord<sealmove> In reply to @รєคɭ๓๏שє "I mean you could": or think of a nicer syntax, but this is an example
10:42:55FromDiscord<sealmove> hmm I've written similar thing but not exactly this
10:44:00FromDiscord<aru> yh, but I do think that it would be too much↵(@sealmove)
10:44:52FromDiscord<aru> yh, but I think it would be too much, as I said for just 3-4 fields I think I don't need it
10:45:12FromDiscord<aru> [Edit](https://discord.com/channels/371759389889003530/371759389889003532/1013760530630053948): i asked just to see if anyone knew of a simple already written one
10:49:27FromDiscord<sealmove> yeah it's definitely an overkill
10:49:28FromDiscord<aru> sry if it sounded rude
10:50:20FromDiscord<sealmove> it sounds like something very common that should've been implemented but I guess it's just not in the spirit of nim
10:50:46FromDiscord<aru> yh
10:50:50FromDiscord<sealmove> sent a code paste, see https://play.nim-lang.org/#ix=491g
10:51:52FromDiscord<Rika> Be careful with that conversion
10:52:12FromDiscord<Tanguy> sent a code paste, see https://play.nim-lang.org/#ix=491h
10:52:24FromDiscord<Rika> ?
10:52:27FromDiscord<Rika> What are you asking
10:52:31FromDiscord<Rika> If it’s valid? It’s not
10:52:46FromDiscord<Tanguy> (edit) "https://play.nim-lang.org/#ix=491h" => "https://play.nim-lang.org/#ix=491i"
10:52:55FromDiscord<sealmove> In reply to @Rika "Be careful with that": how to do string -> cstring?
10:52:58FromDiscord<Rika> Well now it is after editing, but what’s
10:53:09FromDiscord<Tanguy> Yeah I got brained by the macro thing, it's good now↵But I mean, why not use thing instead of getter / setters?
10:53:13FromDiscord<Rika> In reply to @รєคɭ๓๏שє "how to do string": Ideally you’d allocate a new c string and copy the contents
10:53:29FromDiscord<Tanguy> (edit) "thing" => "this"
10:53:30FromDiscord<Rika> If you just directly convert like that then if the string dies then you have an invalid pointer
10:53:49FromDiscord<Rika> In reply to @Tanguy "Yeah I got brained": I assume he wants to make the generation of those procs automatic
10:54:34FromDiscord<sealmove> no no I want the _correct_ way :p ok I allocate how? searching for a proc in stdlib...
10:54:49FromDiscord<Rika> Prolly a proc named new c string
10:55:05FromDiscord<Rika> Without the spaces, I just don’t want to mess up my phone’s dictionary even more
10:55:12FromDiscord<sealmove> there is no such :(
10:55:26FromDiscord<sealmove> In reply to @Rika "Without the spaces, I": hahaha fair enough
10:55:29FromDiscord<Tanguy> I mean `x[get, set]: string` == `x: string`
10:55:29FromDiscord<Rika> Really? I’m pretty sure there is
10:55:59FromDiscord<sealmove> In reply to @Tanguy "I mean `x[get, set]:": ah right
10:58:05FromDiscord<sealmove> In reply to @Rika "Really? I’m pretty sure": there isn't :s
10:58:13FromDiscord<aru> lmao↵(@Rika)
10:58:28FromDiscord<Rika> In reply to @รєคɭ๓๏שє "there isn't :s": If there is when I look imma whoop yo ass
10:58:50FromDiscord<sealmove> hahaha responsibility accepted :>
10:59:16FromDiscord<sealmove> there is `newWideCString` but not plain `newCString`
11:02:26FromDiscord<Rika> You right
11:03:04FromDiscord<Bung> just .cstring
11:03:35FromDiscord<sealmove> sent a code paste, see https://paste.rs/i3S
11:03:54FromDiscord<sealmove> ok so everything is handled magically, nice!
11:04:17FromDiscord<aru> sent a code paste, see https://play.nim-lang.org/#ix=491m
11:04:58FromDiscord<aru> oh well that would be the same as `.cstring` right?
11:05:29FromDiscord<Rika> Yes but if you use it on the right variable then the lifetime would be different
11:05:53FromDiscord<Bung> right, that's with static[string] param version
11:06:30FromDiscord<aru> is writing `static[type]` and `static type` any different?
11:07:12FromDiscord<Bung> never seen in right form, it's like c/c++ code
11:08:26FromDiscord<aru> i have written `static type` quite a few times \>\_\<
11:08:45FromDiscord<Rika> Both are the same iirc
11:37:30FromDiscord<voidwalker> I need some code. Trying to asynchronously get n URLs which need to be parsed, and then for each such URL save the (another) parsed URL to disk. All async, so the gui in which this happens doesn't block. Any idea how the code would look like ?
11:37:54FromDiscord<voidwalker> Something like this in nim pseudocode:
11:38:02FromDiscord<voidwalker> sent a code paste, see https://play.nim-lang.org/#ix=491s
11:39:29FromDiscord<Forest [She/Her]> In reply to @รєคɭ๓๏שє "<@909883978717204561> I forgot to": Yup
11:39:46FromDiscord<Forest [She/Her]> In reply to @รєคɭ๓๏שє ""mythical forest collective" :DDD": #system-bullshit
11:39:46FromDiscord<voidwalker> Not even sure if this shouldn't be a threaded job, as well as async
11:39:58FromDiscord<dom96> In reply to @voidwalker "Not even sure if": async is all you need
11:40:03FromDiscord<dom96> what GUI are you using?
11:40:09FromDiscord<voidwalker> fidgetty at the moment
11:40:15FromDiscord<voidwalker> (edit) "fidgetty" => "fidget(ty)"
11:40:50FromDiscord<dom96> what event loop does fidgetty use? i.e. what is it using to create the window and get mouse/key events?
11:41:20FromDiscord<Forest [She/Her]> In reply to @รєคɭ๓๏שє "I thought it was": Yeah, it should work, i want to generate source files since it's easier to breakdown the structure, of course it'll need trial and error but this'll allow people to just read through the outputted code (and i may make something to generate bytecode but doubt it)
11:42:43FromDiscord<voidwalker> it has import asyncfutures
11:42:47FromDiscord<voidwalker> (edit) "has" => "has`" | "asyncfutures" => "asyncfutures`"
11:44:03FromDiscord<voidwalker> Author told me this :`just follow the examples in examples/choosenimapp.nim or src/animatedProgress.nim. Basically just put a properties: myTask: Future[void] and then self.myTask = doSomething(self) . It basically sets up your proc to run on the event loop in Fidget that I added in. Whenever you update just remember to call refresh() to tell Fidget that something changed and to redraw.↵`
11:45:37FromDiscord<dom96> Hm, guess the author added support for running asyncdispatch already then
11:46:53FromDiscord<voidwalker> Yep. But I still have no idea what I am doing. Two levels of nested async waiting stuff is too much for me
11:47:44FromDiscord<enthus1ast> in general, most gui event loops have a timer/timeout feature, just call asyncdispatch.poll() with a relatively small timeout number in these
11:48:05FromDiscord<dom96> pretty sure fidgetty already does that for you
11:48:08FromDiscord<dom96> based on what the author said
11:48:59FromDiscord<enthus1ast> that i do not know, but so far i could use every gui we have with async
11:49:01FromDiscord<dom96> Just `asyncCheck test()` somewhere
11:49:04FromDiscord<dom96> sent a code paste, see https://play.nim-lang.org/#ix=491t
11:49:21FromDiscord<dom96> (edit) "https://play.nim-lang.org/#ix=491t" => "https://play.nim-lang.org/#ix=491u"
11:49:24FromDiscord<dom96> and see whether the echo shows up every second
11:52:13FromDiscord<voidwalker> Well I did what the author said, had a seq of [Future[void]] added to the main program's "properties", and assigned them the async proc, and it got automatically ran
12:06:15FromDiscord<voidwalker> Yeah I do get Hell0 every second running the code above
12:10:00FromDiscord<sealmove> when I have a `let` pointer to an object, why can't i change the value of a field?
12:10:45FromDiscord<sealmove> is there `const type` vs `type const` distinction in nim?
12:12:02FromDiscord<planetis> In reply to @รєคɭ๓๏שє "is there `const type`": no there isn't but experimental strict funcs https://nim-lang.github.io/Nim/manual_experimental.html#strict-funcs are similar
12:12:16FromDiscord<voidwalker> so basically I need something like this, but no idea how to write it, I already spent numerous hours at it, and I declare myself hopeless. I need to work/read with a lot more async code to get the hang of it, if ever
12:12:26FromDiscord<voidwalker> sent a code paste, see https://play.nim-lang.org/#ix=491A
12:12:46FromDiscord<voidwalker> (edit) "https://play.nim-lang.org/#ix=491A" => "https://play.nim-lang.org/#ix=491B"
12:14:03FromDiscord<voidwalker> (edit) "https://play.nim-lang.org/#ix=491B" => "https://play.nim-lang.org/#ix=491C"
12:14:36FromDiscord<sealmove> but what semantics does `var x: ptr MyObj` has now? It means you can change both where the pointer points to and the value of the underlying object?
12:14:45FromDiscord<sealmove> and `let` let's do neither?
12:15:57FromDiscord<planetis> no strict funcs doesn't work with ptr only ref. But yes you're correct.
12:16:38FromDiscord<planetis> (edit) removed "But yes you're correct."
12:17:24FromDiscord<planetis> nope actually let with a ref type still allows mutability in what it points to.
12:17:39FromDiscord<planetis> (edit) "nope actually let with a ref type still allows mutability in what it points to. ... " added "but strict funcs prevents that."
12:18:18FromDiscord<sealmove> neat, thanks
12:27:53*Vladar quit (Ping timeout: 252 seconds)
12:40:44*Vladar joined #nim
12:49:49FromDiscord<flywind> sent a code paste, see https://play.nim-lang.org/#ix=491T
12:50:15FromDiscord<flywind> (edit) "https://play.nim-lang.org/#ix=491T" => "https://play.nim-lang.org/#ix=491U"
12:50:45FromDiscord<flywind> never mind, figured.
13:05:24FromDiscord<dom96> In reply to @voidwalker "so basically I need": where are you getting stuck?
13:19:37FromDiscord<voidwalker> at the design phase. not sure how to structure it
13:24:04FromDiscord<sealmove> does stdlib have a `Result` type? Err/Ok(argument)?
13:24:28FromDiscord<flywind> no
13:24:56FromDiscord<sealmove> what do you suggest? an extra boolean?
13:25:52FromDiscord<flywind> nim-results if you would like a 3rd library
13:26:52FromDiscord<enthus1ast> poor mans "Result" could be options
13:26:52FromDiscord<flywind> https://github.com/arnetheduck/nim-result
13:27:08FromDiscord<sealmove> i know, Result is only useful if you need an accompanying value (for example error message)
13:34:39FromDiscord<dom96> In reply to @voidwalker "at the design phase.": start by doing some async http requests in a separate script to get the handle for it
13:40:36FromDiscord<sealmove> guys I want to implement an index operator which will return an option. For example instead of `x[str]` I want to write `x[str]?` or `x?[str]` or something similar. what's a correct syntax?
13:43:14FromDiscord<planetis> the correct syntax is neither, lol. It just doesn't work well, there is experimental dotOperators if you want to try. Is raising exceptions an option, pun intended? Catching exceptions leads to much cleaner code imo.
13:44:11FromDiscord<sealmove> well I need to extract values from a table and then pass the results to another proc
13:44:46FromDiscord<sealmove> really? you can't define custom index-like operators in nim? I am pretty sure i've seen them
13:44:54FromDiscord<sealmove> (edit) "really? you can't define custom index-like operators in nim? I am pretty sure i've seen them ... " added "in stdlib somewhere"
13:47:28FromDiscord<planetis> Its `[]` and `[]=` but the `?` thing might break it
13:47:46FromDiscord<sealmove> only `[]` and `[]=`... hmm ok
13:54:22*PMunch quit (Quit: Leaving)
14:05:00FromDiscord<d4rckh> how do i print an LPVOID?
14:05:15FromDiscord<d4rckh> sent a code paste, see https://play.nim-lang.org/#ix=492p
14:05:28FromDiscord<d4rckh> (edit) "https://play.nim-lang.org/#ix=492p" => "https://play.nim-lang.org/#ix=492q"
14:06:03FromDiscord<d4rckh> ok casted it to a dword and it compiled fine
14:06:07FromDiscord<domosokrat> I think `{}` and `{}=` are also possible. parsejson uses them.
14:06:33FromDiscord<domosokrat> And don't forget, all can take multiple arguments
14:06:54FromDiscord<d4rckh> is it normal for it to be a negative number? https://media.discordapp.net/attachments/371759389889003532/1013811986456387584/unknown.png
14:07:18FromDiscord<d4rckh> oh its unsigned
14:07:28FromDiscord<d4rckh> how can i get a hex representation of it?
14:08:59FromDiscord<sealmove> `.hex()`
14:09:51FromDiscord<d4rckh> and thats from which lib?
14:10:02FromDiscord<sealmove> sorry it's `toHex()` actually, from `std/strutils`
14:10:11FromDiscord<d4rckh> got it
14:16:13FromDiscord<ravinder387> guys suppose i hv random numbers and I want to count number which is < 100. is there any count function exist in nim
14:18:57FromDiscord<SaAnd> if you have the numbers in a seq or array, you can use https://nim-lang.org/docs/sequtils.html#countIt.t%2Cuntyped%2Cuntypedlike this `mySeq.countIt(it < 100)`
14:21:44FromDiscord<ravinder387> if i wanna numbers between 300 to 500
14:22:12FromDiscord<SaAnd> `mySeq.countIt(it in 300 .. 500)`
14:22:22FromDiscord<SaAnd> that is inclusive, 500 does count
14:22:24FromDiscord<ravinder387> thanks
14:22:36FromDiscord<SaAnd> you're welcome \:)
14:22:48FromDiscord<ravinder387> r u bot or real human
14:23:26FromDiscord<SaAnd> im a human
14:23:26FromDiscord<aru> we are an AI
14:23:35FromDiscord<dom96> We built this using Nim
14:23:37FromDiscord<dom96> State of the art AI
14:23:40FromDiscord<dom96> it even thinks its human
14:23:43FromDiscord<dom96> Don't listen to it
14:23:46FromDiscord<ravinder387> cool!
14:23:54FromDiscord<aru> lmao
14:24:01FromDiscord<SaAnd> hehe
14:24:49FromDiscord<aru> nah, we are just on matrix and there is a bridge to send our messages to discord, and the other way
14:29:35FromDiscord<SaAnd> with a bot monitoring the bridge
14:30:02FromDiscord<aru> smth like that
14:42:22FromDiscord<sealmove> if you have a `typedesc` and you know it's a pointer, is it possible to get the type as not pointer?
14:44:31FromDiscord<sealmove> ah in `typetraits` there is `pointerBase`, sweet
15:06:37FromDiscord<d4rckh> how can i convert a string `"\xFF\x01\x13........` to an array of bytes?
15:07:29FromDiscord<enthus1ast> sent a code paste, see https://play.nim-lang.org/#ix=4931
15:07:32FromDiscord<d4rckh> amazing...
15:07:35FromDiscord<d4rckh> (edit)
15:07:44FromDiscord<enthus1ast> but its a seq
15:08:12FromDiscord<d4rckh> lemme check if it works with seq's
15:08:33FromDiscord<d4rckh> nope, it doesnt
15:08:45FromDiscord<enthus1ast> what does not work
15:08:50FromDiscord<d4rckh> i want to use it with WriteProcessMemory
15:09:02FromDiscord<d4rckh> as the source
15:09:02FromDiscord<voidwalker> I think this is what you need @d4rckh https://github.com/status-im/nim-stew/blob/master/stew/byteutils.nim#L43
15:09:05FromDiscord<enthus1ast> then you must do a
15:09:10FromDiscord<enthus1ast> addr foo[0]
15:09:18FromDiscord<enthus1ast> and foo.len
15:10:06FromDiscord<voidwalker> if you want to convert the hex values in the string to bytes
15:10:26FromDiscord<voidwalker> and not just each char of the string
15:10:41FromDiscord<d4rckh> how would an input string look like?
15:14:13FromDiscord<voidwalker> I think just the hex chars themselves, optionally starting with 0x
15:14:40FromDiscord<voidwalker> so you'd have to replace the "\x" with "" before converting
15:32:19FromDiscord<voidwalker> In reply to @dom96 "start by doing some": That's what I've been doing, and re-reading the same articles, but I didn't get any handles :[
15:33:21*sagax joined #nim
15:35:44FromDiscord<voidwalker> sent a code paste, see https://play.nim-lang.org/#ix=4937
15:36:15FromDiscord<voidwalker> if `myGetIMDBCoverURL` returns a Future[string], then shouldn't the code above not block when calling it ?
15:36:29*CyberTailor joined #nim
15:36:34FromDiscord<voidwalker> I get a "does it block" every ~1second or so
15:36:47*CyberTailor left #nim (#nim)
15:49:09FromDiscord<dom96> what does `myGetIMDBCoverURL` look like?
15:50:06FromDiscord<aru> Is there a way in `nim doc` to create separate sections appart from "procedures, types, etc" and put there specific procedures?
15:50:32FromDiscord<aru> like, I want to put the first three here in their own "Getters & Setters" section
15:50:40FromDiscord<voidwalker> sent a code paste, see https://play.nim-lang.org/#ix=493c
15:50:54FromDiscord<aru> image.png https://media.discordapp.net/attachments/371759389889003532/1013838157034311690/image.png
15:50:59FromDiscord<voidwalker> I just noticed it has httpClient used in it, not the async one
15:51:25FromDiscord<voidwalker> but nontheless, shouldn't it not block if it's marked with async ?
15:52:54FromDiscord<halc> In reply to @voidwalker "but nontheless, shouldn't it": it should block, the code within the proc itself executes immediately, otherwise you couldn't get a `Future[string]`
15:55:06FromDiscord<voidwalker> I thought that was the point of the Future[whatever], that it is returned immediately and can be checked for completion later
15:55:54FromDiscord<halc> In reply to @voidwalker "I thought that was": you return an empty Future, which will later be completed
15:56:01FromDiscord<halc> I know async programming can be a bit mind-boggling at first lol
15:56:37FromDiscord<IDF> a `Future[T]` is a value that will complete in the `future`, it doesnt complete by itself
15:57:22FromDiscord<voidwalker> yes, but it's a value that is returned immediately, no ?
15:57:39FromDiscord<voidwalker> it doesn't wait one cycle for the proc that returns it to complete ;-?
15:58:11FromDiscord<voidwalker> the future object i mean, in its unfinished state
15:59:11FromDiscord<IDF> its just a value, if the function is blocking youd still need for the function to finish for the future to be returned
16:01:18FromDiscord<voidwalker> well aren't all async functions non blocking ?
16:01:31FromDiscord<voidwalker> since they return Future[T] immediately by definition ?
16:02:47FromDiscord<halc> In reply to @voidwalker "well aren't all async": when you call the function, even if you don't `await` it, the code within the function will be executed immediately, the point is that the async function should only run the necessary code to set up whatever IO request you need, that's why it's "non-blocking", because we don't wait for the response
16:03:06FromDiscord<halc> hence why it returns an empty future
16:04:04FromDiscord<halc> (edit) "set up" => "send"
16:04:37FromDiscord<voidwalker> ohhh
16:05:15FromDiscord<IDF> the point is your function is still gonna execute some initialisation for your resulting future to be returned
16:05:17FromDiscord<voidwalker> they should have just made a damn animation with the program flow.. I cannot believe i am back to the basics after so many hours of reading : D
16:05:25FromDiscord<IDF> it doesnt just plop a future
16:06:01FromDiscord<voidwalker> I thought it just plops a future :\
16:06:11FromDiscord<halc> In reply to @voidwalker "they should have just": it's already, I still get confused from time to time when dealing with async stuff lol
16:06:15FromDiscord<halc> (edit) "already," => "alright,"
16:06:48FromDiscord<IDF> the nonblocking part comes when you need to retrieve a result from the future
16:07:09FromDiscord<IDF> which involves closures and whatnot
16:08:48FromDiscord<IDF> In reply to @voidwalker "take this code for": so here you would want all your functions that are called to be async
16:09:42FromDiscord<voidwalker> https://peterme.net/asynchronous-programming-in-nim.html
16:10:01FromDiscord<voidwalker> sent a code paste, see https://play.nim-lang.org/#ix=
16:10:33FromDiscord<voidwalker> so in my case the waiting could be because of not using asynchttp ?
16:11:26FromDiscord<voidwalker> omg that was it !
16:11:52FromDiscord<voidwalker> Now it echoes all the "does it block" in a flash
16:12:31FromDiscord<voidwalker> ok, small progress, moving on : )
16:12:52FromDiscord<IDF> sent a code paste, see https://play.nim-lang.org/#ix=493n
16:14:46FromDiscord<voidwalker> sent a code paste, see https://play.nim-lang.org/#ix=493o
16:14:58FromDiscord<voidwalker> sent a code paste, see https://play.nim-lang.org/#ix=493p
16:15:08FromDiscord<voidwalker> (edit) "https://play.nim-lang.org/#ix=493p" => "https://play.nim-lang.org/#ix=493q"
16:15:59FromDiscord<voidwalker> it's instant as in, the Future object is returned, without waiting for its comletion, and the next code gets executed
16:16:16FromDiscord<IDF> yes thats what i said
16:17:01FromDiscord<voidwalker> But then why did my async proc using httpClient instead of asyncHttpClient blocked?
16:17:12FromDiscord<voidwalker> (edit) "blocked?" => "block?"
16:18:22FromDiscord<IDF> its obvious, httpClient code is blocking, so the calls inside your async function defintion will block the thread
16:18:51FromDiscord<voidwalker> oh I think I get it now
16:20:19FromDiscord<IDF> basically what the `async` pragma does is to run a macro on the function to turn the body of your proc into closure iterators and other initialisers
16:20:33FromDiscord<voidwalker> so all the calls to that proc got executed concurrently, but an instruction that is "blocking", like that httpCall that takes ~1s to complete, makes it look like it's not
16:20:41FromDiscord<IDF> if your code is blocking, like httpclient, its going to block those iterators
16:20:47FromDiscord<IDF> (edit) "if your code is blocking, like ... httpclient," added "the procs in"
16:22:12FromDiscord<voidwalker> ok now I am curious to know the order in which things get processed
16:22:26FromDiscord<voidwalker> does step by step debug work for async ?
16:22:52FromDiscord<IDF> probably
16:23:01FromDiscord<IDF> it should work
16:23:04FromDiscord<IDF> its on a single thread anyway
16:23:07FromDiscord<voidwalker> Didn't figure out how to use the debugger in VSCodium, I was relying solely on echoes to debug
16:23:30FromDiscord<IDF> i dont think i ever used a debugger with nim
16:29:38FromDiscord<voidwalker> Ok I think I finally understood.. so the actual code in async procs actually gets executed "in order", and the program moves on executing where it was "left" when it encounters another async type of call
16:30:07FromDiscord<voidwalker> like asyncSleep, asyncHttp, or await of an async proc in another async proc
16:31:22FromDiscord<Rika> async functions only "leave" when you use `await`
16:31:31FromDiscord<Rika> all other functions are sync and run like in sync
16:31:50FromDiscord<IDF> ^
16:32:10FromDiscord<Rika> give me an example you might not understand and ill try to explain it
16:32:24FromDiscord<halc> sent a code paste, see https://play.nim-lang.org/#ix=493x
16:32:41FromDiscord<halc> (edit) "https://play.nim-lang.org/#ix=493x" => "https://play.nim-lang.org/#ix=493y"
16:33:01FromDiscord<voidwalker> yeah thats what I just did halc, put echoes everywhere in that example from https://peterme.net/asynchronous-programming-in-nim.html
16:33:30FromDiscord<voidwalker> this is what confused me:
16:33:34FromDiscord<voidwalker> sent a code paste, see https://paste.rs/fmr
16:33:59FromDiscord<IDF> it is instant in the sense that its not waiting for the response
16:34:08FromDiscord<halc> sent a code paste, see https://play.nim-lang.org/#ix=493A
16:34:29FromDiscord<voidwalker> I read it as "async functions immediately return a Future[Type]
16:34:36FromDiscord<IDF> thats not possible
16:34:40FromDiscord<IDF> well
16:34:44FromDiscord<IDF> they do
16:34:48FromDiscord<IDF> but then every function returns a value instantly
16:34:51FromDiscord<voidwalker> Well, that was where the confusion came from
16:34:51FromDiscord<IDF> (edit) "instantly" => ""instantly""
16:34:53FromDiscord<halc> In reply to @voidwalker "I read it as": yeah I can see how it could be read that way
16:34:56FromDiscord<Rika> they only "immediately return" if the first statement is an await
16:35:01FromDiscord<Rika> otherwise, no guarantees
16:35:18FromDiscord<voidwalker> The first one was when I thought await actually means "let a thing run in background"
16:35:19FromDiscord<voidwalker> lol
16:35:31FromDiscord<Rika> well, technically, yes
16:35:42FromDiscord<Rika> "wait for this future and yield my control"
16:35:55FromDiscord<Rika> "give it back when the future's done"
16:35:57FromDiscord<IDF> "give me an unreadable error if i messed up"
16:36:27FromDiscord<Rika> In reply to @Rika ""give it back when": "and when another proc yields its control"
16:36:51FromDiscord<Rika> ngl, the lua book would probably help you understand
16:37:02FromDiscord<voidwalker> Can't immagine how hard is that CPS stuff from the nimskull gang to understand for a noob, if this caused so much brainfuckery
16:37:12FromDiscord<Rika> i thought their explanation of async was good, even though i didnt really need it by the time i read it
16:37:19FromDiscord<IDF> cps itself as a concept is simpler actually
16:37:32FromDiscord<IDF> and similar
16:37:37FromDiscord<Rika> await is almost like trampoline
16:37:41FromDiscord<Rika> just the context is elised
16:37:53FromDiscord<Rika> etc etc theres a lot in common
16:38:42FromDiscord<halc> In reply to @voidwalker "The first one was": everything happens in one thread, so yeah, we don't really run much on the "background" so to speak, there is no parallelism, we just jump around the code to do other stuff when we'd otherwise have to wait
16:39:28FromDiscord<halc> it's like, you order a pizza, you don't just stand there in from of the door and wait, you do other stuff in the meantime
16:39:34FromDiscord<halc> (edit) "from" => "front"
16:39:37FromDiscord<Rika> In reply to @halc "everything happens in one": atalowleveltechnicallythereisparallelisminsomesense
16:40:18FromDiscord<dom96> ouch
16:40:22FromDiscord<halc> In reply to @Rika "atalowleveltechnicallythereisparallelisminsomesense": weeeeeeelll, yeah technically, just like technically there the cpu clock is alwys running lol
16:40:23FromDiscord<aru> rika lost his spaces
16:40:29FromDiscord<halc> (edit) "alwys" => "always"
16:40:32FromDiscord<dom96> it would be nice if the async macro could detect blocking IO and give you an error when you try to use it
16:40:37FromDiscord<halc> (edit) removed "there"
16:40:44FromDiscord<dom96> but yeah, it doesn't magically make blocking operations non-blocking
16:40:46FromDiscord<IDF> then it would error out constantly
16:41:08FromDiscord<dom96> if you do `sleep(1000)` then you block your thread and async won't be able to run anything in the background (this is why there is a `sleepAsync`
16:41:15FromDiscord<Rika> either that or you'd have to mark all instances of "blocking io"
16:41:24FromDiscord<dom96> In reply to @IDF "then it would error": no it wouldn't
16:42:02FromDiscord<IDF> alright
16:42:29FromDiscord<dom96> lol, glad I can convince you that easily
16:42:36FromDiscord<Rika> lmao
16:44:08FromDiscord<dom96> There are many ways to implement this. If doing it with Nim's effect system then you would just cast the blocking effects away on the system calls that may block
16:44:21FromDiscord<dom96> (when called via their async counterparts)
16:44:32FromDiscord<voidwalker> ok so if i have an array of Future[string], and assign each one the result of a proc that returns a Future[string], it seems they never "finish"
16:44:34FromDiscord<dom96> (and those async counterparts would of course ensure everything is non-blocking)
16:45:05FromDiscord<Rika> if youre going to mark the syscalls then how would file io work, since its only blocking in stdlib nim? would you fake it by also casting there?
16:45:21FromDiscord<IDF> also stuff like `os`
16:45:39FromDiscord<dom96> Depends. Right now file IO does block lol
16:45:39FromDiscord<IDF> it would require everything to have an async counterpart for it to work properly
16:45:42FromDiscord<dom96> even under async
16:45:55FromDiscord<IDF> yes i, i felt that, and was badly surprised when i found out asyncfile also blocks
16:46:02FromDiscord<Rika> In reply to @IDF "it would require everything": sure would be nice if there were
16:46:03FromDiscord<dom96> If you want to do it properly then you'd likely just spawn a new thread
16:46:09FromDiscord<dom96> afaik that's how node does it too
16:46:16FromDiscord<Rika> how pleasant
16:46:20FromDiscord<IDF> this
16:47:09FromDiscord<IDF> would be pleasant if it was on BEAM or something
16:47:57FromDiscord<dom96> I wonder if Node has any synchronous IO
16:48:07FromDiscord<dom96> It feels like JS managed to create a ecosystem that is async-by-default
16:48:25FromDiscord<dom96> But I don't have enough node knowledge to know for certain
16:49:33FromDiscord<leorize> node uses libuv so it does have fully async io
16:50:02FromDiscord<IDF> In reply to @dom96 "It feels like JS": pretty much
16:50:19FromDiscord<IDF> and its prone to race condition
16:50:21FromDiscord<IDF> (edit) "condition" => "conditions"
16:50:30FromDiscord<IDF> and the browser being rude to you
16:53:55FromDiscord<dom96> looks like it does in fact have sync IO functions https://nodejs.org/api/fs.html#fsreadfilesyncpath-options
16:53:57FromDiscord<voidwalker> Alright, so this code works so far, I get all my strings:
16:54:33FromDiscord<dom96> wonder how many folks accidentally use those without realising it will screw up their event loop
16:54:42FromDiscord<voidwalker> sent a code paste, see https://play.nim-lang.org/#ix=493P
16:55:11FromDiscord<dom96> @voidwalker you're running the event loop yourself there, from what the author of fidgetty has said this should be done for you
16:55:14FromDiscord<voidwalker> only I don't want to waitFor all futures to finish, I want to poll each one and start a new async job for each finished one
16:55:41FromDiscord<voidwalker> @dom96 yeah, I want to figure it out on my own first, adding the extra "gui event loop" complicates things conceptually for me
16:55:48FromDiscord<dom96> fair enough
16:56:04FromDiscord<dom96> though note that calling `waitFor` in an async proc is blocking
16:56:35FromDiscord<voidwalker> yeah I know, that's what I wanted to ask, what is the proper wat to poll if each future is finished here ?
16:56:49FromDiscord<voidwalker> if I just check it, it looks like they never finish
16:56:57FromDiscord<voidwalker> if I don't have "waitFor"
16:57:53FromDiscord<dom96> `await`
16:59:17FromDiscord<dom96> It might be easier for you to verify this works without fidgetty first
16:59:34FromDiscord<dom96> just call `startPosters` at the top level of your code with `waitFor startPosters()`
17:00:07FromDiscord<voidwalker> I am running it inside the fidgetty code indeed.. hmm
17:10:53FromDiscord<voidwalker> sent a code paste, see https://play.nim-lang.org/#ix=493U
17:11:20FromDiscord<voidwalker> ` while not all(poster_urls_fut).finished:` - is this not the proper way to run a loop until all futures in posters_urls_fut are completed ?
17:13:24FromDiscord<Bung> you can use awaitAll await a sequence of futures
17:18:33FromDiscord<dom96> In reply to @voidwalker "` while not": no... just do `await all(poster_urls_fut)`
17:18:50FromDiscord<dom96> after that statement all your futures will be finished
17:20:19FromDiscord<voidwalker> well I don't want to wait for all. one of them might never finish, or take too long to finish.
17:20:37FromDiscord<voidwalker> I want to start the next async job as soon as any of them are finished
17:21:08FromDiscord<dom96> oh sorry, I misread
17:21:59FromDiscord<dom96> but I don't get what you're trying to do
17:22:11FromDiscord<dom96> why await them one by one if one of them might take forever to finish?
17:22:19FromDiscord<dom96> that shouldn't be possible in the first place
17:24:22FromDiscord<Bung> you can just wraps with withTimeout, await all makes code more clear, otherwise is too nested imo
17:25:35FromDiscord<Bung> and you while loop cause a block
17:27:05FromDiscord<Shiba> is it safe to use inc?
17:27:14FromDiscord<Shiba> is it safe to use incremental compiling , and does it work properly?
17:27:26FromDiscord<Shiba> (edit) "," => "?"
17:31:40*jmdaemon joined #nim
17:35:12FromDiscord<voidwalker> not trying to have the clearest code, but to understand how to deal with this damn things : D
17:37:08FromDiscord<voidwalker> @dom96 So far I have the url string I need, in a sequence of Future[string], all done in async. I want that as soon as one of those futures in the sequence completes, another async job to be started. That's why I can't await all()
17:37:53FromDiscord<voidwalker> none should take "forever" to finish, but maybe internet gets broken, and it will need a timeout.. I will think of that later, not important now
17:39:51FromDiscord<dom96> Okay, I get it
17:40:02FromDiscord<voidwalker> and await all() would mean, do not get past this line, until they are all completed
17:40:19FromDiscord<voidwalker> and if one of them takes a few secs to happen, that will block the program
17:40:37FromDiscord<dom96> sent a long message, see http://ix.io/493Y
17:40:39FromDiscord<voidwalker> yeah that's what I did
17:40:53FromDiscord<dom96> (edit) "long message," => "code paste," | "http://ix.io/493Y" => "https://play.nim-lang.org/#ix=493Z"
17:41:02FromDiscord<voidwalker> but if I don't have any waitFor/await, they seem to never complete
17:41:50FromDiscord<dom96> (edit) "https://play.nim-lang.org/#ix=493Z" => "https://play.nim-lang.org/#ix=4940"
17:41:54FromDiscord<voidwalker> that's why I awaited them one by one
17:42:05FromDiscord<dom96> finished^
17:42:08FromDiscord<dom96> (edit) "https://play.nim-lang.org/#ix=4940" => "https://play.nim-lang.org/#ix=4941"
17:42:09FromDiscord<voidwalker> but maybe asyncCheck is the right thing to use here?
17:43:40FromDiscord<dom96> nope, shouldn't matter
17:45:46FromDiscord<voidwalker> sent a code paste, see https://play.nim-lang.org/#ix=4947
17:46:05FromDiscord<voidwalker> the while loop runs forever, and no future is finished
17:46:26FromDiscord<voidwalker> but if I put the sleepAsync inside the while loop , like:
17:46:33FromDiscord<voidwalker> then they complete
17:46:34FromDiscord<voidwalker> sent a code paste, see https://play.nim-lang.org/#ix=4948
17:47:08FromDiscord<dom96> yeah
17:47:11FromDiscord<dom96> you need it
17:47:22FromDiscord<Bubblie> how do you do const pointers in nim?
17:47:24FromDiscord<dom96> that's how you let the event loop run
17:47:31FromDiscord<voidwalker> so yeah that was my question, what is the proper event loop trigger do I need her
17:47:35FromDiscord<voidwalker> (edit) "her" => "here"
17:47:43FromDiscord<voidwalker> (edit) "do" => "that"
17:48:22FromDiscord<voidwalker> and how do I get the loop to stop once all the futures in that sequence are completed
17:48:23FromDiscord<dom96> actually what you want here is:
17:48:26FromDiscord<voidwalker> since my code didn't work
17:48:30FromDiscord<dom96> await any(poster_urls_fut)
17:48:33FromDiscord<dom96> instead of the sleepAsync
17:49:02FromDiscord<dom96> but apparently Nim stdlib doesn't have that lol
17:49:18FromDiscord<dom96> you can create it easily though
17:49:35FromDiscord<voidwalker> sleepAsync(1) should do for now ?
17:51:18FromDiscord<dom96> sure, but not as efficient as it could be
17:54:30FromDiscord<enthus1ast> quickly dumping data on c target, then loading in a const on the js target is quite annoying
17:54:42FromDiscord<enthus1ast> since it just does not work \:)
17:55:40FromDiscord<deech> Is the `pegs` in stdlib not capable of capturing more than 20 patterns in one run? https://github.com/nim-lang/Nim/blob/2b56b38235c7cdb60a952ee4ec684a053eeee47c/lib/pure/pegs.nim#L34
18:00:40FromDiscord<voidwalker> sent a code paste, see https://play.nim-lang.org/#ix=494d
18:01:26FromDiscord<voidwalker> ok so this concept will not work.. I have to trigger the download just once after a future in my sequence is finished. This is a ddos tool now : )
18:01:32FromDiscord<dom96> don't use discard
18:01:34FromDiscord<dom96> on a future
18:01:47FromDiscord<dom96> this is where you'd use asyncCheck
18:01:59FromDiscord<aru> use `asyncCheck`
18:01:59FromDiscord<dom96> (discarding means that if the future fails you won't know about it)
18:02:28FromDiscord<voidwalker> sent a code paste, see https://play.nim-lang.org/#ix=494e
18:05:03FromDiscord<domosokrat> Hm, I've been wondering, why not put the myGetIMDBCoverURL+downloadFile in an async proc and add the calls to this function to a seq?
18:05:30FromDiscord<voidwalker> yeah ok, got it. Point still remains though, this will call the downloadFile forever
18:06:49FromDiscord<voidwalker> @domosokrat because ... I am still trying to figure out how async works. Hard to design something when you don't know how the pieces go together
18:07:58*ggsx joined #nim
18:08:17ggsxis it possible to switch warning per folder/file?
18:08:37FromDiscord<voidwalker> so basically an async proc that has await myGetIMDBCoverURL(id), and await downloadFile(resultOf(myGetIMDBCoverURL(id)) ?
18:08:42ggsxusecase is a library that generates alot of warnings and I don't want to touch it
18:08:56FromDiscord<Forest [She/Her]> I wonder if it's possible for me to force Nim to give custom... warnings? pop-ups? in VSC
18:10:04FromDiscord<voidwalker> That is actually a very neat idea .. why didn't I think of that : ) Still stuck in the for/while loops frame of mind :
18:10:32FromDiscord<domosokrat> yes, that's what I meant
18:11:23*ggsx quit (Client Quit)
18:11:40FromDiscord<voidwalker> so I don't have to manually check if the first batch of async jobs are finished, it will take care of itself automatically
18:12:10FromDiscord<voidwalker> just have to check if the very end result of each such proc is finished, so I can display the downloaded picture
18:13:44FromDiscord<domosokrat> I think that's often the right approach, when you want to handle multiple resources the same way asyncronously\: Write a proc that handles one instance and call that for all resources
18:16:50FromDiscord<voidwalker> Yeah that is the obvious conclusion once you understand how the code jumps aroudn in async
18:16:56FromDiscord<voidwalker> https://play.nim-lang.org/#ix=494j
18:17:12FromDiscord<voidwalker> any idea why this code doesn't run on play nim ?
18:19:31*ggsx joined #nim
18:20:47FromDiscord<auxym> Any way I can get a compile-time proc to write a file to the cache dir when called?
18:23:29FromDiscord<domosokrat> no idea why it fails in the playground
18:27:36FromDiscord<domosokrat> @auxym\: hmm. use `staticExec("cat >"& nimCacheDir() & filename, text_to_write)`
18:38:26FromDiscord<voidwalker> sent a code paste, see https://play.nim-lang.org/#ix=494r
18:39:09FromDiscord<Forest [She/Her]> How do i tell the compiler that a certain variable, which has a common root with others, is actually this type
18:40:01FromDiscord<Forest [She/Her]> So `BaseType = ref object of RootObj` is the common root, and i have a sequence containing multiple objects inheriting from BaseType but each having their own type
18:40:59FromDiscord<vestel> In reply to @Forest "How do i tell": you mean like base type of derived?
18:41:11FromDiscord<Forest [She/Her]> Yeah
18:42:04FromDiscord<vestel> you wanna do some polymorphism or what?
18:42:54FromDiscord<Forest [She/Her]> sent a code paste, see https://play.nim-lang.org/#ix=494t
18:42:56FromDiscord<Forest [She/Her]> In reply to @vestel "you wanna do some": No idea what you mean by that
18:43:38FromDiscord<Forest [She/Her]> sent a code paste, see https://play.nim-lang.org/#ix=494u
18:43:40FromDiscord<Forest [She/Her]> And then do stuff according to that
18:43:44FromDiscord<Elegantbeef> `BaseType MyTypeOne`
18:44:03FromDiscord<Elegantbeef> `if myVal of MyTypeOne`
18:44:05FromDiscord<vestel> In reply to @Forest "And then do stuff": try methods
18:44:18FromDiscord<Forest [She/Her]> In reply to @Elegantbeef "`if myVal of MyTypeOne`": Ah thanks!
18:46:23FromDiscord<Forest [She/Her]> In reply to @Elegantbeef "`if myVal of MyTypeOne`": It says the field is undefined
18:48:16FromDiscord<Elegantbeef> You need to convert back to that type
18:48:36FromDiscord<Forest [She/Her]> Just did `let clsc = JavaClass cls` and hopefully now it should work
18:48:37FromDiscord<Forest [She/Her]> Ah okay
18:50:32FromDiscord<Forest [She/Her]> Eyyy my code works
18:50:38*ggsx quit (Quit: Ping timeout (120 seconds))
18:51:06*Burt_Harbinson__ joined #nim
18:51:44FromDiscord<enthus1ast> sent a code paste, see https://play.nim-lang.org/#ix=494z
18:51:52FromDiscord<enthus1ast> is this supposed to work?
18:52:07FromDiscord<Elegantbeef> Probably
18:52:11FromDiscord<enthus1ast> yeah, its not \:)
18:52:33Burt_Harbinson__Hello everyone. Is it possible to exit an iterator early?
18:52:44FromDiscord<Elegantbeef> `break`
18:52:52Burt_Harbinson__hm
18:53:39Burt_Harbinson__I get: invalid control flow: break
18:53:54Burt_Harbinson__note this is outside the main while loop of the iterator
18:54:00FromDiscord<Elegantbeef> You're in a for loop right?
18:54:05FromDiscord<enthus1ast> 10% doing the stuff i actually wanted to to do, 90% trying to serialize data; fck think i'm done for the day
18:54:16FromDiscord<Elegantbeef> You cannot break an iterator outside of an iterator
18:54:26FromDiscord<vestel> use blocks
18:55:07Burt_Harbinson__Right, I will read up on blocks... thank you
18:55:31FromDiscord<Phil> In reply to @enthus1ast "10% doing the stuff": ~~I'm waiting 60% of the time for PR feedback, I'm not sure which is worse~~
18:55:52Burt_Harbinson__it is possible to add an extra if statement and put the main while loop inside the else clause but i wanted to avoid extra indentation... then again, indent is 2 spaces so gives a fudge
18:56:11FromDiscord<vestel> if expression
18:56:11FromDiscord<Phil> I need to see code
18:56:28FromDiscord<Phil> If I am to evaluate anything
18:57:54FromDiscord<enthus1ast> i kinda actually lost interest in the stuff i wanted to do, since it should be just a quick hack↵(@Phil)
18:58:25FromDiscord<Phil> In reply to @enthus1ast "i kinda actually lost": Similar with me and webgui, the recent "Yeah, haha, your app isn't bundling zone.js so screw yourself" issue made me just so tired
18:58:47FromDiscord<Phil> I'm looking forward to moigagoo finally giving some sort of life-sign regarding the PRs on norm so I can continue on those
19:01:00*PMunch joined #nim
19:01:23FromDiscord<enthus1ast> wondering what zone.js is
19:02:09FromDiscord<Phil> Apparently angular wrapped all browser request APIs for their change detection mechanims which is how they decide when to trigger re-renders
19:02:33FromDiscord<enthus1ast> thank you
19:02:36FromDiscord<enthus1ast> sent a code paste, see https://play.nim-lang.org/#ix=494F
19:02:49FromDiscord<Phil> Ah yes, documentation
19:02:56FromDiscord<Phil> It documents behaviour and provides information
19:03:10FromDiscord<Phil> of javascript even
19:03:33FromDiscord<enthus1ast> "florbisch.js" implements "florbishs" for js inspired by Badonkle
19:03:50FromDiscord<Phil> Stop enthus1ast, stop!
19:03:56FromDiscord<Phil> You are drowning me in information
19:03:57FromDiscord<vestel> still beaten by is-odd.js
19:04:00FromDiscord<Phil> I can not comprehend all of this
19:04:58FromDiscord<enthus1ast> hacks and magic↵(@Phil)
19:06:46FromDiscord<Phil> In reply to @enthus1ast "hacks and magic (<@180601887916163073>)": Ever since I made my own wrap over norm's APIs I've learned to appreciate wrapping an existing API just to be able to use it in a slightly simpler manner and add some side-effect systems
19:06:58FromDiscord<enthus1ast> this is actually a good name, i know what the package does just by reading its name↵(@vestel)
19:07:53FromDiscord<vestel> In reply to @enthus1ast "this is actually a": i mean why the heck there is that packet on npm
19:08:17FromDiscord<enthus1ast> to later change it to malware of course↵(@vestel)
19:09:29FromDiscord<vestel> acceptable
19:14:14FromDiscord<Phil> Burt_Harbinson , my comment about needing to see code was directed at you btw, asking you to provide some "draft" of code for what you'd want to do that we can give feedback on so we don't have to guess at what language construct you're trying to build
19:39:14FromDiscord<Bubblie> So uh
19:39:21FromDiscord<Bubblie> Is there any const pointers in nim?
19:39:25FromDiscord<Bubblie> Like how would one perform this
19:40:37FromDiscord<vestel> const pointer or pointer to const object?
19:41:21FromDiscord<Forest [She/Her]> In Nim is it an acceptable practice to split up a single file of code into smaller files that contain methods only relevant to the type they were made for?
19:41:37FromDiscord<vestel> yes
19:41:49FromDiscord<Forest [She/Her]> Sweet
19:44:29FromDiscord<Phil> In reply to @Forest "In Nim is it": Not just acceptable, I do that extensively and I would even go as far as declaring that as best practice to have small module whose contents you can comprehend rather than single massive modules
19:44:31PMunchI'd say that's even good practice
19:45:14FromDiscord<vestel> i think it depends on size of type and procs
19:45:18FromDiscord<Phil> Nim even has 2 ways of doing it (import and include) depending on what you need technically, though import is the correct choice 99% of the time
19:45:26FromDiscord<Forest [She/Her]> Thank god then, my file was getting really messy and it's like, 250 lines (not even big to others ig buuuuut)
19:46:14FromDiscord<Phil> In reply to @Forest "Thank god then, my": Just for reference, above 200 lines I start keeping in the back of my head to look for a clear line in the concept that is contained in this module to split it apart
19:46:35FromDiscord<Forest [She/Her]> Fair!
19:46:50FromDiscord<Phil> Most of my modules are in the w0-200 lines range
19:46:54FromDiscord<Phil> (edit) "w0-200" => "20-200"
19:49:09FromDiscord<Forest [She/Her]> I'm trying to keep this maintainable for me even if i don't look at it for a month ngl
19:49:21FromDiscord<Forest [She/Her]> Since code generation is just being a pain to write in a flexible way :p
19:49:30FromDiscord<vestel> In reply to @Forest "I'm trying to keep": very ambitious goal
19:50:27FromDiscord<Forest [She/Her]> Absolutely lmao
19:54:01FromDiscord<Phil> In reply to @Forest "I'm trying to keep": May I introduce you to the concept of documentation 😛 ?
19:54:32FromDiscord<Phil> Yeah I know, typically you do not need docs for yourself, but it can help enshrining and solidifying some ways that you organized your code a bit more
19:54:39FromDiscord<Phil> E.g. I have a strict separation in my backend
19:55:59FromDiscord<Forest [She/Her]> In reply to @Isofruit "May I introduce you": I'm writing comments if that counts? :P
19:56:48FromDiscord<Phil> I split my tables and the concepts they represent into domain folders. That will contain up to 8 bespoken modules for always the same tasks:↵Repository, Service, Controllers, Deserialization, Serialization, Utils, Model, Routes, Signals↵So far that covered all my usecases ever
19:57:19FromDiscord<domosokrat> `inc a # increment a`↵(@Forest)
19:57:26FromDiscord<Forest [She/Her]> Oh that's neat, but none of them is applicable to mine accept utils lmao
19:57:33FromDiscord<Forest [She/Her]> Except
19:57:42FromDiscord<Forest [She/Her]> In reply to @domosokrat "`inc a #": Mood
19:58:19FromDiscord<Phil> I wasn't trying to get you to apply the very same logic split, but more expand on the concept and that in general you can think on which repetitive pieces of logic you have that may allow you to apply a consistent naming scheme
19:58:31FromDiscord<aru> ha! my biggest modlue has 450 lines!↵(@Forest)
20:00:09FromDiscord<Phil> It helps if you're already pretty familiar with the problem domain you're in and know the "standard ways" people in there typically split their logic↵Mine is mostly applicable to web-applications, yours is almost guaranteed to be different due to dealing with different problems
20:01:49FromDiscord<Forest [She/Her]> In reply to @Isofruit "I wasn't trying to": Ah fair!
20:02:01FromDiscord<Forest [She/Her]> In reply to @Isofruit "It helps if you're": Yup!
20:02:34FromDiscord<Forest [She/Her]> In reply to @aru "ha! my biggest modlue": I remember when i was trying to write a Minecraft bridge to Mindustry (a completely different game), and then just giving up because it became unmaintainable lmao
20:02:56FromDiscord<Forest [She/Her]> Honestly i just need to work on macros that generate Java code now, most of my work (for generating Java code) is done
20:08:12FromDiscord<sealmove> But do you want to convert the whole Nim spec? Or only a subset?
20:08:13*PMunch quit (Quit: leaving)
20:08:40FromDiscord<Forest [She/Her]> In reply to @รєคɭ๓๏שє "But do you want": Just a subset
20:08:44FromDiscord<Forest [She/Her]> Not even a subset really
20:09:00FromDiscord<Forest [She/Her]> Just a more idiomatic way to write Java within Nim
20:09:18FromDiscord<Forest [She/Her]> With Nim, not within
20:09:30FromDiscord<Forest [She/Her]> I've also encountered a very weird bug
20:10:24FromDiscord<Forest [She/Her]> sent a code paste, see https://play.nim-lang.org/#ix=4955
20:10:42FromDiscord<aru> ah I encountered that too previously
20:11:05FromDiscord<aru> `../[a, b]` works tho
20:11:22FromDiscord<aru> so idk why `./[a, b]` doesn't
20:11:35FromDiscord<Forest [She/Her]> Huh, odd
20:12:03FromDiscord<sealmove> In reply to @Forest "With* Nim, not within": What's your motivation though
20:12:52*Vladar quit (Quit: Leaving)
20:13:20FromDiscord<Forest [She/Her]> In reply to @รєคɭ๓๏שє "What's your motivation though": Oh, my motivation is to allow you to output Java code that can be compiled with `javac`, in a way that feels natural/familiar with Nim
20:14:21FromDiscord<Forest [She/Her]> I still don't really have the best idea on how to do this though, but i had an idea with macros to do something like: (writing the example code now)
20:15:49FromDiscord<aru> `expression expected but found "."` or smth like that was the error irc
20:18:57FromDiscord<Forest [She/Her]> Hm, I can't write an example that conveys how i want it to feel...
20:19:19FromDiscord<Forest [She/Her]> In reply to @รєคɭ๓๏שє "What's your motivation though": I just really want it to feel more like Nim, even if you're writing code that generates Java files
20:19:47FromDiscord<Forest [She/Her]> In reply to @aru "`expression expected but found": Says for me `cannot open file: ./[keywords, types]`
20:20:18FromDiscord<aru> hmmm
20:21:37FromDiscord<Forest [She/Her]> But individually importing them is fine, sooo
20:22:06FromDiscord<aru> yh, doing `./Module` works
20:25:57FromDiscord<Forest [She/Her]> Yup
20:26:12FromDiscord<Forest [She/Her]> Hey aruZeta
20:26:26FromDiscord<Forest [She/Her]> Could you give me a minimal example of how you'd like to write Java code in Nim?
20:26:41FromDiscord<Forest [She/Her]> Like, with macros/functions/pragmas
20:26:52FromDiscord<Forest [She/Her]> Instead of just normal direct code (because sadly i can't do that yet)
20:27:45FromDiscord<dom96> In reply to @Forest "Oh, my motivation is": what's your motivation for outputting Java code?
20:28:51FromDiscord<Forest [She/Her]> In reply to @dom96 "what's your motivation for": It's so Nim can run on the JVM, i specifically want to make a Minecraft mod in Nim for fun lmao
20:29:03FromDiscord<Forest [She/Her]> I really like Minecraft, but i hate Java (but i do know it)
20:29:44FromDiscord<Forest [She/Her]> I love Nim, but it can't be compiled to work on the JVM, sure i can use JS but I don't want to rely on something like KubeJS or GraalJS (GraalJS is big in general)
20:30:10FromDiscord<Forest [She/Her]> With direct code generation in Nim, i can make it output Java code with minimal Nim
20:30:36FromDiscord<Forest [She/Her]> If there's something else you guys are meaning and I'm not quite getting, sorry 😅 I'm autistic and struggle with that stuff at times aha
20:31:01FromDiscord<dom96> Don't worry, I get it :)
20:32:56FromDiscord<aru> damn, dom is talking with the air (again?)
20:33:14*rockcavera joined #nim
20:33:14*rockcavera quit (Changing host)
20:33:15*rockcavera joined #nim
20:33:34FromDiscord<Superstart033> You want to Nim to compile to Java and that Java code to compile to the jvm?
20:34:06FromDiscord<Forest [She/Her]> Yup
20:34:32FromDiscord<Forest [She/Her]> It's source code since it allows users to emit their own custom java code (as a string) easily
20:34:48FromDiscord<dom96> In reply to @aru "damn, dom is talking": What do you mean? Is the Matrix bridge failing maybe?
20:34:50FromDiscord<Forest [She/Her]> If there's something that the code gen library can't do (yet)
20:35:14FromDiscord<dom96> IRC logs are pretty accurate in case you want to check: https://irclogs.nim-lang.org/29-08-2022.html#20:31:01
20:35:16FromDiscord<aru> hdah seems to be the case↵(@dom96)
20:35:38FromDiscord<Superstart033> In reply to @Forest "Yup": That sounds incredible convoluted XD
20:36:24FromDiscord<aru> this was the last I saw lol
20:36:24FromDiscord<aru> image.png https://media.discordapp.net/attachments/371759389889003532/1013910010813751410/image.png
20:36:39FromDiscord<Superstart033> LMAO
20:36:53FromDiscord<dom96> you missed a lot then
20:36:56FromDiscord<dom96> lol
20:37:22FromDiscord<aruZeta> Yh lol, reading in here
20:37:24FromDiscord<Superstart033> Maybe you could connect Nim to Minecraft itself lol
20:37:29FromDiscord<Superstart033> With an api or something
20:37:49FromDiscord<dom96> yeah, you might be able to use the JNI
20:38:09FromDiscord<dom96> but do whatever makes you excited and eager to learn :)
20:41:00FromDiscord<Forest [She/Her]> In reply to @Superstart033 "That sounds incredible convoluted": Sorry aha
20:41:26FromDiscord<Forest [She/Her]> In reply to @Superstart033 "With an api or": I could buut that's not clean? So-
20:41:53FromDiscord<Forest [She/Her]> In reply to @dom96 "yeah, you might be": That's also an idea but it'd slow down the game a lot (also no Nim-Java Mixins xD)
20:44:42FromDiscord<Forest [She/Her]> Hm i need to figure out the ideal way to implement code generation...
20:45:14FromDiscord<Forest [She/Her]> Is it possible to do something with pragmas?
20:45:28FromDiscord<Forest [She/Her]> Hm...
20:45:48FromDiscord<Forest [She/Her]> Wait maybe templates + a custom object would work hmmmm
20:46:21FromDiscord<leetnewb> tosse 4859
20:46:40FromDiscord<Elegantbeef> Leetnewb just leaked their password
20:46:46FromDiscord<leetnewb> sorry :p
20:46:46FromDiscord<Elegantbeef> I'm so sorry for this instance of sadness
20:47:14FromDiscord<leetnewb> migraine destroying my brain apparently
20:47:20FromDiscord<aru> sent a code paste, see https://play.nim-lang.org/#ix=495c
20:47:48FromDiscord<Forest [She/Her]> Oh that would work very well!
20:47:58FromDiscord<Forest [She/Her]> Thanks aruZeta!
20:48:07FromDiscord<aru> you will have to deal with lots of AST
20:48:12FromDiscord<Forest [She/Her]> Oh absolutely
20:48:16FromDiscord<Forest [She/Her]> It'll suck but
20:48:18FromDiscord<aru> so when you are at that you may find better approaches
20:48:21FromDiscord<Forest [She/Her]> Will help me learn-
20:48:39FromDiscord<dom96> In reply to @leetnewb "migraine destroying my brain": if that was a password you're using then be sure to reset it, you might have deleted it here but this channel is logged
20:49:08FromDiscord<aru> sent a code paste, see https://play.nim-lang.org/#ix=495e
20:49:40FromDiscord<aruZeta> Edits from the matrix do rly look bad here lol
20:50:08FromDiscord<leetnewb> In reply to @dom96 "if that was a": Thanks, nothing used for public interfaces.
20:50:10FromDiscord<Elegantbeef> "from the matrix"
20:50:20FromDiscord<leetnewb> or any important private for that matter :p
20:50:48FromDiscord<!Patitotective> lets leak our passwords too to make leetnewb feel better
20:50:58FromDiscord<Elegantbeef> hunter2
20:51:13FromDiscord<dom96> **
20:51:14FromDiscord<aru> mine is the same as yours, could you remind me?
20:51:21FromDiscord<dom96> oh what a cool feature
20:51:24FromDiscord<dom96> it hides my password
20:51:25FromDiscord<Elegantbeef> Nice try dom
20:51:44FromDiscord<dom96> also lol Discord changing that to a single asterisk
20:51:49FromDiscord<Elegantbeef> \\\\\\\\\
20:51:50FromDiscord<dom96> yep, my password is 1 char
20:51:53FromDiscord<dom96> I like to live dangerously
20:51:57FromDiscord<aru> it's making it bold
20:52:07FromDiscord<aru> \\\\\
20:52:15FromDiscord<Elegantbeef> It's those unescaped characters
20:52:18FromDiscord<Elegantbeef> Down with markdown
20:52:23FromDiscord<!Patitotective> 0xdeadbeef, best password
20:52:24FromDiscord<aru> you need to use a \\ to scape it
20:52:45FromDiscord<aru> lmao↵(@!Patitotective)
20:53:15FromDiscord<Elegantbeef> I feel threatened
20:53:44FromDiscord<leetnewb> I think you've been immortalized
20:54:43FromDiscord<aru> beef feels beefed
20:54:50FromDiscord<!Patitotective> 0xfeedbeef
20:55:03FromDiscord<!Patitotective> what do you like to eat beef
20:55:05FromDiscord<aru> hahahha
20:55:13FromDiscord<aru> beef of course
20:56:44FromDiscord<aru> wait beefed does actually exist in the dictionary?
21:00:05FromDiscord<Forest [She/Her]> In reply to @aruZeta "Edits from the matrix": Yeah lmao
21:00:18*rockcavera quit (Remote host closed the connection)
21:00:35FromDiscord<Forest [She/Her]> In reply to @dom96 "it hides my password": \\\\\\\\\
21:00:39FromDiscord<Forest [She/Her]> Oh neat it works
21:01:53FromDiscord<Forest [She/Her]> Can macros take keyword arguments? :P
21:02:17FromDiscord<aru> as untyped?
21:02:18FromDiscord<aru> no
21:02:31FromDiscord<Forest [She/Her]> sent a code paste, see https://play.nim-lang.org/#ix=495h
21:02:47FromDiscord<d4rckh> Does importing specific functions instead of entire libs help reduce the binary size?
21:02:50FromDiscord<Forest [She/Her]> In reply to @aru "as untyped?": First two values would be strings
21:03:07FromDiscord<Elegantbeef> No dead code elimination removes any unusedcode↵(@d4rckh)
21:03:27FromDiscord<d4rckh> That's done by the compiler?
21:03:31FromDiscord<Forest [She/Her]> Commas are probably good for clarification :p
21:03:35FromDiscord<Forest [She/Her]> In reply to @d4rckh "That's done by the": Yup!
21:03:46FromDiscord<d4rckh> And how can I improve the file size of my program?
21:04:05FromDiscord<d4rckh> Right now it's 500kb, my goal would be ~250kb
21:04:05FromDiscord<Forest [She/Her]> There is the `--opt:size` parameter?
21:04:20FromDiscord<d4rckh> any disadvantages of using that?
21:04:41FromDiscord<Forest [She/Her]> Compiling with `-d:release --opt:size` (or `-d:danger` instead of release but iirc that's more dangerous)
21:04:51FromDiscord<Forest [She/Her]> In reply to @d4rckh "any disadvantages of using": Probably speed impacts but it shouldn't be that bad
21:04:57FromDiscord<Forest [She/Her]> I genuinely have no idea
21:05:29FromDiscord<d4rckh> It doesn't too much computing, just http requests
21:05:40FromDiscord<d4rckh> (edit) "too" => "do"
21:06:23FromDiscord<Elegantbeef> Yes
21:06:25FromDiscord<aru> sent a code paste, see https://play.nim-lang.org/#ix=495j
21:06:30FromDiscord<Elegantbeef> Any code that's unused is not included in the final binary
21:06:48FromDiscord<Elegantbeef> What flags are you using?
21:07:15FromDiscord<enthus1ast> stripping?
21:07:20FromDiscord<Elegantbeef> Generally `-d:useMalloc --gc:orc, -d:release -d:lto` will get you quite far
21:07:28FromDiscord<enthus1ast> --passl\:-s
21:07:39FromDiscord<enthus1ast> or ↵strip youapp.exe
21:08:26FromDiscord<Forest [She/Her]> In reply to @aru "I mean for example": Ah, okay then
21:09:12FromDiscord<aru> sent a code paste, see https://play.nim-lang.org/#ix=495k
21:09:32FromDiscord<Forest [She/Her]> That looks cursed-
21:09:46FromDiscord<Forest [She/Her]> But if it works, it works ig? :P
21:09:48NimEventerNew thread by Deech: Captures in `peg` sub-parsers, see https://forum.nim-lang.org/t/9417
21:10:09FromDiscord<aru> hahaha yh↵(@Forest)
21:10:15FromDiscord<voidwalker> @d4rckh https://hookrace.net/blog/nim-binary-size/ from 2015, and rather simple example, not sure how much is still valid, but a nice read
21:10:50FromDiscord<enthus1ast> avoid async, and use puppy for http requests \:)
21:10:55FromDiscord<Rainbow Asteroids> sent a code paste, see https://play.nim-lang.org/#ix=495l
21:11:12FromDiscord<Forest [She/Her]> Stropping?
21:11:27FromDiscord<aru> ah yh, backticks work too instead of `""` in my example @Forest
21:11:46*Burt_Harbinson__ quit (Quit: Leaving)
21:12:05FromDiscord<Forest [She/Her]> Ah okay
21:12:07FromDiscord<aru> but they add more complexity to the macro AST
21:12:13FromDiscord<Forest [She/Her]> https://github.com/Mythical-Forest-Collective/CodeGenLib is going very well
21:12:48FromDiscord<Forest [She/Her]> Last thing to implement is functions...theeen a way to automatically wrap classes and functions
21:13:14FromDiscord<Forest [She/Her]> I have method declaration implemented, but no way to actually define them
21:14:50FromDiscord<Forest [She/Her]> (edit) "define" => "generate" | "generatethem ... " added "(in the code)"
22:29:49FromDiscord<Forest [She/Her]> How do i insert a new key value pair into an OrderedTable?
22:30:15FromDiscord<Forest [She/Her]> Order is very important but I can't figure out how to add a value into an OrderedTable once it has been initialised :p
22:31:23*rockcavera joined #nim
22:31:23*rockcavera quit (Changing host)
22:31:23*rockcavera joined #nim
22:33:04FromDiscord<sealmove> ah it's the `[]=` operator
22:33:17FromDiscord<sealmove> you do `myTable[key] = value`
22:35:11FromDiscord<Forest [She/Her]> Nvm my code was faulty that was why it didn't work-
22:35:24FromDiscord<Forest [She/Her]> In reply to @รєคɭ๓๏שє "you do `myTable[key] =": Yeah figured that out, thanks xD
22:36:38FromDiscord<Forest [She/Her]> Now, i shall rest, goodnight all!
22:37:08FromDiscord<Forest [She/Her]> Hopefully tomorrow I'll finally work on the java code generator (with a more Nim-like syntax)
22:37:13FromDiscord<Forest [She/Her]> Idiomatic
22:37:57FromDiscord<!Patitotective> 🌃
23:03:58*deadmarshal quit (Ping timeout: 244 seconds)
23:09:04FromDiscord<!Patitotective> are you there beef?
23:12:28FromDiscord<Elegantbeef> No
23:13:40FromDiscord<retkid> welp
23:14:48FromDiscord<!Patitotective> sooo beef↵(ignoring your parsing design for now)↵im doubtful about implementing the exceptions instead of my `ParseResult` because, then i would need to do a lot of catching so i was thinking in a `error` template that raises an error when the validation wasnt successful, tho how would i pass the error message?
23:15:03FromDiscord<retkid> anyone familiar with zippy, here
23:15:10FromDiscord<Elegantbeef> `msg: string`
23:15:28FromDiscord<!Patitotective> 🤓
23:16:42*sagax quit (Quit: Konversation terminated!)
23:17:03FromDiscord<retkid> so
23:17:07FromDiscord<retkid> im working with zlib and
23:17:35FromDiscord<retkid> it kinda refuses to handle any zlib streams?
23:19:43FromDiscord<retkid> https://media.discordapp.net/attachments/371759389889003532/1013951111247429641/wow.zlib
23:20:13FromDiscord<retkid> this is from a png file and I don't think there is any IEND or IDAT in there
23:49:03*deadmarshal joined #nim