00:15:41 | * | derpydoo quit (Ping timeout: 240 seconds) |
01:20:07 | FromDiscord | <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:09 | FromDiscord | <Elegantbeef> Nim forward declares the left side of a type section |
01:25:58 | FromDiscord | <user2m> In reply to @Elegantbeef "Nim forward declares the": could you explain more? |
01:26:40 | FromDiscord | <Elegantbeef> sent a code paste, see https://play.nim-lang.org/#ix=4Lrk |
01:28:24 | FromDiscord | <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:23 | FromDiscord | <Elegantbeef> sent a code paste, see https://paste.rs/35xOK |
01:37:32 | * | xet7 quit (Remote host closed the connection) |
01:40:02 | FromDiscord | <user2m> sent a code paste, see https://play.nim-lang.org/#ix=4Lrm |
01:41:21 | * | xet7 joined #nim |
01:48:18 | FromDiscord | <user2m> sent a code paste, see https://play.nim-lang.org/#ix=4Lro |
01:48:49 | FromDiscord | <Elegantbeef> Why are you `exportc`ing? |
01:50:27 | FromDiscord | <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:36 | FromDiscord | <Elegantbeef> `importc` |
01:50:57 | FromDiscord | <Elegantbeef> I imagine you cannot import a leading underscore C enum |
01:51:23 | FromDiscord | <user2m> correct importc doesn't work on enums |
01:57:58 | FromDiscord | <Elegantbeef> It does work on enums just not renaming them |
01:57:58 | FromDiscord | <Elegantbeef> Probably need to do `type PdfioModeT = distinct cint` then have a bunch of `const PdifoModeRead = 0` |
01:57:59 | FromDiscord | <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:25 | FromDiscord | <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:32 | FromDiscord | <Elegantbeef> Something like this |
02:39:35 | FromDiscord | <Elegantbeef> sent a code paste, see https://play.nim-lang.org/#ix=4Lrz |
02:39:43 | FromDiscord | <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:47 | NimEventer | New thread by daylinmorgan: `nimpkgs` the nimble.directory alternative no one asked for, see https://forum.nim-lang.org/t/10633 |
05:52:50 | FromDiscord | <nasuray> ^^ https://nimpkgs.dayl.in |
05:58:33 | FromDiscord | <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:09 | FromDiscord | <Chronos [She/Her]> I'm making a shitty reference thing for when I implement user tokens and stuff later on :P |
09:12:45 | FromDiscord | <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:14 | FromDiscord | <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:29 | FromDiscord | <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:43 | FromDiscord | <Chronos [She/Her]> Am I missing something here or? |
09:58:05 | PMunch | Yes |
09:58:11 | PMunch | You're missing something |
09:59:11 | PMunch | expiresAt = createdAt + 2s. Then you later check if createdAt > expiresAt, which obviously always fails. |
10:01:07 | FromDiscord | <Chronos [She/Her]> Aah alright yeah that makes sense |
10:01:20 | FromDiscord | <Chronos [She/Her]> But now I'm confused why it's always failing :P |
10:01:35 | FromDiscord | <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:43 | FromDiscord | <System64 ~ Flandre Scarlet> We have the square root↵We have the cube root↵But do we have something like root(x, a) ? |
10:08:53 | FromDiscord | <Chronos [She/Her]> Wait oh my god I'm an idiot 😅 |
10:09:15 | FromDiscord | <Chronos [She/Her]> I should be subtracting the timestamps and then check how many seconds are left in between |
10:14:11 | PMunch | Well 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:19 | FromDiscord | <Chronos [She/Her]> That's the point here aha, unless a token is renewed, it'd expire at a fixed time |
10:16:41 | PMunch | Yes, but that's not what you're checking |
10:16:52 | PMunch | You're checking if the token was expired at the time it was created |
10:19:53 | PMunch | And System64_~_Flandre_Scarlet, you can do that with `pow` |
10:20:19 | PMunch | `root(x, a) == pow(x, 1/a)` |
10:26:59 | FromDiscord | <Chronos [She/Her]> Ah okay that makes sense |
10:27:10 | FromDiscord | <Chronos [She/Her]> I'm supposed to check the current time... Wow my brain is slow |
10:31:54 | FromDiscord | <Chronos [She/Her]> Yep my code works now, thanks PMunch aha |
10:34:59 | FromDiscord | <System64 ~ Flandre Scarlet> In reply to @PMunch "`root(x, a) == pow(x,": Alright, thanks |
10:49:57 | FromDiscord | <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:26 | FromDiscord | <kryp7on> (edit) "execute" => "be executed" |
10:53:49 | FromDiscord | <nnsee> `defer` is syntactic sugar for `try`, `finally` |
10:54:11 | FromDiscord | <nnsee> where the rest of the function body is in `try` and the statement in `defer` is in `finally` |
10:54:36 | FromDiscord | <nnsee> which means that yes, the body in `defer` executes when the rest of the procedure is finished |
11:00:24 | FromDiscord | <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:30 | FromDiscord | <kryp7on> its the same basically? |
11:01:42 | FromDiscord | <nnsee> yes |
11:01:48 | FromDiscord | <nnsee> wrote up a quick example to demonstrate https://play.nim-lang.org/#ix=4Lt0 |
11:02:02 | FromDiscord | <nnsee> main1 and main2 are equivalent |
11:02:26 | FromDiscord | <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:22 | FromDiscord | <kryp7on> In reply to @nnsee "wrote up a quick": thanks so much Ras! 😄 |
11:03:25 | FromDiscord | <kryp7on> it comes to my mind that |
11:04:28 | FromDiscord | <kryp7on> `defer` is used when you want to "try" some code before other code so if it fails procedure is done |
11:04:54 | FromDiscord | <kryp7on> or its just for finishing procedure, like its `finally`? |
11:05:13 | PMunch | It's mostly for making sure that you close files that you've opened and such |
11:05:16 | FromDiscord | <kryp7on> In reply to @kryp7on "`defer` is used when": or this thing that I said is more `exception` |
11:05:26 | FromDiscord | <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:26 | FromDiscord | <kryp7on> In reply to @PMunch "It's mostly for making": aha, gotcha. Its simple than |
11:05:31 | FromDiscord | <kryp7on> (edit) "than" => "them" |
11:05:40 | FromDiscord | <nnsee> that way, visually, the "clean up" is right next to where it gets initialized |
11:05:41 | FromDiscord | <kryp7on> (edit) "them" => "then, I just overthought it 😄" |
11:05:45 | FromDiscord | <nnsee> which some people like |
11:05:59 | FromDiscord | <nnsee> other people like being more explicit, using `try/finally` |
11:06:02 | FromDiscord | <nnsee> it's a debated topic lol |
11:06:10 | FromDiscord | <nnsee> i think araq at one point wanted to deprecate `defer` |
11:06:20 | FromDiscord | <kryp7on> haha gotcha, gotcha 😄 |
11:06:27 | FromDiscord | <kryp7on> thanks so much! :)) |
11:12:30 | FromDiscord | <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:27 | FromDiscord | <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:45 | FromDiscord | <nnsee> `stdcall` is for some microsoft compiler specific thing |
11:17:49 | FromDiscord | <nnsee> not really sure what it does tbh |
11:18:19 | FromDiscord | <nnsee> https://learn.microsoft.com/en-us/cpp/cpp/stdcall?view=msvc-170 |
11:19:05 | FromDiscord | <nnsee> so it sets an appropriate calling convention for win32 API functions |
11:19:14 | FromDiscord | <nnsee> i think the other alternative is `fastcall` |
11:20:37 | FromDiscord | <nnsee> and of course cdecl which I'm not sure if windows does the same way as unix-likes |
11:21:22 | FromDiscord | <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:45 | FromDiscord | <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:20 | FromDiscord | <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:07 | FromDiscord | <Phil> Sadly I've only dockerized webservers, never worked with bitmancer |
11:28:33 | FromDiscord | <jdb_jdb> first time I've used nim, feels like hell trying to debug why stuff doesn't works |
11:28:39 | FromDiscord | <jdb_jdb> (edit) "works" => "work" |
11:28:59 | FromDiscord | <jdb_jdb> feel like rust is way more consistent |
11:30:09 | FromDiscord | <jdb_jdb> most of the issue is probably crosscompiling to windows |
11:30:58 | FromDiscord | <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:18 | FromDiscord | <jdb_jdb> yeah it's fine lmao |
11:31:26 | FromDiscord | <jdb_jdb> I'm just over here coping |
11:32:18 | FromDiscord | <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:52 | FromDiscord | <jdb_jdb> gtk is megacursed |
11:32:58 | FromDiscord | <jdb_jdb> most gui stuff is tbf |
11:33:13 | * | jmdaemon quit (Ping timeout: 260 seconds) |
11:34:17 | FromDiscord | <kryp7on> In reply to @nnsee "yes, pragmas can be": thanks |
11:35:21 | FromDiscord | <Phil> In reply to @jdb_jdb "gtk is megacursed": I do Angular webdev at work.↵This level of cursed is weaksauce |
11:38:20 | FromDiscord | <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:22 | FromDiscord | <Phil> The more I contribute to owlkettle the more I really like the DSL there |
11:39:29 | FromDiscord | <Phil> Just wish it would support when statements |
11:39:44 | FromDiscord | <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:27 | FromDiscord | <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:03 | FromDiscord | <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:34 | FromDiscord | <pmunch> @Phil\: how is the Owlkettle DSL compared to genui? |
12:21:48 | FromDiscord | <pmunch> For context\: https://github.com/PMunch/gtk3genui |
12:25:03 | Amun-Ra | is 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:12 | FromDiscord | <pmunch> \`--expandMacro\`? |
12:32:54 | FromDiscord | <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:23 | FromDiscord | <Phil> The owlkettle dsl does provide nicer ways to do event-listener procs though imo |
12:35:25 | FromDiscord | <Phil> sent a code paste, see https://play.nim-lang.org/#ix=4Ltm |
12:36:21 | FromDiscord | <Phil> The fact that an event-listener is basically bog-standard nim syntax to me is a big plus |
12:36:59 | FromDiscord | <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:30 | Amun-Ra | pmunch: hmm, thanks |
12:40:51 | FromDiscord | <pmunch> That makes a lot of sense, thanks |
12:41:41 | FromDiscord | <dissolved.girl> Why is it called owlkettle? |
12:41:52 | FromDiscord | <Phil> You'd need to ask the author |
12:43:52 | * | xet7 joined #nim |
12:44:30 | FromDiscord | <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:00 | FromDiscord | <pk.kyle> idk but winim probably helps |
13:20:28 | * | lucasta joined #nim |
13:21:54 | NimEventer | New 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:18 | FromDiscord | <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:33 | FromDiscord | <Chronos [She/Her]> Hm... Maybe I should look at polishing my library for MC networking in Nim |
15:20:42 | FromDiscord | <Chronos [She/Her]> And see if I could get a bot client working or something |
15:21:09 | FromDiscord | <Phil> In reply to @chronos.vitaqua "Hm... Maybe I should": Polishing libraries is always a good thing |
15:21:14 | FromDiscord | <Phil> I mean, nim has a fair amount of libraries |
15:21:26 | FromDiscord | <Phil> But imo it doesn't have enough libraries in general imo that just scream polish |
15:21:46 | FromDiscord | <odexine> just remove the vowels and add lots of ywcz |
15:22:10 | FromDiscord | <Phil> That's why I'm also an advocate of going on a hunt for libs that could use contributions! |
15:22:18 | FromDiscord | <Phil> Like lowdb and nimword! |
15:22:34 | FromDiscord | <Chronos [She/Her]> Fsir |
15:22:35 | FromDiscord | <Chronos [She/Her]> Fair |
15:22:45 | FromDiscord | <Chronos [She/Her]> I just think an MC library for client stuff would be interesting :PP |
15:22:56 | FromDiscord | <Chronos [She/Her]> For network stuff in general |
15:22:56 | FromDiscord | <Chronos [She/Her]> ...which I have |
15:22:59 | FromDiscord | <odexine> my suru needs a look xd i havent touched that thing in ages ngl |
15:22:59 | FromDiscord | <Chronos [She/Her]> I just need to make it better |
15:23:27 | FromDiscord | <Chronos [She/Her]> And I'm wondering if I should avoid streams tbh- |
15:23:38 | FromDiscord | <Chronos [She/Her]> And just use a seq byte |
15:23:39 | FromDiscord | <Chronos [She/Her]> Hmmmm |
15:23:43 | FromDiscord | <Chronos [She/Her]> Eh |
15:23:58 | FromDiscord | <Phil> Write both, do a benchmark, decide then |
15:25:20 | FromDiscord | <Chronos [She/Her]> How do I do benchmarks.... :P |
15:25:32 | FromDiscord | <Chronos [She/Her]> Though yeah I'm definitely gonna write and compare both |
15:26:42 | FromDiscord | <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:45 | FromDiscord | <jdb_jdb> how would `(DWORD)` be written in nim? |
15:26:56 | FromDiscord | <jdb_jdb> I thought you'd just cast twice |
15:27:10 | FromDiscord | <Phil> That is... what is that? A pointer to... a macro? |
15:27:12 | FromDiscord | <jdb_jdb> but it appears I am mistake given my unix timestamp says I'm in the year 30268 |
15:27:42 | FromDiscord | <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:08 | FromDiscord | <jdb_jdb> very possible |
15:28:13 | FromDiscord | <jdb_jdb> pointer to a u64 |
15:28:49 | FromDiscord | <Phil> given that I see 2 stars that's still just a single pointer to a uint64? |
15:29:00 | FromDiscord | <Phil> or is that a pointer to a pointer somehow? |
15:29:13 | FromDiscord | <Chronos [She/Her]> In reply to @isofruit "Easy, you also compile": Don't have any if much of the server done- |
15:29:26 | FromDiscord | <jdb_jdb> https://itecnote.com/tecnote/c-convert-current-time-from-windows-to-unix-timestamp-in-c-or-c/ |
15:29:53 | FromDiscord | <Phil> Pretty bold of you to assume I can read C or C++ |
15:29:56 | FromDiscord | <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:51 | FromDiscord | <Phil> Okay I completely fail to connect that link to your question |
15:31:01 | FromDiscord | <jdb_jdb> sent a code paste, see https://play.nim-lang.org/#ix=4Luj |
15:31:15 | FromDiscord | <jdb_jdb> this is the rust equivalent |
15:31:20 | FromDiscord | <jdb_jdb> which I'm trying to write in nim |
15:31:21 | FromDiscord | <jdb_jdb> so |
15:31:28 | FromDiscord | <odexine> hello i can read C |
15:31:29 | FromDiscord | <odexine> what' |
15:31:29 | FromDiscord | <jdb_jdb> the pointer is `time_low_ptr` |
15:31:33 | FromDiscord | <odexine> fuck i hit enter |
15:31:41 | FromDiscord | <jdb_jdb> which is where the dword ptr would be from |
15:31:55 | FromDiscord | <jdb_jdb> given dword is u32 |
15:32:49 | FromDiscord | <Phil> I mean is ptr or "pointer" (depending on the context, both tend to be valid) |
15:33:02 | FromDiscord | <Phil> (edit) "I mean ... isin" added "in C" | "in Cis ptr or "pointer" ... (depending" added "in nim" |
15:33:15 | FromDiscord | <jdb_jdb> so you can cast to a pointer? |
15:33:28 | FromDiscord | <odexine> is commonl only pointer if `void` or `<type not imported to nim>` (second case is not really sensible) |
15:33:31 | FromDiscord | <odexine> (edit) "" => "\" |
15:33:42 | FromDiscord | <odexine> you can cast to pointer sure |
15:34:34 | FromDiscord | <odexine> In reply to @jdb_jdb "https://itecnote.com/tecnote/c-convert-current-time": i dont see DWORD here |
15:35:21 | FromDiscord | <jdb_jdb> sent a code paste, see https://play.nim-lang.org/#ix=4Luk |
15:35:26 | FromDiscord | <odexine> well i cannot read rust |
15:35:30 | FromDiscord | <jdb_jdb> which is why |
15:35:32 | FromDiscord | <jdb_jdb> in the line below it |
15:35:38 | FromDiscord | <jdb_jdb> In reply to @jdb_jdb "given dword is u32": here |
15:36:01 | FromDiscord | <jdb_jdb> sent a code paste, see https://play.nim-lang.org/#ix=4Lul |
15:36:03 | FromDiscord | <jdb_jdb> I found a c example |
15:36:21 | FromDiscord | <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:37 | FromDiscord | <Phil> Ohhhhh this is casting some bytes to a pointer to whatever the heck DWORD is ? |
15:36:39 | FromDiscord | <odexine> `cast[ptr uint32](0x7FFE0000 + 0x14)[]` |
15:36:40 | * | mronetwo joined #nim |
15:37:01 | FromDiscord | <odexine> this is kinda dangey so yeah |
15:37:55 | FromDiscord | <jdb_jdb> yeah get errors doing that |
15:37:56 | FromDiscord | <jdb_jdb> woozed |
15:38:01 | FromDiscord | <bostonboston> Aren't wintypes great |
15:38:15 | FromDiscord | <Phil> All I see is screaming case screaming at me |
15:39:27 | FromDiscord | <odexine> i dont see why you're casting pointer addresses |
15:39:37 | FromDiscord | <odexine> rather i dont understand |
15:39:39 | FromDiscord | <jdb_jdb> this works |
15:39:41 | FromDiscord | <jdb_jdb> sent a code paste, see https://play.nim-lang.org/#ix=4Lun |
15:39:48 | FromDiscord | <jdb_jdb> ty for the help, although |
15:39:57 | FromDiscord | <jdb_jdb> I don't understand the array looking brackets at the end |
15:40:01 | FromDiscord | <odexine> that's dereference |
15:40:05 | FromDiscord | <jdb_jdb> ohh |
15:40:12 | FromDiscord | <jdb_jdb> okay |
15:40:15 | FromDiscord | <jdb_jdb> cool, that makes sense |
15:40:31 | FromDiscord | <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:41 | FromDiscord | <jdb_jdb> yeah true |
15:41:42 | FromDiscord | <bostonboston> `void (((f[])())()` |
15:41:53 | FromDiscord | <odexine> see that website in #offtopic |
15:43:30 | FromDiscord | <Phil> Hello, I am many people |
15:43:47 | FromDiscord | <jdb_jdb> the typing is kinda why I'm not using rust |
15:43:59 | FromDiscord | <jdb_jdb> working with type casting structures in rust isn't really working |
15:44:34 | FromDiscord | <jdb_jdb> creating an lsa_string only to fix out the buffer is a pointer rather than a dereferenced array |
15:44:41 | FromDiscord | <odexine> In reply to @isofruit "Hello, I am many": many people == anyone who isnt Dennis Ritchie |
15:48:22 | NimEventer | New post on r/nim by qtless: HappyX Decorators, see https://reddit.com/r/nim/comments/17v52nk/happyx_decorators/ |
15:50:19 | FromDiscord | <odexine> cursed |
15:50:22 | FromDiscord | <odexine> legitimately cursed |
15:52:09 | FromDiscord | <jdb_jdb> windows gets worse than that though |
15:52:20 | FromDiscord | <jdb_jdb> most of the api calls have some super specific format it wants output in |
15:52:23 | FromDiscord | <jdb_jdb> lsa_string |
15:52:25 | FromDiscord | <jdb_jdb> plsa_string |
15:52:29 | FromDiscord | <jdb_jdb> lsa_unicode_string |
15:52:33 | FromDiscord | <jdb_jdb> plsa_unicode_string |
15:52:47 | FromDiscord | <jdb_jdb> none are actual strings |
15:53:54 | FromDiscord | <odexine> have fun |
15:53:58 | FromDiscord | <odexine> i wish you luck i guess |
15:54:25 | FromDiscord | <bostonboston> It's not so bad |
15:54:53 | FromDiscord | <jdb_jdb> I've not looked at lsa_string in nim yet but I expect I'll have issues |
15:55:05 | FromDiscord | <jdb_jdb> given the only places I can find it is in the library types |
15:55:09 | FromDiscord | <jdb_jdb> and not actual implementation |
15:55:14 | FromDiscord | <jdb_jdb> I think I'll pass away |
15:57:58 | FromDiscord | <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:13 | FromDiscord | <jdb_jdb> \:) |
15:58:17 | FromDiscord | <jdb_jdb> free healthcare here |
15:58:28 | FromDiscord | <jdb_jdb> :MarioWooDance: |
16:02:07 | FromDiscord | <jdb_jdb> however |
16:02:40 | FromDiscord | <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:43 | FromDiscord | <xtrayambak> In reply to @pmunch "Panicoverride is used for": Aaah, makes sense. Thanks. |
16:16:07 | om3ga | is there any type of sequence or table or anything that will preserve key value order? |
16:17:12 | FromDiscord | <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:13 | om3ga | I 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:27 | om3ga | Phil, no, not insertion order |
16:18:07 | FromDiscord | <Phil> In that case I don't think there's sth in the lib. |
16:18:16 | FromDiscord | <jviega> Just sort it?? |
16:18:20 | om3ga | eh.. sad |
16:18:40 | om3ga | jviega, that's the point, to not sort it |
16:18:52 | FromDiscord | <Chronos [She/Her]> Is there a way to make a pragma that applies another pragma to a proc? :P |
16:19:17 | FromDiscord | <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:07 | om3ga | jviega, yeah, but this requires value mapping to indx, or something similar |
16:20:35 | FromDiscord | <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:46 | FromDiscord | <jviega> But just use a seq of tuples and do an insertion sort |
16:21:13 | FromDiscord | <demotomohiro> How about to use linkedList and insert right position. |
16:21:40 | om3ga | right, this will work sure jviega, only I had a hope for something more easy |
16:21:56 | om3ga | demotohimoro, idk this, what is linked list? |
16:22:36 | om3ga | oh I see |
16:22:41 | om3ga | interesting |
16:23:18 | FromDiscord | <demotomohiro> https://nim-lang.org/docs/lists.html |
16:23:50 | FromDiscord | <demotomohiro> linked list can do insertion and delete in O(1). |
16:24:01 | FromDiscord | <jviega> I mean, there are all sorts of skip-list schemes people use |
16:24:01 | FromDiscord | <demotomohiro> But slow to iterator. |
16:24:55 | FromDiscord | <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:44 | om3ga | =demotoddddd |
16:26:03 | om3ga | sorry, wsl console lag |
16:26:51 | om3ga | demotomohiro, thank you, looks like what I exactly looking for! |
16:27:46 | om3ga | jviega unfortunately slow |
16:29:19 | FromDiscord | <jviega> ?? |
16:30:33 | FromDiscord | <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:34 | FromDiscord | <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:41 | FromDiscord | <e.e.7> I believe it's valid. It works for me, at least. What's the problem? |
17:03:53 | FromDiscord | <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:20 | Amun-Ra | I 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:27 | FromDiscord | <bostonboston> In reply to @e.e.7 "I believe it's valid.": It just doesn't work for me |
17:14:24 | FromDiscord | <e.e.7> Could you share a minimal reproducible example? |
17:14:36 | FromDiscord | <bostonboston> sent a code paste, see https://play.nim-lang.org/#ix=4Lv2 |
17:16:09 | Amun-Ra | thhis is the same as const foo {.used.} = 0 |
17:16:50 | FromDiscord | <jdb_jdb> In reply to @kryp7on "I cant find in": what part? |
17:16:59 | FromDiscord | <jdb_jdb> CreateToolhelp32Snapshot? |
17:17:11 | FromDiscord | <jdb_jdb> winim is just the implementation of winapi in nim |
17:17:25 | FromDiscord | <kryp7on> In reply to @jdb_jdb "CreateToolhelp32Snapshot?": yes |
17:17:58 | FromDiscord | <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:00 | FromDiscord | <jdb_jdb> https://github.com/byt3bl33d3r/OffensiveNim/blob/c034fe11c7b4a1affc92c7951667fb2cff8e0da8/src/sandbox_process_bin.nim#L69-L70 |
17:18:04 | FromDiscord | <jdb_jdb> nope |
17:18:10 | FromDiscord | <jdb_jdb> I don't know nim |
17:18:14 | FromDiscord | <jdb_jdb> I only started writing it today |
17:18:34 | FromDiscord | <kryp7on> In reply to @jdb_jdb "I only started writing": cool link. Thanks for it :)) |
17:19:19 | FromDiscord | <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:35 | Amun-Ra | bostonboston: yes, in that case push/pop or custom pragma is better |
17:24:09 | FromDiscord | <jdb_jdb> bruh |
17:24:22 | FromDiscord | <jdb_jdb> this api call isn't even in winim? |
17:24:33 | FromDiscord | <jdb_jdb> ConvertSidToStringSidA |
17:25:23 | FromDiscord | <jdb_jdb> rip |
17:25:34 | FromDiscord | <jdb_jdb> truly pass awya |
17:25:36 | FromDiscord | <jdb_jdb> (edit) "awya" => "away" |
17:26:43 | FromDiscord | <e.e.7> sent a code paste, see https://play.nim-lang.org/#ix=4Lv7 |
17:27:13 | FromDiscord | <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:25 | FromDiscord | <e.e.7> I didn't see an open issue on GitHub for this exact case. Would you like to create one? |
17:36:24 | Amun-Ra | https://github.com/nim-lang/Nim/issues/4044 |
17:38:02 | Amun-Ra | ^ e.e.7 |
17:38:49 | FromDiscord | <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:34 | FromDiscord | <Chronos [She/Her]> And multisync is sorta confusing :P |
17:41:25 | FromDiscord | <Chronos [She/Her]> Wait am I just an idiot |
17:41:41 | FromDiscord | <odexine> perhaps? |
17:41:48 | FromDiscord | <odexine> i dont know its up to you to judge |
17:42:23 | FromDiscord | <odexine> in any case multisync basically just "makes two versions" of a proc where one has `await` and the other doesnt |
17:44:28 | FromDiscord | <e.e.7> sent a code paste, see https://play.nim-lang.org/#ix=4Lvf |
17:45:04 | FromDiscord | <Chronos [She/Her]> Indeed I am |
17:45:18 | FromDiscord | <kompiler> Hi nimblerrs, ↵↵New here and any resources on starting nim ? |
17:45:26 | FromDiscord | <kompiler> (edit) "nimblerrs," => "nimblers," |
17:46:50 | Amun-Ra | e.e.7: right |
17:48:42 | * | krux02 joined #nim |
17:53:41 | FromDiscord | <Chronos [She/Her]> I should figure out how to write more descriptive tests :P |
17:55:03 | FromDiscord | <odexine> there are many ways to specify tests |
17:55:30 | FromDiscord | <Chronos [She/Her]> And I should write more tests in general :PPP |
17:59:12 | FromDiscord | <huantian> In reply to @kompiler "Hi nimblers, ": Start with the tutorial on the site |
18:03:52 | FromDiscord | <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:22 | FromDiscord | <demotomohiro> https://nim-lang.org/docs/manual.html#implementation-specific-pragmas-header-pragma |
18:08:48 | FromDiscord | <241_01499> HSlice was a mistake |
18:11:44 | FromDiscord | <kryp7on> In reply to @demotomohiro "Using WinAPI are same": bruh, sry man, that didnt help 😅 |
18:12:08 | FromDiscord | <kryp7on> Im new to Nim, so adding Win APIs melt my brain. Im clueless how to use them in Nim |
18:13:40 | FromDiscord | <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:35 | FromDiscord | <demotomohiro> And Windows API documents are written for C programmer.↵And you need to read windows api documents to use api safely. |
18:15:00 | FromDiscord | <jdb_jdb> nah |
18:15:02 | FromDiscord | <jdb_jdb> I beg to differ |
18:15:12 | FromDiscord | <jdb_jdb> I started using winapi and still haven't learnt C |
18:15:24 | FromDiscord | <jdb_jdb> just research lots |
18:15:24 | Amun-Ra | I agree with demotomohiro |
18:15:27 | FromDiscord | <kryp7on> In reply to @demotomohiro "If you really want": bruh, I would literally learn JavaScript instead of C lmao |
18:15:28 | FromDiscord | <kryp7on> hate C |
18:15:28 | FromDiscord | <jdb_jdb> cope |
18:15:32 | FromDiscord | <jdb_jdb> you might agree with him |
18:15:37 | FromDiscord | <jdb_jdb> but it's an opinion |
18:15:50 | Amun-Ra | it's not C you should hate but atriocious winapi |
18:16:30 | FromDiscord | <jdb_jdb> written many things in rust and nim using winapi |
18:16:34 | FromDiscord | <jdb_jdb> having never put time into c |
18:16:39 | FromDiscord | <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:40 | FromDiscord | <jdb_jdb> it's not terrible |
18:16:44 | FromDiscord | <jdb_jdb> yeah C is grim |
18:16:53 | FromDiscord | <jdb_jdb> have fun doing memory management |
18:16:54 | FromDiscord | <kryp7on> In reply to @jdb_jdb "written many things in": was learning Rust before, switched to nim cuz its easier for beginner |
18:16:59 | FromDiscord | <jdb_jdb> I mean |
18:17:01 | FromDiscord | <jdb_jdb> maybe |
18:17:09 | FromDiscord | <jdb_jdb> rust has stricter types I think |
18:17:10 | FromDiscord | <demotomohiro> Using windows API without knowing C would be like driving a car without knowing signs on street. |
18:17:14 | FromDiscord | <jdb_jdb> you're stupid |
18:17:18 | FromDiscord | <jdb_jdb> that's 100% not true |
18:17:33 | FromDiscord | <jdb_jdb> rust documentation is better than nim |
18:17:34 | Amun-Ra | I tried rust for year or more, I'd rather write C |
18:17:38 | FromDiscord | <jdb_jdb> but nim isn't as strict |
18:17:41 | FromDiscord | <odexine> In reply to @jdb_jdb "rust documentation is better": yes |
18:17:48 | FromDiscord | <jdb_jdb> especially for winapi stuff |
18:17:54 | FromDiscord | <odexine> consider the size of the community though |
18:17:57 | FromDiscord | <jdb_jdb> it's an uphill battle looking for winapi nim documentation |
18:17:58 | FromDiscord | <jdb_jdb> true |
18:18:12 | FromDiscord | <jdb_jdb> both have discords with pretty active people though |
18:18:17 | FromDiscord | <jdb_jdb> so most questions get answered |
18:18:20 | FromDiscord | <odexine> In reply to @241_01499 "HSlice was a mistake": would you like to elaborate? |
18:19:52 | NimEventer | New thread by bsljth: How many developers are working on Nim?, see https://forum.nim-lang.org/t/10636 |
18:22:15 | FromDiscord | <jdb_jdb> also |
18:22:21 | FromDiscord | <jdb_jdb> I'm not sure why some functions just |
18:22:30 | FromDiscord | <jdb_jdb> aren't in winim |
18:22:51 | FromDiscord | <jdb_jdb> but since all the winapi is , is just a bunch of functions in dlls |
18:22:59 | FromDiscord | <jdb_jdb> you can just import anything you don't have |
18:23:07 | FromDiscord | <jdb_jdb> which means you can do the same with your own libraries |
18:25:09 | FromDiscord | <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:42 | FromDiscord | <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:13 | FromDiscord | <jdb_jdb> what if the functions are in header files |
18:26:18 | FromDiscord | <jdb_jdb> but still aren't in it |
18:26:54 | FromDiscord | <jdb_jdb> :despairge: |
18:27:35 | * | casaca quit (Server closed connection) |
18:27:49 | * | casaca joined #nim |
18:28:16 | FromDiscord | <demotomohiro> Maybe translating C header files is failing or some `#ifdef` in header might causing problems. |
18:28:27 | FromDiscord | <jdb_jdb> ¯\_(ツ)_/¯ |
18:28:31 | FromDiscord | <jdb_jdb> who knows |
18:28:35 | FromDiscord | <jdb_jdb> library woozed |
18:28:57 | FromDiscord | <m4ul3r> Winim is useful. If something isn’t in there, just do it yourself. It’s not hard to implement |
18:29:05 | FromDiscord | <jdb_jdb> yea lmao |
18:29:10 | FromDiscord | <jdb_jdb> that's what I did |
18:29:13 | FromDiscord | <m4ul3r> Most stuff I’ve needed have been in there. The rest are undocumented |
18:29:22 | FromDiscord | <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:14 | FromDiscord | <bostonboston> Very true about the documentation part, winim has so much stuff undocumented, but that's expected |
18:59:29 | FromDiscord | <bostonboston> Windef.nim is 10k lines alone |
19:00:36 | * | lucasta joined #nim |
19:02:11 | FromDiscord | <Phil> Do what I do for owlkettle:↵Make a gargantuan doc PR that introduces a nimibook. |
19:02:34 | FromDiscord | <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:39 | FromDiscord | <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:27 | FromDiscord | <Chronos [She/Her]> sent a code paste, see https://play.nim-lang.org/#ix=4LvG |
19:12:45 | FromDiscord | <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:48 | FromDiscord | <jdb_jdb> 🥴 |
19:57:50 | Amun-Ra | Chronos: what's the def of SignedInts and UnsignedInts? |
20:03:02 | FromDiscord | <Chronos [She/Her]> sent a code paste, see https://play.nim-lang.org/#ix=4LvU |
20:06:27 | * | PMunch joined #nim |
20:11:22 | FromDiscord | <Chronos [She/Her]> Naming truly is horrid |
20:12:32 | FromDiscord | <stoneface86> I'd call them words since they're multibyte integers and since system has `SomeSignedInt` and `SomeUnsignedInt` |
20:13:25 | FromDiscord | <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:50 | FromDiscord | <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:04 | FromDiscord | <stoneface86> oh I got your intention, meant that the name `SignedInts` sounds too similar to `SomeSignedInt` |
20:14:11 | FromDiscord | <Chronos [She/Her]> Ah fair |
20:14:23 | FromDiscord | <Chronos [She/Her]> Hm, I'll think of a name later maybe :P |
20:19:49 | FromDiscord | <stoneface86> naming is hard 😔 |
20:20:58 | FromDiscord | <Chronos [She/Her]> Yep |
20:21:29 | FromDiscord | <.bobbbob> I tried rust but went to nim because rust is kind of ugly and overcomplicated imo |
20:22:26 | FromDiscord | <stoneface86> I like the goals of rust but its syntax is just as ugly as C++ so I'll pass |
20:25:47 | FromDiscord | <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:19 | PMunch | @gbolahan, not unless eth-trie has a switch for it |
20:28:36 | PMunch | You can't just tell Nim to not compile part of a program |
20:30:19 | FromDiscord | <.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:28 | PMunch | There is a switch to replace a module with a a custom module though |
20:30:53 | PMunch | Well if you delete the import then it's no longer imported and thus not compiled |
20:35:00 | FromDiscord | <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:01 | PMunch | What is the error you get? |
20:40:50 | * | lucasta quit (Quit: Leaving) |
20:49:41 | FromDiscord | <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:38 | FromDiscord | <gbolahan> The response to the issue just made more sense to me |
21:01:48 | FromDiscord | <gbolahan> resolved |
21:06:19 | * | krux02 joined #nim |
21:17:50 | FromDiscord | <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:50 | FromDiscord | <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:01 | FromDiscord | <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:45 | FromDiscord | <Elegantbeef> You can easily scan it if you want to abuse scanf more |
23:27:28 | FromDiscord | <Elegantbeef> sent a code paste, see https://play.nim-lang.org/#ix=4LwG |
23:41:06 | Amun-Ra | I managed to finish my dynlib/symaddr generator \o/ -> https://i.postimg.cc/jqxqRKQZ/dlutils2.png |
23:46:32 | FromDiscord | <guttural666> sent a code paste, see https://play.nim-lang.org/#ix=4LwJ |
23:48:18 | Amun-Ra | you can use $ instead of string() |
23:48:52 | FromDiscord | <guttural666> Path sadly does not have a $ function |
23:49:24 | Amun-Ra | hmm |
23:49:39 | Amun-Ra | ah, it's a distinct stringiirc |
23:49:45 | FromDiscord | <guttural666> Path being a distinct string |
23:49:46 | FromDiscord | <guttural666> yeah |
23:51:41 | Amun-Ra | btw, this should also work :) result.id = result.url.parseUri.path.string.extractFilename |
23:53:14 | FromDiscord | <bostonboston> Can a proc that returns an object `foo` return a derived object `bar = object of foo` |
23:53:55 | Amun-Ra | that should work with refs (iirc) |
23:54:56 | FromDiscord | <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:04 | FromDiscord | <guttural666> though I do like to add the () to denote it's a function and not a member variable |
23:58:13 | Amun-Ra | I tend not to use () at all if possible |
23:59:34 | FromDiscord | <guttural666> this is how I'm going to leave it 😄↵result.id = result.url.parseUri().path.Path().extractFilename().string() |