<< 20-02-2023 >>

00:00:15FromDiscord<jtv> @cletus when your fielditer iterates over "dirs: seq[Edir]" the items are of type Edir, but not when you are iterating over the `files` field.
00:00:40FromDiscord<jtv> So you're calling dirsize() on a file.
00:01:55FromDiscord<huantian> Also part of it is using if instead of when like I mentioned
00:04:42FromDiscord<cletus> In reply to @jtv "<@911198173370937374> when your fielditer": Hi, thanks for replying.. but I thought the else clause in line 47 makes me to start working with Edirs?
00:04:55FromDiscord<jtv> The code gets generated for each field.
00:05:21FromDiscord<jtv> Unless you use when, not if
00:05:31FromDiscord<Haze System (they/them)> alright, figured it out, thanks :) dont fully understand how macros work yet, but figuring it out slowly
00:05:35FromDiscord<jtv> `when` is a compile-time if statement
00:05:54FromDiscord<huantian> Also again why are you using fieldPairs? Am I missing something
00:06:16FromDiscord<jtv> Agreed, that makes 0 sense, I don't pretend to understand what you're really trying to accompilish here
00:10:53FromDiscord<cletus> In reply to @huantian "Also again why are": I used fieldpairs to be able to get the values in the Edir object... Please can you teach me the correct thing I should have done
00:12:11NimEventerNew post on r/nim by FunnyEaster: Nil in Nim., see https://reddit.com/r/nim/comments/116sf7v/nil_in_nim/
00:13:03FromDiscord<jtv> In general, iterate over a directory's contents, test to see if it's a file or a directory (it can also be a link btw) and then take action depending on that. Don't understand why you need to enumerate an object's fields instead there of just accessing the fields you need at any given time
00:13:36FromDiscord<jtv> That kind of tool is not meant for many things... mainly things like generic serialization routines where you won't know the fields you need to look at in advance
00:15:09FromDiscord<cletus> sorry but I need to know the size of the Edir to be able to solve the Advent of code challenge..... the code is not for any practical purpose
00:15:35FromDiscord<jtv> Sure, you can test it at runtime, when it's a directory
00:16:09FromDiscord<jtv> You don't need to iterate over field names in an object where you're not sure what field names are going to be there
00:16:24FromDiscord<jtv> Which is the whole point of the field iteration primitives
00:16:28FromDiscord<cletus> Oh, I see!!.. I should actually implement the directory structure on my machine
00:18:11FromDiscord<jtv> No
00:18:44FromDiscord<jtv> I'm saying you should keep track of what's a file and what's a dir using separate fields and then operate on them depending on the type
00:19:16FromDiscord<jtv> You probably should be using a type variant
00:19:51FromDiscord<jtv> Assuming you're reconstructing a file system tree, where there are files at the leaves
00:20:36FromDiscord<huantian> In reply to @cletus "I used fieldpairs to": Just access the values directly
00:21:05FromDiscord<huantian> I.e. dir.files
00:21:13FromDiscord<huantian> dir.does
00:21:17FromDiscord<huantian> (edit) "dir.does" => "dir.dirs"
00:21:59FromDiscord<jtv> I'm assuming he wants to have a tree with some "node" object as children that may have children if it's a directory... thus, would use a variant type
00:22:22FromDiscord<huantian> the current setup should work though
00:22:46*derpydoo quit (Quit: derpydoo)
00:23:04FromDiscord<jtv> Sure, just trying to help cletus learn to structure things a bit more naturally by learning about some of the common features they should know about 🙂
00:24:04FromDiscord<huantian> sent a code paste, see https://play.nim-lang.org/#ix=4oBh
00:24:06FromDiscord<huantian> this should work I think?
00:24:16FromDiscord<huantian> (asking jtv, spoilering so I don't spoil the solution for you hehe)
00:24:46FromDiscord<cletus> In reply to @jtv "I'm saying you should": Thanks a lot, let me do that....... Just in case anyone is wondering, implementing the filesystem on your machine is so horrible: https://gist.github.com/Uzo2005/4f1ae3d256d999a199161278a48bb1ce, this code drops a 15Gb directory on your machine!!! 😆
00:25:42FromDiscord<jtv> I mean, it'll work given the bit that's there, but still needs to do the parsing and get the file system model right, which pretty much has to be a tree of some sort, and that isn't there yet
00:25:45FromDiscord<jtv> So hard to say
00:25:51FromDiscord<cletus> In reply to @huantian "Just access the values": Thanks a lot... in hindsight, this was what I should have done, Thanks again
00:26:06FromDiscord<huantian> In reply to @jtv "Sure, just trying to": true I think I solved it this way myself
00:29:17FromDiscord<Hourglass [She/Her]> Do shared libraries have major performance dips?
00:29:24FromDiscord<jtv> No
00:29:45FromDiscord<huantian> executables do tho so you might want to avoid those /j
00:30:49FromDiscord<Hourglass [She/Her]> So there's no point to make it so my system could be compiled together as a single binary?
00:32:20FromDiscord<Hourglass [She/Her]> (What's funny is how easily it'd work, since the main thing my plugin system relies on is a `plugin` object and `symAddr`(?) on `LibHandle`, which I can probably abuse by using a concept and some macro hell
00:32:41FromDiscord<jtv> The main reason you might choose static linking is if you're afraid people might not be able to get the dynamically loaded dependencies working, or might have some sort of versioning conflict problems
00:32:57Amun-Rathat's what I'd doing in my project, symaddrs
00:33:44FromDiscord<Hourglass [She/Her]> Versioning conflicts?
00:33:59FromDiscord<Elegantbeef> Most people choose it cause "one file good"↵(@jtv)
00:34:38FromDiscord<jtv> Yes, @ElegantBeef we are saying the same thing. One file is good particularly because dealing w/ dependencies can lead to problems
00:34:49FromDiscord<Elegantbeef> No you misunderstand
00:34:56FromDiscord<Elegantbeef> I mean the sole reason they use it is cause "one file good"
00:35:22FromDiscord<Elegantbeef> The fact it handles dependency issues is unrelated
00:35:24FromDiscord<jtv> @Hourglass [She/Her] Yes, let's say you're dynamically linking to libssl.so
00:35:39FromDiscord<jtv> There are many different versions that can be present, sometimes at the same time
00:36:32FromDiscord<jtv> Well, getting something that's truly fully static w/o even a libc dependency is a bit of a PITA, musl has some gaps relative to standard libc
00:36:43FromDiscord<Hourglass [She/Her]> In reply to @Elegantbeef "I mean the sole": I mean, it's good if someone knows nothing about how to install the dependencies ig?
00:36:54FromDiscord<Hourglass [She/Her]> In reply to @jtv "Well, getting something that's": Fair
00:37:45FromDiscord<jtv> Frankly, I'd rather just ship a single binary whenever possible, and not worry about the dependency management. There's a reason golang for a long time ONLY generated static binaries and skipped libc, etc
00:38:16FromDiscord<Elegantbeef> Yea the benefits for static linking are quite nice 😄
00:38:17FromDiscord<jtv> But there are good use cases for dynamic linking as well.
00:38:36FromDiscord<jtv> Yup, especially link time optimizations if you're not doing any dynamic loading
00:38:52FromDiscord<Hourglass [She/Her]> In reply to @jtv "Frankly, I'd rather just": That's fair enough
00:39:17FromDiscord<Hourglass [She/Her]> Hm... Hey Beef, how would I abuse macro hell to implement 'symAddr' for a Nim file?
00:39:25FromDiscord<Elegantbeef> What?
00:41:04FromDiscord<Iliketwertles> is there any integrated way to reboot with nim? or anything to do with users like logging out and such
00:42:05FromDiscord<Hourglass [She/Her]> Basically, my plugin system relies on `symAddr` from `dynlib` for getting the procs it needs, since it loads shared libraries↵↵But in theory, I could compile the plugins and the server together (and a bit of hackery to register a plugin), but I'd need to be able to implement `symAddr` for accessing procs in a module
00:42:08FromDiscord<Hourglass [She/Her]> Hm actually
00:43:08FromDiscord<Hourglass [She/Her]> I can't actually test this idea rn but i definitely have a way to implement it :p
00:43:23FromDiscord<jtv> That's super OS dependent, @Iliketwertles. Linus has a reboot() system call for instance, but it's not portable
00:44:08FromDiscord<jtv> Most people would just run a shell command from the language for unix machines (shutdown) which will be more portable, than do something else from Windows
00:44:30*sagax quit (Quit: Konversation terminated!)
00:44:44FromDiscord<jtv> I mean, if you want to statically compile, why the heck use a plugin system?
00:44:56FromDiscord<Iliketwertles> could i use the reboot() system call somehow?
00:45:02FromDiscord<jtv> Link-time optimization can ensure you pay no price for the stuff you don't use
00:45:18FromDiscord<jtv> Sure, via importc
00:45:19FromDiscord<Iliketwertles> i dont intend to support windwos
00:45:22FromDiscord<Iliketwertles> (edit) "windwos" => "windows"
00:46:29FromDiscord<jtv> I don't remember the prototype for reboot, you'd have to man it, but on the nim side you'd use the cdecl / importc pragmas
00:46:37FromDiscord<Hourglass [She/Her]> In reply to @jtv "I mean, if you": Curiosity and because I can? :P
00:47:35FromDiscord<Hourglass [She/Her]> Theoretically both could be supported anyway, and since it should be possible to use my Minecraft server impl as a library, you could easily bundle in plugins perhaps?
00:49:19FromDiscord<Hourglass [She/Her]> In reply to @jtv "Link-time optimization can ensure": How does link-time optimisation work? Since I'm loading shared libraries with `loadLib`
00:49:22FromDiscord<jtv> Personally I just would focus on the important functionality before the stuff you might consider when you have tons of users. You'll get discouraged less quickly if you're making something where you can show of the value faster 🙂
00:49:37FromDiscord<Hourglass [She/Her]> Fair, that's a good point
00:49:49FromDiscord<jtv> Generally if you can load things after main() is called, you don't use link-time optimization
00:50:14FromDiscord<Iliketwertles> sent a code paste, see https://play.nim-lang.org/#ix=4oBn
00:50:17FromDiscord<Iliketwertles> might be called something other than reboot
00:50:21FromDiscord<Iliketwertles> but the general idea
00:50:31FromDiscord<Hourglass [She/Her]> I should focus on getting the packet generation working first then work on implementing the login sequence and then everything else
00:50:40FromDiscord<jtv> The compiler essentially keeps info around and the loader essentially calls it to act depending on what's being linked.
00:50:55FromDiscord<jtv> So, for instance, if a call only ever gets called once, it can be fully inlined
00:51:22FromDiscord<jtv> Lots of things you can do once you've effectively "sealed" what's going into the executable
00:51:54FromDiscord<jtv> But if you use dlopen() (including dynlib, which uses it), you aren't ever doing that because the loader cannot know
00:52:18FromDiscord<Hourglass [She/Her]> Yeah that makes sense
00:53:01FromDiscord<Hourglass [She/Her]> So then my code would not work with lto because obviously, dynlib
00:54:03FromDiscord<jtv> @Iliketwertles I believe that, despite explicitly specifying the implementation is in C, you still need to specify the calling convention as cdecl
00:54:13FromDiscord<jtv> And I am pretty sure reboot() takes at least one parameter
00:54:25FromDiscord<jtv> If you don't get that right, expect a crash
00:54:45FromDiscord<Iliketwertles> seems to complicated when i can just pass a shell command tbh
00:54:49FromDiscord<Iliketwertles> prob just gonna do that
00:55:19FromDiscord<jtv> It's a good skill to have, and it really is a one-liner
00:55:50FromDiscord<jtv> On my linux box, I see: int reboot(int magic, int magic2, int cmd, void arg);
00:55:58FromDiscord<jtv> But on my mac it's int reboot(int magic);
00:55:58FromDiscord<Iliketwertles> luckily regardless of init system, `reboot` works assuming proper privilages are granted to the given user
00:56:17FromDiscord<Iliketwertles> linux wise at least
00:56:41FromDiscord<jtv> So you'd have to declare your nim function to take (cint, cint, cint, pointer)
00:57:20FromDiscord<jtv> There is a glibc reboot() that only takes the one int like the os x version, so that's easier and more portable I guess
00:58:58FromDiscord<Elegantbeef> sent a code paste, see https://play.nim-lang.org/#ix=4oBo
00:59:19FromDiscord<Hourglass [She/Her]> That is indeed code Beef
00:59:31FromDiscord<Hourglass [She/Her]> More work on your Nim to C lib?
00:59:58FromDiscord<jtv> sent a code paste, see https://play.nim-lang.org/#ix=4oBp
01:00:54FromDiscord<Elegantbeef> Yes
01:01:18FromDiscord<Hourglass [She/Her]> Sounds fun if you like pain
01:01:34FromDiscord<jtv> @ElegantBeef hangs out here, so clearly likes pain 🙂
01:01:48FromDiscord<Elegantbeef> I mean it presently isnt too bad
01:02:01FromDiscord<Elegantbeef> I am reusing a lot of cgen, but adapting it for my usees
01:02:39FromDiscord<Elegantbeef> I'm mostly just bodging this together so far and it's like \< 400 loc
01:03:48FromDiscord<Elegantbeef> Nim does have the now deprecated `--header` parameter, but it's supposed to not be used
01:07:54FromDiscord<Hourglass [She/Her]> Are they removing it in 2.0?
01:09:31FromDiscord<Elegantbeef> I do wonder what the best for ABI is, I'm thinking forcing `cdecl` on all procs and using packed on objects....
01:09:50FromDiscord<Elegantbeef> Not that i know of
01:09:56FromDiscord<Elegantbeef> Deprecated just means "do not use" mostly
01:09:59FromDiscord<Elegantbeef> Also it will not be supported
01:13:37FromDiscord<Hourglass [She/Her]> Ah
01:15:37FromDiscord<Patitotective> i'm kind of confused with `char`s because `char.high` is 255 but `'ñ'` is invalid↵does `char` actually only works until 127 or am i messing something up? :/
01:18:11FromDiscord<Elegantbeef> It might only support ascii inside character literals
01:19:13FromDiscord<Elegantbeef> It's a good first issue
01:19:36*brobot quit (Remote host closed the connection)
01:23:47FromDiscord<Patitotective> In reply to @Elegantbeef "It might only support": i don't get what you mean, isn't `ñ` also ascii? i read that ascii was at first only 7-bit thus 128 characters but aren't nim chars 8-bit?
01:23:58FromDiscord<Elegantbeef> ascii extended
01:24:19FromDiscord<Elegantbeef> Ascii is only 127 characters, ascii extended is 255
01:24:40FromDiscord<Elegantbeef> `char` is a unsigned byte, but the lexer does not properly lex the character
01:24:49FromDiscord<Elegantbeef> Hence why i said it's a good first issue
01:25:01FromDiscord<Patitotective> oh ok
01:26:39FromDiscord<Elegantbeef> you can luckily do `'\244'` or w/e
01:42:47*xet7 quit (Quit: Leaving)
01:46:23FromDiscord<emmikat> i was able to get an async socket across threads by calling getFd, unregistering, starting a thread, and registering
01:46:37FromDiscord<emmikat> this seems like it should be generally stable
01:48:24FromDiscord<emmikat> is there any reason it wouldn't be?
01:49:08FromDiscord<Elegantbeef> Only time will tell
01:49:20FromDiscord<emmikat> lmao okey
01:49:27FromDiscord<emmikat> i'll impl it
01:49:44FromDiscord<emmikat> i implemented it in a test app and it seems fine
01:50:07FromDiscord<emmikat> i did try seeing what happened recving on multiple threads and rhe last one started got all the messages
01:50:08FromDiscord<sOkam!> sent a code paste, see https://play.nim-lang.org/#ix=4oBB
01:50:18FromDiscord<Elegantbeef> `varags`
01:50:21FromDiscord<Elegantbeef> `varargs` even
01:50:27FromDiscord<emmikat> and making the last one exit dropped me to the second last
01:50:30*derpydoo joined #nim
01:50:36FromDiscord<emmikat> trying to exit that one segfaulred
01:50:57FromDiscord<emmikat> oh esp because it was a buffered socket lol
01:51:11FromDiscord<sOkam!> In reply to @Elegantbeef "`varargs` even": where does that go? in the field? does the parameter have a name? or does it go in the importc properties?
01:51:27FromDiscord<Elegantbeef> https://nim-lang.org/docs/manual.html#foreign-function-interface-varargs-pragma
01:52:21FromDiscord<sOkam!> sent a code paste, see https://play.nim-lang.org/#ix=4oBC
01:58:32FromDiscord<heinthanth> sent a code paste, see https://play.nim-lang.org/#ix=4oBF
01:59:10FromDiscord<heinthanth> I need to check `fnName` is declared because I want to generate another code if it's not declared yet.
01:59:18FromDiscord<Elegantbeef> I'd say do not use bind sym
02:00:02FromDiscord<Elegantbeef> sent a code paste, see https://play.nim-lang.org/#ix=4oBG
02:01:23FromDiscord<heinthanth> sent a code paste, see https://play.nim-lang.org/#ix=4oBI
02:01:35FromDiscord<Elegantbeef> Yes i'm saying emit that code i showed
02:04:21FromDiscord<heinthanth> sent a code paste, see https://play.nim-lang.org/#ix=4oBJ
02:05:36FromDiscord<heinthanth> sent a code paste, see https://play.nim-lang.org/#ix=4oBK
02:06:43FromDiscord<heinthanth> The first variant is shorter. That's why I'm finding a way to check sym
02:08:02FromDiscord<heinthanth> Anyway, Thanks ... I gonna try to emit `when declared()`
02:08:25FromDiscord<Elegantbeef> Yep that's more sane then using bindSym + dynamic bind
02:08:27FromDiscord<Elegantbeef> I'd personally use distinct typing with a converter for this but to each their own 😄
02:10:52FromDiscord<Elegantbeef> sent a code paste, see https://play.nim-lang.org/#ix=4oBM
02:10:56FromDiscord<Elegantbeef> Something like this is a bit more sane imo, but ymmv 😄
02:11:23FromDiscord<Elegantbeef> Using the type system to convert down instead of a macro
02:11:42FromDiscord<Elegantbeef> Though i guess you're avoiding a case statement
02:11:46FromDiscord<Elegantbeef> So this doesnt help much
02:16:55FromDiscord<Yepoleb> In reply to @emmikat "i was able to": That should work quite well
02:17:12*brobot joined #nim
02:17:30FromDiscord<Yepoleb> About as clean as it gets
03:11:36NimEventerNew thread by DougT: Question on GTK3 mouse processing, see https://forum.nim-lang.org/t/9912
03:56:13FromDiscord<emmikat> In reply to @Yepoleb "About as clean as": yayyy neat
03:56:39*arkurious quit (Quit: Leaving)
03:57:15*rockcavera quit (Remote host closed the connection)
04:28:59*dropkick quit (Ping timeout: 248 seconds)
04:49:46*pbsds quit (Ping timeout: 252 seconds)
04:53:53*azimut quit (Ping timeout: 255 seconds)
05:22:44*pbsds joined #nim
06:02:45*ltriant quit (Ping timeout: 255 seconds)
06:38:24*brobot quit (Quit: ERROR STOP)
07:17:03*kenran joined #nim
07:41:51FromDiscord<Phil> Could somebody give me a rundown what the deadcodeelim pragma did?↵Folks want to remove it off the ndb fork and I officially have no clue what implications that code change has
07:43:28FromDiscord<amadan> Basically it would turn on Nim's dead code eliminator (i.e. remove functions that aren't used)↵But that has been the default for ages and doesn't do anything anymore
07:44:10FromDiscord<amadan> https://github.com/nim-lang/Nim/pull/21277 is now deprecated on devel, don't think it has done anything for a while though
07:44:50FromDiscord<amadan> (edit) "Basically it would turn on Nim's dead code eliminator (i.e. remove functions ... thatisn't" added "and other stuff" | "aren't" => "isn't"
07:45:04FromDiscord<Elegantbeef> Correct it hasnt done anything since before 1.0
07:49:30FromDiscord<Phil> Tests Say okay, I'll push the button once off work
07:52:44FromDiscord<Elegantbeef> This reminds me of the compile time version of this..... lazy sem
07:52:57FromDiscord<Elegantbeef> I learned recently that zig uses lazy semantic analysis
07:53:26FromDiscord<Elegantbeef> sent a code paste, see https://play.nim-lang.org/#ix=4oCp
07:55:34FromDiscord<ringabout> When it comes to experimental features, `experimental:codeReordering` will not work at the top level, so it might be removed from `db_connector/db_sqlite` https://github.com/nim-lang/db_connector/issues/16 and no more silly warnings like "Warning: Circular dependency detected. `codeReordering` pragma may not be able to reorder some nodes properly".
07:56:01FromDiscord<ringabout> (edit) "properly"." => "properly" for simply importing `import db_connector/db_sqlite`."
07:56:24FromDiscord<Phil> What does that change for db_? Does that lead to limitations?
07:57:24FromDiscord<ringabout> `db_connector/db_sqlite` uses `{.experimental: "codeReordering".}`, but is not needed ad should be replaced with forward declarations.
07:57:36FromDiscord<ringabout> (edit) "ad" => "and"
07:59:22FromDiscord<ringabout> In reply to @Isofruit "What does that change": Yeah, the parsing stragtegy might change, using `{.experimental: "codeReordering".}` at the top level won't work anymore, which needs to pass it explicitly on the command line: `--experimental:codeReordering`.
08:01:05*PMunch joined #nim
08:12:08FromDiscord<4zv4l> sent a code paste, see https://play.nim-lang.org/#ix=4oCz
08:14:01FromDiscord<Elegantbeef> `except CatchableError: ....`
08:14:40FromDiscord<4zv4l> what does it change ?
08:15:01FromDiscord<Rika> You can only catch catchable errors?
08:15:17FromDiscord<4zv4l> well if I cannot catch them it will just crash anyway right ?
08:15:33PMunchUgh, why is the bare except clause deprecated <_<
08:15:46FromDiscord<Elegantbeef> Cause Defects exist
08:15:57FromDiscord<Elegantbeef> And people can catch them
08:15:59PMunchIt should rather default to CatchableError and then have to explicitly say except Defect to catch those
08:16:25FromDiscord<Elegantbeef> The issue is that changes the behaviour
08:16:33PMunch(maybe with a nice hint that catching defects is a bad idea)
08:16:39FromDiscord<Elegantbeef> So code behaviour changes slightly that is nigh undetectable 😄
08:16:57PMunchSounds like a good change for 2.0 then
08:17:27FromDiscord<Elegantbeef> I mean I agree that bear should be CatchableError
08:17:30FromDiscord<Elegantbeef> bare even
08:17:31PMunchAnd the only behaviour that changes is for people who catches defects, which they shouldn't do anyways..
08:17:44FromDiscord<Elegantbeef> Except due to lack of education people do
08:17:55FromDiscord<Elegantbeef> `--panics:on` default please 😄
08:18:23PMunchYeah panics:on and bare except means CatchableError should really be in Nim 2.0
08:19:01PMunchThe decision has already been made that there are errors you should be able to catch and those you shouldn't be able to catch. No reason to default to allow catching uncatchable errors
08:19:27FromDiscord<Rika> I think it is unreasonable to have this change for as long as defects aren’t tracked by raises
08:19:42FromDiscord<Rika> Or tracked in another way of course
08:20:19FromDiscord<ringabout> There are still cases which need to catch everything like assertions and unittests.
08:21:24FromDiscord<ringabout> Perhaps in that case, we need a new pragmas like `except {.all.}`.
08:21:34FromDiscord<ringabout> (edit) "pragmas" => "pragma"
08:25:46FromDiscord<Elegantbeef> The complexity of that joke is too high i know 😄
08:26:12FromDiscord<BobBBob> say, why does the generated html docs have a semicolon separating func parameters?
08:26:24FromDiscord<Elegantbeef> It's more clear
08:26:43FromDiscord<Elegantbeef> It's an alternative syntax that is valid
08:27:03FromDiscord<BobBBob> But like why?
08:27:09FromDiscord<Elegantbeef> I just said why
08:27:18FromDiscord<BobBBob> It doesnt do that for procs, what's the difference
08:27:42FromDiscord<Elegantbeef> Are you sure?
08:27:49FromDiscord<Elegantbeef> https://github.com/nim-lang/Nim/blob/version-1-6/lib/pure/hashes.nim#L75
08:27:52FromDiscord<Elegantbeef> image.png https://media.discordapp.net/attachments/371759389889003532/1077144543486545960/image.png
08:27:54FromDiscord<BobBBob> oh Im looking at something else
08:28:24FromDiscord<BobBBob> so is it recommended to use ; in code or what?
08:28:38FromDiscord<Elegantbeef> Whoops i grabbed the wrong image
08:28:39FromDiscord<Elegantbeef> It's up to you
08:28:42FromDiscord<Elegantbeef> It's more clear
08:28:55FromDiscord<Elegantbeef> I personally never use `;` in anything but generic parameters where it's required
08:29:22FromDiscord<BobBBob> I see
08:55:57FromDiscord<4zv4l> sent a code paste, see https://play.nim-lang.org/#ix=4oCJ
08:56:01PMunch@ringabout, or just `except Exception` which would catch both Defects and CatchableErrors. This RFC is pretty much exactly what I'd want https://github.com/nim-lang/RFCs/issues/360
08:57:49PMunchHuh, I thought NEP-1 said semicolon between args, but I can't find it
08:58:12*randomuser464876 joined #nim
08:58:54PMunchThe argument goes that separating by `;` is more clear and will prevent you from accidentally forgetting a type. `proc test(x, y: int)` is valid and now both x and y are integers, but `proc test(x; y: int)` is invalid.
08:59:33PMunchBut yeah, it's not very commonly used, I think Araq is amongst the few
09:00:42FromDiscord<ringabout> It used in the compiler I think. I saw a few.
09:04:32FromDiscord<arnetheduck> In reply to @PMunch "<@658563905425244160>, or just `except": given that 360 was not accepted, the second best option would be to have `except:` map to `except CatchableError:` and not catch defects - this was deemed unacceptable, so the warning is the least bad option remaining - all of these issues hail from the general unsoundness of the exception hierarchy: there are too many conflicting predicates upon which this whole mess
09:06:20FromDiscord<arnetheduck> ergo, the only remaining sound option is to avoid exceptions entirely or live with the warts 🙂
09:08:58PMunchHmm, that's unfortunate..
09:09:14PMunchI'd much rather we actually overhauled the system for 2.0 and broke some code
09:09:23FromDiscord<ringabout> Yeah, it is also not on the Roadmap 2023. I probably won't work on exceptions recently. This week, I'm going to try removing passes from the compiler, which is also part of the Roadmap.
09:09:25FromDiscord<arnetheduck> fun fact: `CatchableError` was deliberately chosen as an ugly name that people would never use in code, except to declare deriving exceptions
09:09:32PMunchIt's a painful band-aid to rip, but it would be worth it
09:10:25PMunchQuite silly that `CatchableError` has the ugly name and `Defect` is the name for the one you really shouldn't be using..
09:11:38FromDiscord<4zv4l> sent a code paste, see https://play.nim-lang.org/#ix=4oCN
09:11:39PMunchHmm, is there any way to tell Nim that it should clear out all memory? The scenario is a dynamic library unloading, the process won't quit, so the memory isn't auto-freed, so I think Nim would keep global variables around
09:12:40FromDiscord<arnetheduck> In reply to @4zv4l "is there a way": `if (let a = someStuff; a): echo a` - `a` has to be a boolean though
09:12:49PMunchhttps://play.nim-lang.org/#ix=4oCO
09:12:59PMunch@4zv4l ^
09:13:55FromDiscord<arnetheduck> we use that construct when avoiding exceptions: `if (let x = someResult(); x.isOk): echo x.get()`
09:14:26FromDiscord<ringabout> In reply to @PMunch "Hmm, is there any": I don't know. See also https://discord.com/channels/371759389889003530/768367394547957761/878342840650985513
09:17:09FromDiscord<ringabout> > when should globals be destroyed ? for dynamically loaded libraries, IMO we should destroy globals when the library is unloaded
09:18:22FromDiscord<4zv4l> In reply to @arnetheduck "we use that construct": `isOK` is to check if it's nil or not ?
09:18:36FromDiscord<4zv4l> In reply to @arnetheduck "`if (let a =": not a boolean unfortunately xD
09:19:33FromDiscord<arnetheduck> In reply to @4zv4l "`isOK` is to check": if you want to check for nil, check for nil: `if (let x = someRef(); x != nil): ...`
09:23:12FromDiscord<ringabout> The I will recommend to (mis)use converters in this case for fun 😜 https://nim-lang.org/docs/manual.html#converters
09:25:18FromDiscord<ringabout> sent a code paste, see https://play.nim-lang.org/#ix=4oCQ
09:28:22FromDiscord<4zv4l> sent a code paste, see https://play.nim-lang.org/#ix=4oCS
09:29:07PMunch@ringabout, yeah I believe there should be destructors for globals added in a `__attribute((destructor))__` call (Or DllMain with DL_PROCESS_DETACH check), but analogous to --noMain there should be a --noQuit and allow us to import it and call it manually like we can for NimMain
09:29:15FromDiscord<4zv4l> cast did the trick
09:30:19PMunchYou cast a non-bool to a bool?
09:30:41FromDiscord<amadan> sent a code paste, see https://play.nim-lang.org/#ix=4oCT
09:30:57FromDiscord<4zv4l> In reply to @PMunch "You cast a non-bool": oh that was with the UINT
09:31:35*Mister_Magister quit (Quit: bye)
09:31:48PMunchRight..
09:32:38FromDiscord<ringabout> In reply to @PMunch "<@658563905425244160>, yeah I believe": @PMunch, I agree.
09:33:06FromDiscord<ringabout> In reply to @amadan "Implement pythons walrus if": Cool
09:33:36PMunchHmm, I guess in the meantime calling `GC_unref` on all globals and then a `GC_FullCollect` would work
09:33:36*Mister_Magister joined #nim
09:33:37PMunchMaybe
09:34:50FromDiscord<4zv4l> how do I make a cstring of a certain size ?
09:35:02PMunchalloc0()
09:35:31PMunchWell, you could also pass `myString[0].addr`
09:35:49FromDiscord<4zv4l> `var filename = newString(260).cstring`↵is this valid ?
09:37:05PMunchWell, kinda
09:37:19PMunchIt is valid as in your code should compile
09:37:33PMunchBut that string now doesn't have any references so the GC will just collect it
09:38:13PMunch`var filename = cast[cstring](alloc0(260))` there you manually allocate 260 bytes, these then have to be freed later on
09:38:18FromDiscord<Rika> sent a code paste, see https://play.nim-lang.org/#ix=4oCW
09:43:28*randomuser464876 quit (Ping timeout: 260 seconds)
09:45:30FromDiscord<4zv4l> sent a code paste, see https://play.nim-lang.org/#ix=4oCZ
09:46:23*randomuser464876 joined #nim
09:47:18FromDiscord<4zv4l> is the problem `SHSTDAPI_` ?
09:47:58FromDiscord<4zv4l> which is defined to `STDAPI_(type)`
09:48:28FromDiscord<4zv4l> oh no
09:48:37FromDiscord<4zv4l> it's defined as↵`#define SHDOCAPI_(type) DECLSPEC_IMPORT type STDAPICALLTYPE`
09:49:02FromDiscord<4zv4l> (edit) "SHDOCAPI_(type)" => "SHSTDAPI_(type)"
09:49:23FromDiscord<4zv4l> how can I fix that ?
09:54:33FromDiscord<Rika> most of us are not acquainted with the windows api
09:58:40FromDiscord<sOkam!> I'm using the compile pragma to compile two different C files both called `core.c`, which are part of their respective `one` and `two` subfolders, but instead of being built as `nimcache/[email protected]` they both end up as `nimcache/core.c.o` and crash the linker due to repeated symbols↵Is there a way to instruct the compile pragma to output with a unique name, or to a different folder, so this doesn't happen, without having to rename the
09:59:37*ltriant joined #nim
09:59:49FromDiscord<demotomohiro> sent a code paste, see https://play.nim-lang.org/#ix=4oD5
10:03:43*ltriant quit (Ping timeout: 246 seconds)
10:09:10PMunchsOkam, there seems to be a way to pass separate flags: https://nim-lang.org/docs/manual.html#implementation-specific-pragmas-compile-pragma
10:09:29PMunchBut not sure if Nim would find it if you compiled it to a different location :P
10:19:56PMunch@ringabout, created an issue to track this: https://github.com/nim-lang/Nim/issues/21403
10:20:27FromDiscord<ringabout> Nice!
10:22:41*ltriant joined #nim
10:22:52Amun-RaPMunch: you can't be even sure all the memory is freed by dclose in plain old C
10:23:05Amun-RaSDL2 is the perfect example
10:23:39Amun-Rabut I see the issue
10:23:40FromDiscord<4zv4l> In reply to @demotomohiro "You probably need to": I changed from `shellapi.h` to `shell32` and it worked
10:38:03FromDiscord<federico3> https://arxiv.org/abs/2302.05331 "C-rusted\: The Advantages of Rust, in C, without the Disadvantages"
10:41:35FromDiscord<federico3> the table about tooling and code reuse, portability, and incremental adoption could be relevant for Nim
11:28:34FromDiscord<Hourglass [She/Her]> What's a clever name for a NBT library in Nim :p
11:29:09FromDiscord<Hourglass [She/Her]> I've named my Minecraft packet wrapping library as `Napkins`, the server itself is called `Nimberite`
11:33:57*azimut joined #nim
11:43:14NimEventerNew thread by WizardUli: Heap fragmentation, embedded systems, see https://forum.nim-lang.org/t/9914
11:45:04*crem1 quit (Quit: WeeChat 3.7.1)
11:51:17FromDiscord<4zv4l> sent a code paste, see https://play.nim-lang.org/#ix=4oDt
11:51:34FromDiscord<4zv4l> because when I add this to my dll it doesn't wanna load anymore
11:52:23FromDiscord<Rika> i dont see how that would happen
12:02:00FromDiscord<4zv4l> well when I add an iterator it's makes my dll unable to load idk why
12:07:19FromDiscord<4zv4l> oh it's `copyFile` that does that
12:09:11FromDiscord<4zv4l> why would `copyFile` make that error
12:09:34FromDiscord<4zv4l> `[-] LoadLibrary(): 126`↵I cannot load the dll if I add `copyFile` lmao
12:23:21*jmdaemon quit (Ping timeout: 252 seconds)
12:23:38FromDiscord<Hourglass [She/Her]> sent a code paste, see https://play.nim-lang.org/#ix=4oDF
12:23:44FromDiscord<Hourglass [She/Her]> I'm defining it in a constant
12:24:06FromDiscord<Hourglass [She/Her]> So it's `const LOOKUP = {"varint": "int32", ...}`
12:24:40FromDiscord<Hourglass [She/Her]> I need to use it as a constant for macro stuff, and I'm pretty sure `Table`s don't work at compile time when i tried it
12:32:16FromDiscord<Hourglass [She/Her]> Nvm seems like `Table`s do work at compile time, it was my bad code last time
12:32:44FromDiscord<Phil> Yeah, I've used tables at compiletime plenty of times
12:34:52FromDiscord<Hourglass [She/Her]> Joy, I need to implement bitfield support
12:36:20FromDiscord<Hourglass [She/Her]> What is the `void` type?
12:42:07PMunchWait, @ringabout is planety?
12:42:14FromDiscord<demotomohiro> It means procedures dont return a value
12:46:07*derpydoo quit (Ping timeout: 252 seconds)
12:47:12FromDiscord<System64 ~ Flandre Scarlet> Hi, is it possible to overload an operator? if yes, how?
12:47:30FromDiscord<Hourglass [She/Her]> In reply to @demotomohiro "It means procedures dont": I'm assuming that's implicit then
12:48:31FromDiscord<Phil> In reply to @System64 "Hi, is it possible": Depends, is it an operator that is not yet defined?
12:48:38FromDiscord<Hourglass [She/Her]> sent a code paste, see https://play.nim-lang.org/#ix=4oDK
12:48:59FromDiscord<Hourglass [She/Her]> Should work for all operators defined in Nim, as long as it doesn't conflict with another proc
12:49:05FromDiscord<System64 ~ Flandre Scarlet> In reply to @Isofruit "Depends, is it an": No, the + operator as Hourglass said
12:49:38FromDiscord<Hourglass [She/Her]> What I posted should work, just make sure you use backticks
12:50:08FromDiscord<Phil> sent a code paste, see https://play.nim-lang.org/#ix=4oDM
12:51:04FromDiscord<Yepoleb> In reply to @PMunch "Wait, <@658563905425244160> is planety?": Yes
12:51:28FromDiscord<Phil> Given we have planetis rolling around that is super confusing
12:51:42FromDiscord<Phil> I thought planetis was the original owner and ringabout took over maintenance
12:52:38FromDiscord<sOkam!> In reply to @PMunch "sOkam, there seems to": flags don't change the filename that is being output by gcc
12:52:58FromDiscord<sOkam!> (edit) "gcc" => "nimc/gcc"
12:53:44FromDiscord<sOkam!> they come from different folders, so should be named as such to avoid clashes, but they aren't so the linker just gets confused
12:56:57FromDiscord<sOkam!> is there a way to convert a `cstring` to a `clong`?↵basically the C code expects an `intptr_t`, which is a clong, but the function wrapped returns a `char` which I was mapping as a cstring↵but now I realize that the pointer needs to be converted to clong, because the interface only works with ints 🤔
12:57:20FromDiscord<sOkam!> (edit) "is there a way to convert a `cstring` to a `clong`?↵basically the C code ... expects" added "I'm wrapping"
12:57:42FromDiscord<Hourglass [She/Her]> What'd be the best way to represent bitfields in Nim?
12:58:03FromDiscord<sOkam!> can i just `cast[clong](theCString)` and call it a day, or is that going to crash?
12:58:11PMunchThis explains where @ringabout came from. I thought it was a bit strange that someone I had never heard of suddenly where contributing good stuff to the Nim compiler :P
12:58:57PMunchsOkam, uhm, why do you expect that to work?
12:59:04PMunchA clong?
12:59:10FromDiscord<sOkam!> clong is just an int
12:59:26PMunchI know
12:59:30FromDiscord<ringabout> Yeah, @PMunch btw how is the Mod team going?
12:59:42FromDiscord<sOkam!> the closest int similar to intptr_t, so i figured that if i can get the address casted to clong it should work, but don't know how
13:00:06PMunchI mean you should probably do `myCstr.addr.clong` or something. Might need a cast, not sure if addr can be converted to an integer
13:00:29FromDiscord<ringabout> In reply to @Isofruit "I thought planetis was": Lol, just coincidence
13:00:30FromDiscord<sOkam!> kk
13:00:40PMunch@ringabout, going good. Just recently added @Yepoleb as a moderator, and we're looking into adding more people
13:01:12PMunchAnd of course we got the Matrix anti-spam measures up and running, which has improved the spam situation *a lot*
13:01:29FromDiscord<Phil> Nice!
13:02:13FromDiscord<ringabout> In reply to @PMunch "<@658563905425244160>, going good. Just": Great!
13:08:26FromDiscord<sOkam!> sent a code paste, see https://play.nim-lang.org/#ix=4oDU
13:08:35FromDiscord<sOkam!> (edit)
13:14:15FromDiscord<ringabout> Use procs if you have to use addrs.
13:15:44FromDiscord<sOkam!> wouldn't a proc return the local address of the string inside the proc?
13:16:05FromDiscord<sOkam!> or is it going to know that the original address is what needs to be returned?
13:17:55FromDiscord<demotomohiro> How about to `proc caddr(str: var cstring): clong = cast[clong](str.unsafeAddr)`?
13:18:27FromDiscord<sOkam!> `nimpretty thefile.nim` 🤷‍♂️
14:24:07PMunchLooked around for inspiration for what to name my logging library. Which led me to the Norwegian Wikipedia article on logging (like felling trees). These illustrations are magnificent: https://no.wikipedia.org/wiki/Trefelling
14:28:38FromDiscord<auxym> is that the old school MS Paint spray tool? 😄
14:29:39FromDiscord<Rika> wtf is that illustration lmfaop\
14:29:41FromDiscord<Rika> (edit) "lmfaop\" => "lmfao"
14:31:13PMunchYup, it's basically an MS Paint illustration of how to fell a tree :P
14:42:21FromDiscord<auxym> memories of usig win95 when I was 8yo, lol
14:45:22FromDiscord<Gumbercules> Windows still has paint you know...
14:47:21*peterhil quit (Quit: WeeChat 3.8)
14:49:11PMunchBut who still uses Windows, haven't you heard it's the year of Linux on desktops :P
14:57:45NimEventerNew thread by Nlits: Using nimble as a library, see https://forum.nim-lang.org/t/9916
14:59:41PMunchIt's so great to have NimEventer back :)
15:08:55*PMunch quit (Quit: Leaving)
15:24:43FromDiscord<ringabout> In reply to @NimEventer "New thread by Nlits:": @Phil, your chance, haha
15:24:50FromDiscord<ringabout> (edit) "@Phil," => "@Phil hil,"
15:24:58FromDiscord<ringabout> (edit) "hil," => ""
15:27:17*sagax joined #nim
15:29:50*arkurious joined #nim
15:46:50*kenran quit (Remote host closed the connection)
15:59:10FromDiscord<Phil> I was born for this moment!
16:00:59FromDiscord<ringabout> Precisely, it must be fate
16:09:08FromDiscord<enthus1ast> @Phil\: ^
16:10:20FromDiscord<ringabout> Is this only me or messages are lost?
16:10:50FromDiscord<ringabout> https://media.discordapp.net/attachments/371759389889003532/1077261053592866857/image.png
16:11:04FromDiscord<enthus1ast> https://github.com/PMunch/nimbleutils
16:11:23FromDiscord<ringabout> image.png https://media.discordapp.net/attachments/371759389889003532/1077261194097852488/image.png
16:12:02*azimut quit (Ping timeout: 255 seconds)
16:12:21FromDiscord<Phil> Yeah that was dropped, I thought enthus1ast 's post was kind of a "this" thing instead of recommendation of anything
16:22:12NimEventerNew thread by pietroppeter: Nim birthday?, see https://forum.nim-lang.org/t/9917
16:39:09FromDiscord<Coachonko> Is it correct to export a proc like so `proc name()`? I keep writing `proc name()` instead
16:39:37FromDiscord<Phil> Yeah, ` proc name()` is correct.
16:40:02FromDiscord<Phil> If it's easier for you `export name` is also an option. Could work if you make a habit of putting that stuff at the bottom of the file or sth
16:41:00FromDiscord<Coachonko> `` is concise but am dyslexic
16:41:20FromDiscord<Coachonko> Maybe I should use `export name` instead
16:41:31FromDiscord<Coachonko> Thanks for the tip
16:41:37FromDiscord<Phil> Happy to help
16:55:18*xet7 joined #nim
17:09:28FromDiscord<tsoj> Does anybody know if the httpclient and/or net module are threadsafe?
17:19:51FromDiscord<planetis> default vs zeroDefault, what's the difference? I suppose the last ignores default values for object fields right?
17:19:54FromDiscord<planetis> Also do they both call destroy?
17:20:58FromDiscord<planetis> In reply to @planetis "Also do they both": yep they do
17:21:41FromDiscord<Phil> planetis
17:22:25FromDiscord<Phil> Your name and the fact that "planety" exists as a name of significance in the nim ecosystem were intensely confusing, just wanted you to know 😛
17:22:58*arkurious quit (Ping timeout: 246 seconds)
17:25:29FromDiscord<planetis> In reply to @Isofruit "Your name and the": yes I agree but it's not my fault so I can't do anything
17:35:25*arkurious joined #nim
17:45:00FromDiscord<Ecorous> Finally got round to submitting a PR
17:45:19FromDiscord<Ecorous> For the `getDataDir`
17:45:20FromDiscord<Ecorous> https://github.com/nim-lang/Nim/pull/21408
17:45:52FromDiscord<Phil> Sweet!
17:46:38FromDiscord<Phil> In reply to @Ecorous "Finally got round to": No tests though?
18:10:14FromDiscord<demotomohiro> How to test `getDataDir`? The return value depends on OS, user name or env var.
18:13:39FromDiscord<Ecorous> In reply to @Isofruit "No tests though?": I wasn't sure how to do a test, but I have tested it
18:14:26FromDiscord<Phil> That is a good point, I guess my reflexes just kicked in that you should test everything that hasn't escaped to the trees on the count of three
18:14:52FromDiscord<Phil> I guess you could spin up a container and see if the result in each container is as expected?
18:16:26FromDiscord<Ecorous> I could do
18:16:38FromDiscord<Ecorous> I also got a friend to test it on windows
18:24:55*arkurious quit (Ping timeout: 246 seconds)
18:37:35*arkurious joined #nim
18:58:05FromDiscord<turbo> I've got an odd problem of a _segfault at runtime_ caused by a type declaration, but _only_ if that type is declared inside a proc (or any number of procs deep). Fine at module root. Here's the code (tested on macOS with Nim 2): https://gist.github.com/turbo/8d0101656d23e64078782233a7608154
18:59:21FromDiscord<turbo> (`c` backend)
19:02:15FromDiscord<turbo> Also happens with 1.6.10, please tell me I'm missing something glaringly obvious
19:04:46FromDiscord<demotomohiro> Maybe `VF` is larger than stack size and cause stack overflaw.
19:04:52FromDiscord<turbo> Ah, it depends on `V_AX`, for e.g. 1000 it succeeds, so you may be right
19:07:16FromDiscord<demotomohiro> Variables outside of procs dont use stack so they doesnt cause stack overflow.
19:09:33FromDiscord<demotomohiro> If you need large array only inside a proc, use `seq`, `ref array` or `ref object` contains array.↵They are allocated on heap and you can use larger memory than stack.
19:11:14*derpydoo joined #nim
19:11:27FromDiscord<turbo> Thanks, yes seq->array seems to solve it
19:37:02*jmdaemon joined #nim
19:49:50*ehmry quit (Quit: https://quassel-irc.org - Chat comfortably. Anywhere.)
19:51:51FromDiscord<Nerve> Is there any built-in equivalent to Python's chained comparisons, e.g. `0.0 <= x < 1.0`?
20:00:45FromDiscord<demotomohiro> !eval let x = 0.5; echo x in 0.0 .. 1.0
20:00:53NimBottrue
20:18:15*ehmry joined #nim
20:18:17*ehmry quit (Client Quit)
20:18:37*ehmry joined #nim
20:19:03*Notxor joined #nim
20:25:31NimEventerNew Nimble package! nemini - Nemini is a very basic Gemini server able to host static files and with virtual host support, see https://codeberg.org/pswilde/Nemini
20:30:41NimEventerNew thread by demetera: Save audio stream to the file from httpstream, see https://forum.nim-lang.org/t/9918
21:24:40FromDiscord<eyes> Okay maybe I'm just looking up the wrong words but I cannot figure out how to get a reference to something in nim
21:24:44FromDiscord<eyes> ptr or ref
21:25:21FromDiscord<eyes> like uhhh heres an example
21:27:19FromDiscord<eyes> sent a code paste, see https://play.nim-lang.org/#ix=4oIA
21:27:34FromDiscord<eyes> how can I call ``changeThingTo20`` on one of the ``Thing``s inside of ``things``
21:28:08FromDiscord<eyes> im actually not sure if this code compiles because i wrote it in discord lol
21:29:48FromDiscord<eyes> dammit no it doesnt because you cant store a ref object like that
21:30:14FromDiscord<eyes> okay whatever you get what i mean though I hope? pass an element of a seq or array or other data structure by reference
21:30:30FromDiscord<eyes> I could pass the data structure + the address of the thing within it instead I guess
21:30:36FromDiscord<Diogenes of Toronto> Would it be ref of object,
21:34:01FromDiscord<eyes> I'm not sure what you mean
21:34:42FromDiscord<Diogenes of Toronto> You are referencing a sequence. Thing is not a reference
21:35:51FromDiscord<Elegantbeef> You cannot take a ref of something
21:35:55FromDiscord<Elegantbeef> What you want is `var Thing`
21:36:02FromDiscord<Elegantbeef> in Nim a `ref` is a heap allocated reference counted type
21:36:51FromDiscord<Elegantbeef> sent a code paste, see https://play.nim-lang.org/#ix=4oIB
21:37:17FromDiscord<Diogenes of Toronto> ref is a pointer right?
21:37:26FromDiscord<Elegantbeef> sent a code paste, see https://play.nim-lang.org/#ix=4oIC
21:37:27FromDiscord<Elegantbeef> Ref is a heap allocated memory safe pointer yes
21:37:36FromDiscord<Diogenes of Toronto> Okay
21:37:52FromDiscord<Elegantbeef> `ptr T` is the equivlent to a C `T` and `pointer` to C's `void`
21:38:06FromDiscord<Elegantbeef> Those are unsafe pointers and can be stack allocated
21:38:09FromDiscord<Diogenes of Toronto> Okay
21:38:12FromDiscord<Elegantbeef> Generally one uses `var` instead of those
21:39:02FromDiscord<Elegantbeef> One should use `ref` when they want reference semantics
21:39:15FromDiscord<Elegantbeef> https://internet-of-tomohiro.netlify.app/nim/faq.en.html#type-when-to-use-ref-object-vs-plain-object-qmark
21:41:55FromDiscord<Diogenes of Toronto> So how do I dereference an object ref that isn't a type?
21:42:13FromDiscord<Elegantbeef> `[]` is the dereference operator
21:42:36FromDiscord<Diogenes of Toronto> Okay
21:43:06FromDiscord<Elegantbeef> sent a code paste, see https://play.nim-lang.org/#ix=4oID
21:43:09FromDiscord<Diogenes of Toronto> Cool
21:43:51FromDiscord<Diogenes of Toronto> This makes things easier as a go dev
21:44:19FromDiscord<Elegantbeef> Yea, unlike Go nim doesnt automatically convert things to references
21:44:21FromDiscord<Elegantbeef> It's more explicit and clear
21:45:03FromDiscord<Elegantbeef> sent a code paste, see https://play.nim-lang.org/#ix=4oIE
22:04:58*dropkick joined #nim
22:07:57FromDiscord<Ecorous> Anyone know why the CI fails on my PR?↵↵https://github.com/nim-lang/Nim/pull/21408
22:09:22NimEventerNew thread by tsojtsoj: Are the modules httpclient/net threadsafe?, see https://forum.nim-lang.org/t/9919
22:10:14FromDiscord<Elegantbeef> Might just be flaky, close and reopen the PR to restart the CI
22:10:59FromDiscord<Ecorous> Alright
22:16:28FromDiscord<demotomohiro> @Ecorous It seems you have created that pull request without creating branch. I recommend creating a branch like `git checkout -b add-getdatadir` before makig change next time you send PR.
22:42:59*Notxor quit (Quit: Leaving)
22:53:32FromDiscord<Hourglass [She/Her]> I really dislike the protocol.json files but if I want to cut out 99% of the future work, I need to work on parsing it sigh
22:54:53FromDiscord<Hourglass [She/Her]> sent a code paste, see https://play.nim-lang.org/#ix=4oJQ
22:57:06FromDiscord<Hourglass [She/Her]> And I'm not really sure about how to do it
22:57:57*xet7 quit (Quit: Leaving)
23:23:26FromDiscord<demotomohiro> https://nim-lang.org/docs/parsejson.html
23:26:06FromDiscord<demotomohiro> sent a code paste, see https://play.nim-lang.org/#ix=4oJZ
23:41:09FromDiscord<Hourglass [She/Her]> In reply to @demotomohiro "Do you want to": Yep, not sure how to go about it tho
23:42:13*mahlon quit (Remote host closed the connection)
23:43:50*mahlon joined #nim
23:44:03FromDiscord<Hourglass [She/Her]> I'm obviously gonna need to use macro hell but
23:44:29FromDiscord<demotomohiro> You can read a file with `staticRead`. If json module works at compile, you can parse json file in macro.
23:46:09FromDiscord<Hourglass [She/Her]> It should, but even if it doesn't, I could use a compile block right?
23:46:34FromDiscord<Hourglass [She/Her]> But it's more of an issue of "how do i parse this and turn it something useful"
23:46:51FromDiscord<huantian> macros! probably
23:53:00FromDiscord<Hourglass [She/Her]> I mean yeah :p
23:53:06FromDiscord<Hourglass [She/Her]> But the format is atrocious lmao
23:57:14FromDiscord<Hourglass [She/Her]> Maybe I'm overcomplicating this too much
23:58:32FromDiscord<auxym> that's what futhark does IIRC. parse a json at CT and with a macro generate a bunch of procs and types
23:58:53FromDiscord<Hourglass [She/Her]> I'm stressing over how i want it to look as opposed to the actual generation, I can spend time making it all pretty after a working product