<< 14-11-2023 >>

00:15:41*derpydoo quit (Ping timeout: 240 seconds)
01:20:07FromDiscord<user2m> is it possible to forward declare an object ? https://media.discordapp.net/attachments/371759389889003532/1173794461105520781/image.png?ex=65654047&is=6552cb47&hm=c3efafc1e00b422d9e53b42abeafabb55d5e6ce35a4568b9e2d58bd0c53a77b8&
01:24:09FromDiscord<Elegantbeef> Nim forward declares the left side of a type section
01:25:58FromDiscord<user2m> In reply to @Elegantbeef "Nim forward declares the": could you explain more?
01:26:40FromDiscord<Elegantbeef> sent a code paste, see https://play.nim-lang.org/#ix=4Lrk
01:28:24FromDiscord<user2m> hmm but the compiler says pdfio_file_t is unidentified https://media.discordapp.net/attachments/371759389889003532/1173796539441877204/image.png?ex=65654237&is=6552cd37&hm=352b4bffe1ba7bc391c3d70bed0a25e51615d28a72618193172c3fd02b74e213&
01:30:23FromDiscord<Elegantbeef> sent a code paste, see https://paste.rs/35xOK
01:37:32*xet7 quit (Remote host closed the connection)
01:40:02FromDiscord<user2m> sent a code paste, see https://play.nim-lang.org/#ix=4Lrm
01:41:21*xet7 joined #nim
01:48:18FromDiscord<user2m> sent a code paste, see https://play.nim-lang.org/#ix=4Lro
01:48:49FromDiscord<Elegantbeef> Why are you `exportc`ing?
01:50:27FromDiscord<user2m> the name for the object is "_pdfio_mode_t" I thought exportc was the proper way to define a name that uses a leading udnerscor
01:50:36FromDiscord<Elegantbeef> `importc`
01:50:57FromDiscord<Elegantbeef> I imagine you cannot import a leading underscore C enum
01:51:23FromDiscord<user2m> correct importc doesn't work on enums
01:57:58FromDiscord<Elegantbeef> It does work on enums just not renaming them
01:57:58FromDiscord<Elegantbeef> Probably need to do `type PdfioModeT = distinct cint` then have a bunch of `const PdifoModeRead = 0`
01:57:59FromDiscord<Elegantbeef> You technically do not need to import enums as long as the values are right
02:09:06*xutaxkamay quit (Quit: ZNC 1.8.2+deb3.1 - https://znc.in)
02:11:01*xutaxkamay joined #nim
02:16:25FromDiscord<user2m> In reply to @Elegantbeef "Probably need to do": hmmm I'm not sure what you mean here? don't enums in c / nim evaluate to ints ?
02:39:32FromDiscord<Elegantbeef> Something like this
02:39:35FromDiscord<Elegantbeef> sent a code paste, see https://play.nim-lang.org/#ix=4Lrz
02:39:43FromDiscord<Elegantbeef> Alternatively do not import the enum by name
02:51:21*xet7 quit (Read error: Connection reset by peer)
03:07:36*xet7 joined #nim
03:10:22*xet7 quit (Remote host closed the connection)
04:03:06*krux02 quit (Remote host closed the connection)
04:09:30*edr quit (Quit: Leaving)
04:12:40*xutaxkamay quit (Read error: Connection reset by peer)
04:12:49*xutaxkamay_ joined #nim
05:04:16*rockcavera quit (Remote host closed the connection)
05:16:56*lain quit (Server closed connection)
05:17:35*lain joined #nim
05:37:47NimEventerNew thread by daylinmorgan: `nimpkgs` the nimble.directory alternative no one asked for, see https://forum.nim-lang.org/t/10633
05:52:50FromDiscord<nasuray> ^^ https://nimpkgs.dayl.in
05:58:33FromDiscord<bung8954> Is there something am I missing while add file named as ".rels" to zip via `zippy` ? other files's name have suffix works fine
06:07:28*GreaseMonkey quit (Remote host closed the connection)
06:07:50*greaser|q joined #nim
06:58:52*advesperacit joined #nim
07:13:02*PMunch joined #nim
07:29:17*qwestion quit (Server closed connection)
08:31:49*jmdaemon joined #nim
09:12:09FromDiscord<Chronos [She/Her]> I'm making a shitty reference thing for when I implement user tokens and stuff later on :P
09:12:45FromDiscord<Chronos [She/Her]> Obviously I'll actually use JWT there and do it properly, but right now I'm just getting the bare minimum to work, because otherwise I'll keep procrastinating
09:13:14FromDiscord<Chronos [She/Her]> Though, one thing I'm not sure of, is how to handle ratelimiting? Is there some middleware or something for Prologue that does this? Or is it an nginx/apache thing?
09:42:02*robertmeta quit (Server closed connection)
09:42:11*robertmeta joined #nim
09:47:17*cnx quit (Server closed connection)
09:47:31*cnx joined #nim
09:50:29FromDiscord<Chronos [She/Her]> https://play.nim-lang.org/#ix=4LsE this is bizarre, I'm waiting for 4 seconds and despite the timeout being 2 seconds, still doesn't say it's expired?
09:51:15*acidsys quit (Server closed connection)
09:51:35*acidsys joined #nim
09:51:43FromDiscord<Chronos [She/Her]> Am I missing something here or?
09:58:05PMunchYes
09:58:11PMunchYou're missing something
09:59:11PMunchexpiresAt = createdAt + 2s. Then you later check if createdAt > expiresAt, which obviously always fails.
10:01:07FromDiscord<Chronos [She/Her]> Aah alright yeah that makes sense
10:01:20FromDiscord<Chronos [She/Her]> But now I'm confused why it's always failing :P
10:01:35FromDiscord<Chronos [She/Her]> (When I remove the sleep delay)
10:01:35*blackbeard420 quit (Server closed connection)
10:01:47*blackbeard420 joined #nim
10:02:43FromDiscord<System64 ~ Flandre Scarlet> We have the square root↵We have the cube root↵But do we have something like root(x, a) ?
10:08:53FromDiscord<Chronos [She/Her]> Wait oh my god I'm an idiot 😅
10:09:15FromDiscord<Chronos [She/Her]> I should be subtracting the timestamps and then check how many seconds are left in between
10:14:11PMunchWell your biggest issue is that you don't get a new time in `getSession`. So you're comparing two times which where both created in `newSession` and will always be two seconds apart.
10:16:19FromDiscord<Chronos [She/Her]> That's the point here aha, unless a token is renewed, it'd expire at a fixed time
10:16:41PMunchYes, but that's not what you're checking
10:16:52PMunchYou're checking if the token was expired at the time it was created
10:19:53PMunchAnd System64_~_Flandre_Scarlet, you can do that with `pow`
10:20:19PMunch`root(x, a) == pow(x, 1/a)`
10:26:59FromDiscord<Chronos [She/Her]> Ah okay that makes sense
10:27:10FromDiscord<Chronos [She/Her]> I'm supposed to check the current time... Wow my brain is slow
10:31:54FromDiscord<Chronos [She/Her]> Yep my code works now, thanks PMunch aha
10:34:59FromDiscord<System64 ~ Flandre Scarlet> In reply to @PMunch "`root(x, a) == pow(x,": Alright, thanks
10:49:57FromDiscord<kryp7on> I didn't understand what is DEFER statement for so I read docs, and if I understood right:↵↵the code that DEFER does will try to execute before closing procedure? Correct me if Im wrong
10:50:26FromDiscord<kryp7on> (edit) "execute" => "be executed"
10:53:49FromDiscord<nnsee> `defer` is syntactic sugar for `try`, `finally`
10:54:11FromDiscord<nnsee> where the rest of the function body is in `try` and the statement in `defer` is in `finally`
10:54:36FromDiscord<nnsee> which means that yes, the body in `defer` executes when the rest of the procedure is finished
11:00:24FromDiscord<kryp7on> In reply to @nnsee "which means that yes,": so one could use implicit code with `defer` in the end or could go also with `try` and `finally` ?
11:00:30FromDiscord<kryp7on> its the same basically?
11:01:42FromDiscord<nnsee> yes
11:01:48FromDiscord<nnsee> wrote up a quick example to demonstrate https://play.nim-lang.org/#ix=4Lt0
11:02:02FromDiscord<nnsee> main1 and main2 are equivalent
11:02:26FromDiscord<nnsee> tbh iirc there was some sort of slight difference with regards to throwing exceptions, or maybe i'm making it it up, can't remember
11:03:22FromDiscord<kryp7on> In reply to @nnsee "wrote up a quick": thanks so much Ras! 😄
11:03:25FromDiscord<kryp7on> it comes to my mind that
11:04:28FromDiscord<kryp7on> `defer` is used when you want to "try" some code before other code so if it fails procedure is done
11:04:54FromDiscord<kryp7on> or its just for finishing procedure, like its `finally`?
11:05:13PMunchIt's mostly for making sure that you close files that you've opened and such
11:05:16FromDiscord<kryp7on> In reply to @kryp7on "`defer` is used when": or this thing that I said is more `exception`
11:05:26FromDiscord<nnsee> mostly the latter yes, for example, if you open a file descriptor or a socket or something, you can write `defer: file.close()` on the next line
11:05:26FromDiscord<kryp7on> In reply to @PMunch "It's mostly for making": aha, gotcha. Its simple than
11:05:31FromDiscord<kryp7on> (edit) "than" => "them"
11:05:40FromDiscord<nnsee> that way, visually, the "clean up" is right next to where it gets initialized
11:05:41FromDiscord<kryp7on> (edit) "them" => "then, I just overthought it 😄"
11:05:45FromDiscord<nnsee> which some people like
11:05:59FromDiscord<nnsee> other people like being more explicit, using `try/finally`
11:06:02FromDiscord<nnsee> it's a debated topic lol
11:06:10FromDiscord<nnsee> i think araq at one point wanted to deprecate `defer`
11:06:20FromDiscord<kryp7on> haha gotcha, gotcha 😄
11:06:27FromDiscord<kryp7on> thanks so much! :))
11:12:30FromDiscord<kryp7on> by reading code, I encountered one more thing, called pragma, `{. .}`. I understood that its for controling compiler? And in code, there is this word `{.stdcall.}`. What is it for? Or do you need additional code in order to tell me?
11:17:27FromDiscord<nnsee> yes, pragmas can be thought of instructions or hints to the compiler. Most commonly, you'll probably see the `raises` pragma, which tells the compiler that this procedure should raise only specific exceptions (and the compilation fails if the compiler detects otherwise); the `importc` pragma which tells the compiler to, well, import stuff from some C code; etc
11:17:45FromDiscord<nnsee> `stdcall` is for some microsoft compiler specific thing
11:17:49FromDiscord<nnsee> not really sure what it does tbh
11:18:19FromDiscord<nnsee> https://learn.microsoft.com/en-us/cpp/cpp/stdcall?view=msvc-170
11:19:05FromDiscord<nnsee> so it sets an appropriate calling convention for win32 API functions
11:19:14FromDiscord<nnsee> i think the other alternative is `fastcall`
11:20:37FromDiscord<nnsee> and of course cdecl which I'm not sure if windows does the same way as unix-likes
11:21:22FromDiscord<nnsee> and if you have no idea what i'm talking about, https://en.wikipedia.org/wiki/X86_calling_conventions?useskin=vector#List_of_x86_calling_conventions
11:21:41*PMunch quit (Quit: Leaving)
11:21:45FromDiscord<xtrayambak> Hey, does anyone know how to use panics/panicoverride? I can't find any docs on it, and `--panics:on` doesn't call the panicoverride function I've in place.
11:23:32*lucerne quit (Server closed connection)
11:24:46*lucerne joined #nim
11:26:20FromDiscord<jdb_jdb> does anyone have a dockerfile for bitmancer nim project (<https://github.com/zimawhit3/Bitmancer>)? I can't get it to compile with multiple nim versions on linux/windows
11:28:07FromDiscord<Phil> Sadly I've only dockerized webservers, never worked with bitmancer
11:28:33FromDiscord<jdb_jdb> first time I've used nim, feels like hell trying to debug why stuff doesn't works
11:28:39FromDiscord<jdb_jdb> (edit) "works" => "work"
11:28:59FromDiscord<jdb_jdb> feel like rust is way more consistent
11:30:09FromDiscord<jdb_jdb> most of the issue is probably crosscompiling to windows
11:30:58FromDiscord<Phil> I mean, there's only so much I can say to that given I don't do work on windows and haven't used the project 😅
11:31:18FromDiscord<jdb_jdb> yeah it's fine lmao
11:31:26FromDiscord<jdb_jdb> I'm just over here coping
11:32:18FromDiscord<Phil> Fair, feels like me banging my head against the world interacting with gtk's C code and not knowing shit about C xD
11:32:52FromDiscord<jdb_jdb> gtk is megacursed
11:32:58FromDiscord<jdb_jdb> most gui stuff is tbf
11:33:13*jmdaemon quit (Ping timeout: 260 seconds)
11:34:17FromDiscord<kryp7on> In reply to @nnsee "yes, pragmas can be": thanks
11:35:21FromDiscord<Phil> In reply to @jdb_jdb "gtk is megacursed": I do Angular webdev at work.↵This level of cursed is weaksauce
11:38:20FromDiscord<xtrayambak> In reply to @jdb_jdb "gtk is megacursed": It's more tolerable if you use something like owlkettle, but getting used to that takes some time lol
11:39:22FromDiscord<Phil> The more I contribute to owlkettle the more I really like the DSL there
11:39:29FromDiscord<Phil> Just wish it would support when statements
11:39:44FromDiscord<Phil> But that I think might possibly be coming
11:44:48*syl quit (Quit: C-x C-c)
11:45:25*syl joined #nim
12:19:27FromDiscord<pmunch> Panicoverride is used for platforms that don't have their own panic handling I believe, I don't think it does anything when not compiling for one of those.↵(@xtrayambak)
12:21:03FromDiscord<kryp7on> I need WinAPI or some Nim procedure that checks if debugger is present on operating system, like IsDebugerPresent or Windows API that checks what processes are running on OS?↵↵Im looking at https://nim-lang.org/docs/lib.html under `Generic Operating System Services` . I find hard search it manually through it, could someone answer me first question, and 2nd one, how (and where) to find those things like Nim Win APIs and stuff.
12:21:34FromDiscord<pmunch> @Phil\: how is the Owlkettle DSL compared to genui?
12:21:48FromDiscord<pmunch> For context\: https://github.com/PMunch/gtk3genui
12:25:03Amun-Rais there an equivalent of gcc's -E in nim? I mean I'd like to see the resulting nim code after all macro processing
12:31:29*redj joined #nim
12:32:12FromDiscord<pmunch> \`--expandMacro\`?
12:32:54FromDiscord<Phil> In reply to @pmunch "For context\: https://github.com/PMunch/gtk3genui": Looks pretty similar, however I'd want the ability to assign attributes underneath one another because widgets very quickly can have around 20+ properties
12:34:23FromDiscord<Phil> The owlkettle dsl does provide nicer ways to do event-listener procs though imo
12:35:25FromDiscord<Phil> sent a code paste, see https://play.nim-lang.org/#ix=4Ltm
12:36:21FromDiscord<Phil> The fact that an event-listener is basically bog-standard nim syntax to me is a big plus
12:36:59FromDiscord<Phil> However if you told me that can.l got inspired by genui or the other way round I'd believe you, there's imo a fair bit of shared DNA here
12:37:30Amun-Rapmunch: hmm, thanks
12:40:51FromDiscord<pmunch> That makes a lot of sense, thanks
12:41:41FromDiscord<dissolved.girl> Why is it called owlkettle?
12:41:52FromDiscord<Phil> You'd need to ask the author
12:43:52*xet7 joined #nim
12:44:30FromDiscord<kryp7on> how to do Windows calls in Nim? I need to work with Windows processes. ↵↵like this:↵https://learn.microsoft.com/en-us/windows/win32/psapi/enumerating-all-processes
12:50:00FromDiscord<pk.kyle> idk but winim probably helps
13:20:28*lucasta joined #nim
13:21:54NimEventerNew post on r/nim by phlummox: Obtaining exit code, standard output and standard error from a process, see https://reddit.com/r/nim/comments/17v22rq/obtaining_exit_code_standard_output_and_standard/
13:22:43*enyc quit (Ping timeout: 260 seconds)
13:22:59*lucasta quit (Client Quit)
13:23:28*enyc joined #nim
13:29:18FromDiscord<kryp7on> In reply to @pk.kyle "idk but winim probably": ill look at it, ty
13:40:44*koltrast quit (Server closed connection)
13:42:04*koltrast joined #nim
13:53:03*tanami quit (Server closed connection)
13:53:11*tanami joined #nim
14:05:17*end quit (Server closed connection)
14:09:21*end joined #nim
14:12:47*droidrage quit (Server closed connection)
14:38:00*hernan quit (Server closed connection)
14:38:14*hernan joined #nim
15:20:33FromDiscord<Chronos [She/Her]> Hm... Maybe I should look at polishing my library for MC networking in Nim
15:20:42FromDiscord<Chronos [She/Her]> And see if I could get a bot client working or something
15:21:09FromDiscord<Phil> In reply to @chronos.vitaqua "Hm... Maybe I should": Polishing libraries is always a good thing
15:21:14FromDiscord<Phil> I mean, nim has a fair amount of libraries
15:21:26FromDiscord<Phil> But imo it doesn't have enough libraries in general imo that just scream polish
15:21:46FromDiscord<odexine> just remove the vowels and add lots of ywcz
15:22:10FromDiscord<Phil> That's why I'm also an advocate of going on a hunt for libs that could use contributions!
15:22:18FromDiscord<Phil> Like lowdb and nimword!
15:22:34FromDiscord<Chronos [She/Her]> Fsir
15:22:35FromDiscord<Chronos [She/Her]> Fair
15:22:45FromDiscord<Chronos [She/Her]> I just think an MC library for client stuff would be interesting :PP
15:22:56FromDiscord<Chronos [She/Her]> For network stuff in general
15:22:56FromDiscord<Chronos [She/Her]> ...which I have
15:22:59FromDiscord<odexine> my suru needs a look xd i havent touched that thing in ages ngl
15:22:59FromDiscord<Chronos [She/Her]> I just need to make it better
15:23:27FromDiscord<Chronos [She/Her]> And I'm wondering if I should avoid streams tbh-
15:23:38FromDiscord<Chronos [She/Her]> And just use a seq byte
15:23:39FromDiscord<Chronos [She/Her]> Hmmmm
15:23:43FromDiscord<Chronos [She/Her]> Eh
15:23:58FromDiscord<Phil> Write both, do a benchmark, decide then
15:25:20FromDiscord<Chronos [She/Her]> How do I do benchmarks.... :P
15:25:32FromDiscord<Chronos [She/Her]> Though yeah I'm definitely gonna write and compare both
15:26:42FromDiscord<Phil> In reply to @chronos.vitaqua "How do I do": Easy, you also compile and start a server as part of the benchmark and then just use benchy
15:26:45FromDiscord<jdb_jdb> how would `(DWORD)` be written in nim?
15:26:56FromDiscord<jdb_jdb> I thought you'd just cast twice
15:27:10FromDiscord<Phil> That is... what is that? A pointer to... a macro?
15:27:12FromDiscord<jdb_jdb> but it appears I am mistake given my unix timestamp says I'm in the year 30268
15:27:42FromDiscord<Phil> Maybe you are? Ever thought that maybe you created a black hole and instead of crushing you it transported you into the future?
15:28:08FromDiscord<jdb_jdb> very possible
15:28:13FromDiscord<jdb_jdb> pointer to a u64
15:28:49FromDiscord<Phil> given that I see 2 stars that's still just a single pointer to a uint64?
15:29:00FromDiscord<Phil> or is that a pointer to a pointer somehow?
15:29:13FromDiscord<Chronos [She/Her]> In reply to @isofruit "Easy, you also compile": Don't have any if much of the server done-
15:29:26FromDiscord<jdb_jdb> https://itecnote.com/tecnote/c-convert-current-time-from-windows-to-unix-timestamp-in-c-or-c/
15:29:53FromDiscord<Phil> Pretty bold of you to assume I can read C or C++
15:29:56FromDiscord<Chronos [She/Her]> Though I would imagine it'd be faster to use a seq byte considering Nim's streams do stuff like calling a pointer
15:30:51FromDiscord<Phil> Okay I completely fail to connect that link to your question
15:31:01FromDiscord<jdb_jdb> sent a code paste, see https://play.nim-lang.org/#ix=4Luj
15:31:15FromDiscord<jdb_jdb> this is the rust equivalent
15:31:20FromDiscord<jdb_jdb> which I'm trying to write in nim
15:31:21FromDiscord<jdb_jdb> so
15:31:28FromDiscord<odexine> hello i can read C
15:31:29FromDiscord<odexine> what'
15:31:29FromDiscord<jdb_jdb> the pointer is `time_low_ptr`
15:31:33FromDiscord<odexine> fuck i hit enter
15:31:41FromDiscord<jdb_jdb> which is where the dword ptr would be from
15:31:55FromDiscord<jdb_jdb> given dword is u32
15:32:49FromDiscord<Phil> I mean is ptr or "pointer" (depending on the context, both tend to be valid)
15:33:02FromDiscord<Phil> (edit) "I mean ... isin" added "in C" | "in Cis ptr or "pointer" ... (depending" added "in nim"
15:33:15FromDiscord<jdb_jdb> so you can cast to a pointer?
15:33:28FromDiscord<odexine> is commonl only pointer if `void` or `<type not imported to nim>` (second case is not really sensible)
15:33:31FromDiscord<odexine> (edit) "" => "\"
15:33:42FromDiscord<odexine> you can cast to pointer sure
15:34:34FromDiscord<odexine> In reply to @jdb_jdb "https://itecnote.com/tecnote/c-convert-current-time": i dont see DWORD here
15:35:21FromDiscord<jdb_jdb> sent a code paste, see https://play.nim-lang.org/#ix=4Luk
15:35:26FromDiscord<odexine> well i cannot read rust
15:35:30FromDiscord<jdb_jdb> which is why
15:35:32FromDiscord<jdb_jdb> in the line below it
15:35:38FromDiscord<jdb_jdb> In reply to @jdb_jdb "given dword is u32": here
15:36:01FromDiscord<jdb_jdb> sent a code paste, see https://play.nim-lang.org/#ix=4Lul
15:36:03FromDiscord<jdb_jdb> I found a c example
15:36:21FromDiscord<odexine> i was going to say `(DWORD)` didnt seem like a type decl ok i get it
15:36:32*mronetwo quit (Server closed connection)
15:36:37FromDiscord<Phil> Ohhhhh this is casting some bytes to a pointer to whatever the heck DWORD is ?
15:36:39FromDiscord<odexine> `cast[ptr uint32](0x7FFE0000 + 0x14)[]`
15:36:40*mronetwo joined #nim
15:37:01FromDiscord<odexine> this is kinda dangey so yeah
15:37:55FromDiscord<jdb_jdb> yeah get errors doing that
15:37:56FromDiscord<jdb_jdb> woozed
15:38:01FromDiscord<bostonboston> Aren't wintypes great
15:38:15FromDiscord<Phil> All I see is screaming case screaming at me
15:39:27FromDiscord<odexine> i dont see why you're casting pointer addresses
15:39:37FromDiscord<odexine> rather i dont understand
15:39:39FromDiscord<jdb_jdb> this works
15:39:41FromDiscord<jdb_jdb> sent a code paste, see https://play.nim-lang.org/#ix=4Lun
15:39:48FromDiscord<jdb_jdb> ty for the help, although
15:39:57FromDiscord<jdb_jdb> I don't understand the array looking brackets at the end
15:40:01FromDiscord<odexine> that's dereference
15:40:05FromDiscord<jdb_jdb> ohh
15:40:12FromDiscord<jdb_jdb> okay
15:40:15FromDiscord<jdb_jdb> cool, that makes sense
15:40:31FromDiscord<odexine> personally i like it so much more than C's ptr/deref syntax because many people get confused by the fact that theyre both asterisks
15:40:41FromDiscord<jdb_jdb> yeah true
15:41:42FromDiscord<bostonboston> `void (((f[])())()`
15:41:53FromDiscord<odexine> see that website in #offtopic
15:43:30FromDiscord<Phil> Hello, I am many people
15:43:47FromDiscord<jdb_jdb> the typing is kinda why I'm not using rust
15:43:59FromDiscord<jdb_jdb> working with type casting structures in rust isn't really working
15:44:34FromDiscord<jdb_jdb> creating an lsa_string only to fix out the buffer is a pointer rather than a dereferenced array
15:44:41FromDiscord<odexine> In reply to @isofruit "Hello, I am many": many people == anyone who isnt Dennis Ritchie
15:48:22NimEventerNew post on r/nim by qtless: HappyX Decorators, see https://reddit.com/r/nim/comments/17v52nk/happyx_decorators/
15:50:19FromDiscord<odexine> cursed
15:50:22FromDiscord<odexine> legitimately cursed
15:52:09FromDiscord<jdb_jdb> windows gets worse than that though
15:52:20FromDiscord<jdb_jdb> most of the api calls have some super specific format it wants output in
15:52:23FromDiscord<jdb_jdb> lsa_string
15:52:25FromDiscord<jdb_jdb> plsa_string
15:52:29FromDiscord<jdb_jdb> lsa_unicode_string
15:52:33FromDiscord<jdb_jdb> plsa_unicode_string
15:52:47FromDiscord<jdb_jdb> none are actual strings
15:53:54FromDiscord<odexine> have fun
15:53:58FromDiscord<odexine> i wish you luck i guess
15:54:25FromDiscord<bostonboston> It's not so bad
15:54:53FromDiscord<jdb_jdb> I've not looked at lsa_string in nim yet but I expect I'll have issues
15:55:05FromDiscord<jdb_jdb> given the only places I can find it is in the library types
15:55:09FromDiscord<jdb_jdb> and not actual implementation
15:55:14FromDiscord<jdb_jdb> I think I'll pass away
15:57:58FromDiscord<Phil> In reply to @jdb_jdb "I think I'll pass": Don't go into the light! They don't have free healthcare either!
15:58:13FromDiscord<jdb_jdb> \:)
15:58:17FromDiscord<jdb_jdb> free healthcare here
15:58:28FromDiscord<jdb_jdb> :MarioWooDance:
16:02:07FromDiscord<jdb_jdb> however
16:02:40FromDiscord<jdb_jdb> nothing can save my brain from the impending realisation that I have to either work out the type conversions or succumb to write cpp
16:05:43FromDiscord<xtrayambak> In reply to @pmunch "Panicoverride is used for": Aaah, makes sense. Thanks.
16:16:07om3gais there any type of sequence or table or anything that will preserve key value order?
16:17:12FromDiscord<Phil> OrderedTable?↵> OrderedTable is used when it is important to preserve the insertion order of keys.↵https://nim-lang.org/docs/tables.html#basic-usage-orderedtable
16:17:13om3gaI mean for example, if we add key of int -1 5 3 2 0 1 , then resulting list or sequence or anything will be -1 0 1 2 3 5
16:17:27om3gaPhil, no, not insertion order
16:18:07FromDiscord<Phil> In that case I don't think there's sth in the lib.
16:18:16FromDiscord<jviega> Just sort it??
16:18:20om3gaeh.. sad
16:18:40om3gajviega, that's the point, to not sort it
16:18:52FromDiscord<Chronos [She/Her]> Is there a way to make a pragma that applies another pragma to a proc? :P
16:19:17FromDiscord<jviega> I mean, what you're asking for is a sort. You can do an insertion sort when inserting, depending on the data structure
16:20:07om3gajviega, yeah, but this requires value mapping to indx, or something similar
16:20:35FromDiscord<jviega> But if you want that w/ a particular type of data structure, would need a better idea of what you have in mind. Generally, hash tables are trading off structure for lookup speed at scale, so while you can preserve sort ordering, no other ordering is likely to be kept incrementally
16:20:46FromDiscord<jviega> But just use a seq of tuples and do an insertion sort
16:21:13FromDiscord<demotomohiro> How about to use linkedList and insert right position.
16:21:40om3garight, this will work sure jviega, only I had a hope for something more easy
16:21:56om3gademotohimoro, idk this, what is linked list?
16:22:36om3gaoh I see
16:22:41om3gainteresting
16:23:18FromDiscord<demotomohiro> https://nim-lang.org/docs/lists.html
16:23:50FromDiscord<demotomohiro> linked list can do insertion and delete in O(1).
16:24:01FromDiscord<jviega> I mean, there are all sorts of skip-list schemes people use
16:24:01FromDiscord<demotomohiro> But slow to iterator.
16:24:55FromDiscord<jviega> It's insert and delete only if it's at some node where you have a reference. Not too awesome for sorted inserts on large data sets, for instance if you wanted to use a log(n) algorithm to find the point to insert
16:25:44om3ga=demotoddddd
16:26:03om3gasorry, wsl console lag
16:26:51om3gademotomohiro, thank you, looks like what I exactly looking for!
16:27:46om3gajviega unfortunately slow
16:29:19FromDiscord<jviega> ??
16:30:33FromDiscord<jviega> I'm saying that if it's a large data set you should either use a seq, or if there are many frequent insertions, look at the various skip-list schemes and see what is most appropriate. If its not much data, the seq is cleaner and easier all around
16:39:34FromDiscord<bostonboston> Is `{.push used.}` not valid?
16:43:53*TheLink quit (Server closed connection)
16:44:10*TheLink joined #nim
16:45:44*rockcavera joined #nim
16:47:04*rockcavera quit (Killed (tungsten.libera.chat (Nickname regained by services)))
16:47:24*tiorock joined #nim
16:47:25*tiorock quit (Changing host)
16:47:25*tiorock joined #nim
16:47:25*tiorock is now known as rockcavera
16:54:08*rockcavera quit (Remote host closed the connection)
16:54:33*rockcavera joined #nim
16:55:41FromDiscord<e.e.7> I believe it's valid. It works for me, at least. What's the problem?
17:03:53FromDiscord<kryp7on> I cant find in `winim` library this Windows API https://learn.microsoft.com/en-us/windows/win32/toolhelp/taking-a-snapshot-and-viewing-processes?source=recommendations↵↵does it even exist in `winim`?
17:06:20Amun-RaI just made version 2 of my dlopen helper library (error message reporting missing), any suggestions welcome https://i.postimg.cc/Px5VdZ1M/dlutils.png
17:13:27FromDiscord<bostonboston> In reply to @e.e.7 "I believe it's valid.": It just doesn't work for me
17:14:24FromDiscord<e.e.7> Could you share a minimal reproducible example?
17:14:36FromDiscord<bostonboston> sent a code paste, see https://play.nim-lang.org/#ix=4Lv2
17:16:09Amun-Rathhis is the same as const foo {.used.} = 0
17:16:50FromDiscord<jdb_jdb> In reply to @kryp7on "I cant find in": what part?
17:16:59FromDiscord<jdb_jdb> CreateToolhelp32Snapshot?
17:17:11FromDiscord<jdb_jdb> winim is just the implementation of winapi in nim
17:17:25FromDiscord<kryp7on> In reply to @jdb_jdb "CreateToolhelp32Snapshot?": yes
17:17:58FromDiscord<kryp7on> In reply to @jdb_jdb "winim is just the": this is my first time trying to use Win API, could you explain how Win APIs are used in Nim?
17:18:00FromDiscord<jdb_jdb> https://github.com/byt3bl33d3r/OffensiveNim/blob/c034fe11c7b4a1affc92c7951667fb2cff8e0da8/src/sandbox_process_bin.nim#L69-L70
17:18:04FromDiscord<jdb_jdb> nope
17:18:10FromDiscord<jdb_jdb> I don't know nim
17:18:14FromDiscord<jdb_jdb> I only started writing it today
17:18:34FromDiscord<kryp7on> In reply to @jdb_jdb "I only started writing": cool link. Thanks for it :))
17:19:19FromDiscord<bostonboston> In reply to @Amun-Ra "thhis is the same": Yes but In reality I have a lot of consts and many enums I'm applying it to
17:20:35Amun-Rabostonboston: yes, in that case push/pop or custom pragma is better
17:24:09FromDiscord<jdb_jdb> bruh
17:24:22FromDiscord<jdb_jdb> this api call isn't even in winim?
17:24:33FromDiscord<jdb_jdb> ConvertSidToStringSidA
17:25:23FromDiscord<jdb_jdb> rip
17:25:34FromDiscord<jdb_jdb> truly pass awya
17:25:36FromDiscord<jdb_jdb> (edit) "awya" => "away"
17:26:43FromDiscord<e.e.7> sent a code paste, see https://play.nim-lang.org/#ix=4Lv7
17:27:13FromDiscord<e.e.7> sent a code paste, see https://play.nim-lang.org/#ix=4Lv8
17:28:11*oddish quit (Server closed connection)
17:28:18*oddish joined #nim
17:34:25FromDiscord<e.e.7> I didn't see an open issue on GitHub for this exact case. Would you like to create one?
17:36:24Amun-Rahttps://github.com/nim-lang/Nim/issues/4044
17:38:02Amun-Ra^ e.e.7
17:38:49FromDiscord<Chronos [She/Her]> I'm trying to figure out the best way to make my code work for sync and async sockets without duplicating the code needlessly (since the logic is all the same) but I don't know how :/
17:39:34FromDiscord<Chronos [She/Her]> And multisync is sorta confusing :P
17:41:25FromDiscord<Chronos [She/Her]> Wait am I just an idiot
17:41:41FromDiscord<odexine> perhaps?
17:41:48FromDiscord<odexine> i dont know its up to you to judge
17:42:23FromDiscord<odexine> in any case multisync basically just "makes two versions" of a proc where one has `await` and the other doesnt
17:44:28FromDiscord<e.e.7> sent a code paste, see https://play.nim-lang.org/#ix=4Lvf
17:45:04FromDiscord<Chronos [She/Her]> Indeed I am
17:45:18FromDiscord<kompiler> Hi nimblerrs, ↵↵New here and any resources on starting nim ?
17:45:26FromDiscord<kompiler> (edit) "nimblerrs," => "nimblers,"
17:46:50Amun-Rae.e.7: right
17:48:42*krux02 joined #nim
17:53:41FromDiscord<Chronos [She/Her]> I should figure out how to write more descriptive tests :P
17:55:03FromDiscord<odexine> there are many ways to specify tests
17:55:30FromDiscord<Chronos [She/Her]> And I should write more tests in general :PPP
17:59:12FromDiscord<huantian> In reply to @kompiler "Hi nimblers, ": Start with the tutorial on the site
18:03:52FromDiscord<demotomohiro> In reply to @kryp7on "this is my first": Using WinAPI are same to using C library in Nim. import functions from header file and link lib file.↵Or use dynlib pragma.↵Example code from Nim's stdlib: https://github.com/nim-lang/Nim/blob/devel/lib/windows/winlean.nim↵https://nim-lang.org/docs/manual.html#foreign-function-interface-dynlib-pragma-for-import
18:04:22FromDiscord<demotomohiro> https://nim-lang.org/docs/manual.html#implementation-specific-pragmas-header-pragma
18:08:48FromDiscord<241_01499> HSlice was a mistake
18:11:44FromDiscord<kryp7on> In reply to @demotomohiro "Using WinAPI are same": bruh, sry man, that didnt help 😅
18:12:08FromDiscord<kryp7on> Im new to Nim, so adding Win APIs melt my brain. Im clueless how to use them in Nim
18:13:40FromDiscord<demotomohiro> In reply to @kryp7on "bruh, sry man, that": If you really want to use Windows API, you should learn C first because Win API are designed for C language and often use pointers.
18:14:35FromDiscord<demotomohiro> And Windows API documents are written for C programmer.↵And you need to read windows api documents to use api safely.
18:15:00FromDiscord<jdb_jdb> nah
18:15:02FromDiscord<jdb_jdb> I beg to differ
18:15:12FromDiscord<jdb_jdb> I started using winapi and still haven't learnt C
18:15:24FromDiscord<jdb_jdb> just research lots
18:15:24Amun-RaI agree with demotomohiro
18:15:27FromDiscord<kryp7on> In reply to @demotomohiro "If you really want": bruh, I would literally learn JavaScript instead of C lmao
18:15:28FromDiscord<kryp7on> hate C
18:15:28FromDiscord<jdb_jdb> cope
18:15:32FromDiscord<jdb_jdb> you might agree with him
18:15:37FromDiscord<jdb_jdb> but it's an opinion
18:15:50Amun-Rait's not C you should hate but atriocious winapi
18:16:30FromDiscord<jdb_jdb> written many things in rust and nim using winapi
18:16:34FromDiscord<jdb_jdb> having never put time into c
18:16:39FromDiscord<kryp7on> In reply to @Amun-Ra "it's not C you": Im not hating anything, just kidding, I just dont like C at all. So ugly language imo, thats why I started learning Nim..
18:16:40FromDiscord<jdb_jdb> it's not terrible
18:16:44FromDiscord<jdb_jdb> yeah C is grim
18:16:53FromDiscord<jdb_jdb> have fun doing memory management
18:16:54FromDiscord<kryp7on> In reply to @jdb_jdb "written many things in": was learning Rust before, switched to nim cuz its easier for beginner
18:16:59FromDiscord<jdb_jdb> I mean
18:17:01FromDiscord<jdb_jdb> maybe
18:17:09FromDiscord<jdb_jdb> rust has stricter types I think
18:17:10FromDiscord<demotomohiro> Using windows API without knowing C would be like driving a car without knowing signs on street.
18:17:14FromDiscord<jdb_jdb> you're stupid
18:17:18FromDiscord<jdb_jdb> that's 100% not true
18:17:33FromDiscord<jdb_jdb> rust documentation is better than nim
18:17:34Amun-RaI tried rust for year or more, I'd rather write C
18:17:38FromDiscord<jdb_jdb> but nim isn't as strict
18:17:41FromDiscord<odexine> In reply to @jdb_jdb "rust documentation is better": yes
18:17:48FromDiscord<jdb_jdb> especially for winapi stuff
18:17:54FromDiscord<odexine> consider the size of the community though
18:17:57FromDiscord<jdb_jdb> it's an uphill battle looking for winapi nim documentation
18:17:58FromDiscord<jdb_jdb> true
18:18:12FromDiscord<jdb_jdb> both have discords with pretty active people though
18:18:17FromDiscord<jdb_jdb> so most questions get answered
18:18:20FromDiscord<odexine> In reply to @241_01499 "HSlice was a mistake": would you like to elaborate?
18:19:52NimEventerNew thread by bsljth: How many developers are working on Nim?, see https://forum.nim-lang.org/t/10636
18:22:15FromDiscord<jdb_jdb> also
18:22:21FromDiscord<jdb_jdb> I'm not sure why some functions just
18:22:30FromDiscord<jdb_jdb> aren't in winim
18:22:51FromDiscord<jdb_jdb> but since all the winapi is , is just a bunch of functions in dlls
18:22:59FromDiscord<jdb_jdb> you can just import anything you don't have
18:23:07FromDiscord<jdb_jdb> which means you can do the same with your own libraries
18:25:09FromDiscord<241_01499> In reply to @NimEventer "New thread by bsljth:": Sure. 99% of functions/iterators only accept Slices, you don't need them, they are used only due to limitations of the type promotion system.
18:25:42FromDiscord<demotomohiro> In reply to @jdb_jdb "*aren't in* winim": According to README.md in https://github.com/khchen/winim:↵> The definitions are translated from MinGW's Windows headers and Windows 10 SDK headers.↵So functions not in these header file will be missing.
18:26:13FromDiscord<jdb_jdb> what if the functions are in header files
18:26:18FromDiscord<jdb_jdb> but still aren't in it
18:26:54FromDiscord<jdb_jdb> :despairge:
18:27:35*casaca quit (Server closed connection)
18:27:49*casaca joined #nim
18:28:16FromDiscord<demotomohiro> Maybe translating C header files is failing or some `#ifdef` in header might causing problems.
18:28:27FromDiscord<jdb_jdb> ¯\_(ツ)_/¯
18:28:31FromDiscord<jdb_jdb> who knows
18:28:35FromDiscord<jdb_jdb> library woozed
18:28:57FromDiscord<m4ul3r> Winim is useful. If something isn’t in there, just do it yourself. It’s not hard to implement
18:29:05FromDiscord<jdb_jdb> yea lmao
18:29:10FromDiscord<jdb_jdb> that's what I did
18:29:13FromDiscord<m4ul3r> Most stuff I’ve needed have been in there. The rest are undocumented
18:29:22FromDiscord<kryp7on> In reply to @jdb_jdb "yea lmao": could you look DM, I send you some private messages 😄
18:43:33*edr joined #nim
18:44:41*gshumway quit (Server closed connection)
18:44:58*gshumway joined #nim
18:59:14FromDiscord<bostonboston> Very true about the documentation part, winim has so much stuff undocumented, but that's expected
18:59:29FromDiscord<bostonboston> Windef.nim is 10k lines alone
19:00:36*lucasta joined #nim
19:02:11FromDiscord<Phil> Do what I do for owlkettle:↵Make a gargantuan doc PR that introduces a nimibook.
19:02:34FromDiscord<Phil> Ideally after first poking the author to explain to you the details and use the docs than as reference docs for yourself
19:02:39FromDiscord<Phil> (edit) "Ideally after first poking the author to explain to you the details and use the docs than as reference docs for yourself ... " added "as well."
19:12:27FromDiscord<Chronos [She/Her]> sent a code paste, see https://play.nim-lang.org/#ix=4LvG
19:12:45FromDiscord<Chronos [She/Her]> Tempted to just collect this all into one proc and just name this differently underneath
19:30:15*krux02 quit (Remote host closed the connection)
19:49:48FromDiscord<jdb_jdb> 🥴
19:57:50Amun-RaChronos: what's the def of SignedInts and UnsignedInts?
20:03:02FromDiscord<Chronos [She/Her]> sent a code paste, see https://play.nim-lang.org/#ix=4LvU
20:06:27*PMunch joined #nim
20:11:22FromDiscord<Chronos [She/Her]> Naming truly is horrid
20:12:32FromDiscord<stoneface86> I'd call them words since they're multibyte integers and since system has `SomeSignedInt` and `SomeUnsignedInt`
20:13:25FromDiscord<Chronos [She/Her]> In reply to @stoneface86 "I'd call them words": That includes `int` (can't be relied on for binary stuff) and `int8` (which I kept separate for a reason) :P
20:13:50FromDiscord<Chronos [She/Her]> Either way, the user never has to directly use the types, it's purely so I can use them as generics in my procs
20:14:04FromDiscord<stoneface86> oh I got your intention, meant that the name `SignedInts` sounds too similar to `SomeSignedInt`
20:14:11FromDiscord<Chronos [She/Her]> Ah fair
20:14:23FromDiscord<Chronos [She/Her]> Hm, I'll think of a name later maybe :P
20:19:49FromDiscord<stoneface86> naming is hard 😔
20:20:58FromDiscord<Chronos [She/Her]> Yep
20:21:29FromDiscord<.bobbbob> I tried rust but went to nim because rust is kind of ugly and overcomplicated imo
20:22:26FromDiscord<stoneface86> I like the goals of rust but its syntax is just as ugly as C++ so I'll pass
20:25:47FromDiscord<gbolahan> How can I skip a file during compilation. I'm trying to use eth-trie, but binaries.nim has an error. Thing is binaries trie seems to be an experimental module. Can I just pass a flag in compilation to skip binaries.nim
20:28:19PMunch@gbolahan, not unless eth-trie has a switch for it
20:28:36PMunchYou can't just tell Nim to not compile part of a program
20:30:19FromDiscord<.bobbbob> In reply to @PMunch "You can't just tell": does it still compile the module if it's imported but nothing from it is used? if so I guess you could just delete the import
20:30:28PMunchThere is a switch to replace a module with a a custom module though
20:30:53PMunchWell if you delete the import then it's no longer imported and thus not compiled
20:35:00FromDiscord<gbolahan> I asked about this in an issue. Looking at the codebase for myself, I actually don't think it should be removed. I think it is just a case of a bug
20:40:01PMunchWhat is the error you get?
20:40:50*lucasta quit (Quit: Leaving)
20:49:41FromDiscord<gbolahan> sent a code paste, see https://play.nim-lang.org/#ix=4Lw3
20:59:23*henrytill quit (Server closed connection)
20:59:32*henrytill joined #nim
21:01:38FromDiscord<gbolahan> The response to the issue just made more sense to me
21:01:48FromDiscord<gbolahan> resolved
21:06:19*krux02 joined #nim
21:17:50FromDiscord<cyberlis (cyber_lis)> Elegantbeef\: I finally finished it. I don't think I gonna use it. It was more for educational purpose↵https://forum.nim-lang.org/t/10632↵(last message)
21:22:29*rockcavera quit (Ping timeout: 240 seconds)
21:23:49*rockcavera joined #nim
21:35:00*rockcavera quit (Ping timeout: 268 seconds)
21:39:42*jmdaemon joined #nim
21:44:05*rockcavera joined #nim
21:44:05*rockcavera quit (Changing host)
21:44:05*rockcavera joined #nim
21:57:50FromDiscord<cyberlis (cyber_lis)> [Edit](https://discord.com/channels/371759389889003530/371759389889003532/1174095872334766120): Elegantbeef\: I finally finished it. I don't think I gonna use it. It was more for educational purpose↵https://forum.nim-lang.org/t/10632
21:59:20*noeontheend quit (Server closed connection)
21:59:29*noeontheend joined #nim
22:00:41*advesperacit quit ()
22:56:24*PMunch quit (Quit: Leaving)
23:16:01FromDiscord<guttural666> In reply to @Elegantbeef "Now your entire code": this is how it did work: https://play.nim-lang.org/#ix=4LwE↵had to cast around a bit, it is pretty terse, but unsure about the id part, may use scanf though, that seems great
23:22:45FromDiscord<Elegantbeef> You can easily scan it if you want to abuse scanf more
23:27:28FromDiscord<Elegantbeef> sent a code paste, see https://play.nim-lang.org/#ix=4LwG
23:41:06Amun-RaI managed to finish my dynlib/symaddr generator \o/ -> https://i.postimg.cc/jqxqRKQZ/dlutils2.png
23:46:32FromDiscord<guttural666> sent a code paste, see https://play.nim-lang.org/#ix=4LwJ
23:48:18Amun-Rayou can use $ instead of string()
23:48:52FromDiscord<guttural666> Path sadly does not have a $ function
23:49:24Amun-Rahmm
23:49:39Amun-Raah, it's a distinct stringiirc
23:49:45FromDiscord<guttural666> Path being a distinct string
23:49:46FromDiscord<guttural666> yeah
23:51:41Amun-Rabtw, this should also work :) result.id = result.url.parseUri.path.string.extractFilename
23:53:14FromDiscord<bostonboston> Can a proc that returns an object `foo` return a derived object `bar = object of foo`
23:53:55Amun-Rathat should work with refs (iirc)
23:54:56FromDiscord<guttural666> In reply to @Amun-Ra "btw, this should also": a bit of clean up:↵result.id = string(Path(result.url.parseUri.path).extractFilename())
23:57:04FromDiscord<guttural666> though I do like to add the () to denote it's a function and not a member variable
23:58:13Amun-RaI tend not to use () at all if possible
23:59:34FromDiscord<guttural666> this is how I'm going to leave it 😄↵result.id = result.url.parseUri().path.Path().extractFilename().string()