<< 14-02-2025 >>

00:18:01FromDiscord<Elegantbeef> @System64 ~ Flandre Scarlet just to confirm the vsbf dumper error was because you did something to the file? It's not due to vsbf's ouput?
00:18:18FromDiscord<Elegantbeef> Or was the issue you were talking about was something else
00:39:17*tanami_ quit (Ping timeout: 248 seconds)
00:39:25*tanami joined #nim
00:53:54FromDiscord<steschuser (steschuser)> no love for X509 support? ;\_;
00:54:12FromDiscord<Elegantbeef> "PRs welcome"
00:55:04FromDiscord<System64 ~ Flandre Scarlet> sent a code paste, see https://play.nim-lang.org/#pasty=SRLrXknr
00:56:02FromDiscord<System64 ~ Flandre Scarlet> Here is an exported file https://media.discordapp.net/attachments/371759389889003532/1339762042273534065/test2.kxp?ex=67afe622&is=67ae94a2&hm=ddcca1bd14560d853e8392c659b7b2aff001c3c9488556af77bb219ef50cc023&
00:56:24FromDiscord<Elegantbeef> Would be best if I could also get code that could replicate the file
00:56:33FromDiscord<Elegantbeef> Just to see if it's an encoding issue or dumping issue
00:59:46FromDiscord<System64 ~ Flandre Scarlet> sent a code paste, see https://play.nim-lang.org/#pasty=cASYWZSc
01:00:18FromDiscord<Elegantbeef> Oh so it's just a dumper issue
01:00:32FromDiscord<Elegantbeef> Bad traversal logic in my code then
01:00:35FromDiscord<System64 ~ Flandre Scarlet> (edit) "https://play.nim-lang.org/#pasty=jKcxAXWm" => "https://play.nim-lang.org/#pasty=AvThNXuL"
01:01:02FromDiscord<System64 ~ Flandre Scarlet> Another bug ready to be squished!
01:08:54*SchweinDeBurg quit (Quit: WeeChat 4.6.0-dev)
01:16:43FromDiscord<Elegantbeef> @System64 ~ Flandre Scarlet how many modules are being saved here?
01:16:45FromDiscord<Elegantbeef> Seems like there are 5?
01:18:06*SchweinDeBurg joined #nim
01:21:51FromDiscord<System64 ~ Flandre Scarlet> In reply to @Elegantbeef "Seems like there are": yes
01:26:22FromDiscord<Elegantbeef> Oh heh I never updated the dumper for when I left leb128 encoded single bytes
01:28:57FromDiscord<Elegantbeef> Well thanks again 0.1.18 is out with a fix that should be right
01:29:10FromDiscord<Elegantbeef> Do check the data if you can just to make sure it looks right to you 😄
01:30:26FromDiscord<Elegantbeef> There is something nice that a simple dumper can be made in 130 loc with a little code from the decoder
01:30:36FromDiscord<Elegantbeef> Makes me happy that anyone could feasibly walk the untyped data
01:54:23FromDiscord<System64 ~ Flandre Scarlet> In reply to @Elegantbeef "Do check the data": https://media.discordapp.net/attachments/371759389889003532/1339776721829761024/dump.txt?ex=67aff3ce&is=67aea24e&hm=04c49b96b214ca60ffa186812111ce0e28ea5b36d974ea38545e43433fb88e62&
02:09:34FromDiscord<Elegantbeef> @System64 ~ Flandre Scarlet yea I mean is that 'right'? 😄
02:11:43FromDiscord<System64 ~ Flandre Scarlet> In reply to @Elegantbeef "<@380360389377916939> yea I mean": Yes, those are arrays of bytes, so I guess it's the intended behavior?
02:42:42FromDiscord<amadaluzia> hey!↔↔i am learning nim as part of learning how to use EWW (for wayland widgets) and the program i am using has a feature which uses sockets
02:42:55FromDiscord<amadaluzia> the issue is that i want to listen to the socket but get the relevant json
02:43:19FromDiscord<amadaluzia> i've looked at std/net and it seems i can't find a solution
02:47:11FromDiscord<Elegantbeef> @amadaluzia `newSocket` on the port that is expected then just read fro mit
03:13:47*PMunch_ joined #nim
03:16:00*PMunch__ quit (Ping timeout: 272 seconds)
03:29:02*ensyde joined #nim
03:30:54FromDiscord<explosiveend> i'm trying to use the `argparse` library in my nim project (installed using `nimble install argparse`), but i still can't use `nimble run` b/c it doesn't recognize the `import argparse`. is there something else i'm supposed to do?
03:31:19FromDiscord<Elegantbeef> did you `requires "argparse >= the.version.ithas"`?
03:31:35FromDiscord<explosiveend> what file would i do that in?
03:31:44FromDiscord<Elegantbeef> Your .nimble
03:32:41FromDiscord<explosiveend> ah i hadn't, thanks lol
03:34:15FromDiscord<explosiveend> also should i run `nimble setup`? reading the docs for it and don't really understand its purpose
03:34:54FromDiscord<Elegantbeef> I've never used it myself
03:35:51FromDiscord<explosiveend> oh, prob not needed then
03:40:10FromDiscord<explosiveend> last question, i'm tryna make a cli tool; is there a way to pass args / flags to `nimble run` that get passed to the program? e.g. `nimble run calculate --a=3`, where `calculate` is a `cmdArgument` to the main program?
03:40:54FromDiscord<explosiveend> (edit) "last question, i'm tryna make a cli tool; is there a way to pass args / flags to `nimble run` that get passed to the program? e.g. `nimble run calculate --a=3`, where `calculate` is a `cmdArgument` ... to" added "and `a` is a `cmdLongOption`"
03:41:34FromDiscord<explosiveend> or should i just use `nim c -r myProj.nim [args] --flags`
03:41:55FromDiscord<explosiveend> (edit) "should" => "do" | "just" => "have to" | "myProj.nim" => "src/myProj.nim"
03:46:43FromDiscord<explosiveend> nvm found out i can use `nimble run -- [args]`
03:54:28FromDiscord<lainlaylie> nimble setup generates a nimble.paths file with --path directives and includes it in your config.nims
03:54:41FromDiscord<lainlaylie> this lets you compile your program with `nim c`
04:17:51FromDiscord<nasuray> In reply to @amadaluzia "hey! i am": Is the program hyprland? I use nim to glue data from hyprland sockets to EWW
04:18:03FromDiscord<amadaluzia> niri
04:20:03FromDiscord<amadaluzia> its the same case here but this time with JSON
04:20:49FromDiscord<nasuray> If it's helpful this is how I get data from the hyprland socket. one of which is json based https://git.dayl.in/daylin/hyprman/src/commit/9f2be2c4ac037c19b10e46edd631d2443f599d70/src/hyprland.nim#L40
04:21:36FromDiscord<nasuray> I just keep reading data in a while loop till I get nothing then break
04:21:54FromDiscord<Elegantbeef> Should likely use a selector
05:26:18*PMunch__ joined #nim
05:29:43*PMunch_ quit (Ping timeout: 268 seconds)
06:17:28*ntat joined #nim
08:06:33*ntat quit (Quit: Leaving)
08:58:43FromDiscord<aintea> In reply to @emanresu3 "I see a `std/threadpool`": I think it is deprecated, when you compile it will tell you it's deprecated and will suggest you use something else with suggestions
09:57:07*ntat joined #nim
10:55:39*ntat quit (Quit: Leaving)
11:16:54*beholders_eye joined #nim
12:24:06*PMunch_ joined #nim
12:26:29*PMunch__ quit (Ping timeout: 248 seconds)
13:28:45*ntat joined #nim
13:33:36*ensyde quit (Quit: WeeChat 4.5.1)
13:50:27*om3ga quit (Ping timeout: 268 seconds)
14:03:11FromDiscord<System64 ~ Flandre Scarlet> I have a question↔Can zigcc let me target MacOS from Linux?
15:08:35FromDiscord<janakali> In reply to @sys64 "I have a question": in theory - yes, but you need apple sdk, I tried zigcc with macos target and it fails with error trying to find macos frameworks
15:08:58FromDiscord<janakali> also see https://github.com/ziglang/zig/issues/10513 for relevant include paths
15:27:21FromDiscord<emanresu3> But I would have like to do with async-await, maybe there was a way to do `Promise.all()` in Nim but I don't find it. One forum post had something about it but the forum is not loading posts for me idk why
15:27:23FromDiscord<emanresu3> sent a code paste, see https://play.nim-lang.org/#pasty=GjogacVw
16:04:36FromDiscord<System64 ~ Flandre Scarlet> In reply to @janakali "in theory - yes,": Sounds like a nightmare to do
16:14:48FromDiscord<System64 ~ Flandre Scarlet> Variants vs inheritence, which is better?
16:14:59FromDiscord<odexine> most people will point you to variants first
16:16:49FromDiscord<System64 ~ Flandre Scarlet> In reply to @odexine "most people will point": Oh my... Should I rewrite the entire code of my synth?
16:17:03FromDiscord<odexine> no not necessarily
16:17:24FromDiscord<odexine> the answer is dependent on requirements
16:17:54FromDiscord<System64 ~ Flandre Scarlet> The modular system uses inheritence, method overloading and polymorphism
16:19:04FromDiscord<System64 ~ Flandre Scarlet> And each module calls the synthesize() method of the previous one
16:31:05FromDiscord<bubbly_avocado_86424> did anyone happen to build experience with https://avaloniaui.net/showcase ?
16:46:57FromDiscord<System64 ~ Flandre Scarlet> In reply to @odexine "the answer is dependent": I would need quite a lot of case statements with variants, but I would benifit from cache-friendly structures↔But it is easier to develop with inheritence
16:47:50FromDiscord<odexine> id say if youre not experiencing performance issues now then stay as is
16:50:48FromDiscord<System64 ~ Flandre Scarlet> Sounds not critical for now↔Well, it will probably start to lag if you have like 256 filters↔But who would do this?
17:27:06FromDiscord<aintea> the testers
17:27:37FromDiscord<odexine> a lot of people will do dumb shit
17:27:54FromDiscord<odexine> not necessarily because theyre dumb
20:37:01FromDiscord<Phil> Speak for yourself
20:37:57FromDiscord<Phil> I do my best and still end up doing dumb shit ~~like trying multithreading without a phd~~, that speaks volumes on its own
20:38:02FromDiscord<Elegantbeef> Phil comes in here with "The report of my intelligence was an exaggeration"
20:38:14FromDiscord<Phil> Hottest and freshest of takes at the same time
20:38:21FromDiscord<Phil> Basically still in the oven and baking
20:50:44*rockcavera joined #nim
21:10:12FromDiscord<.bobbbob> sent a long message, see https://pasty.ee/kZpmnuFl
21:10:31FromDiscord<.bobbbob> btw does nim have inheritance for variant types? not that I want to use it haha
21:26:27FromDiscord<System64 ~ Flandre Scarlet> In reply to @.bobbbob "if youre extending some": My synth is modular https://media.discordapp.net/attachments/371759389889003532/1340071684350414879/2025-02-13_14-51-01.mp4?ex=67b10682&is=67afb502&hm=48f053d0ca2413b4a9fddc68e56ca1cc5bc983924ba3b51468389676c6c5ae7e&
21:27:22FromDiscord<fabric.input_output> synthular
21:27:41*ntat quit (Quit: Leaving)
21:39:44FromDiscord<System64 ~ Flandre Scarlet> I hope it will be able to yell a laser harp sound one day
21:46:45*coldfeet joined #nim
21:52:02FromDiscord<threefour> Is there an implementation of what Go calls a `RWMutex` in Nim's stdlib that I'm not seeing?
21:53:05FromDiscord<threefour> (Multiple read, synchronous write mutex)
21:54:04FromDiscord<threefour> (edit) "(Multiple" => "(Concurrent"
22:40:07FromDiscord<nocturn9x> sent a code paste, see https://play.nim-lang.org/#pasty=QLwJCsHD
22:40:13FromDiscord<nocturn9x> I am extremely confused as to what exactly is happening
22:46:49FromDiscord<nocturn9x> ah yep I figured it out
22:47:04FromDiscord<nocturn9x> I was indexing an array by `ply` and it went OOB
22:47:05FromDiscord<nocturn9x> classic
22:51:54*tiorock joined #nim
22:51:54*rockcavera is now known as Guest1396
22:51:54*Guest1396 quit (Killed (osmium.libera.chat (Nickname regained by services)))
22:51:54*tiorock is now known as rockcavera
22:53:10FromDiscord<user2m> sent a code paste, see https://play.nim-lang.org/#pasty=GbtsudNE
22:54:01*tiorock joined #nim
22:54:01*rockcavera is now known as Guest4377
22:54:01*Guest4377 quit (Killed (tantalum.libera.chat (Nickname regained by services)))
22:54:01*tiorock is now known as rockcavera
22:54:13FromDiscord<nocturn9x> you sure the error is happening at the del call and not before
22:54:29FromDiscord<nocturn9x> it seems to me that the thing that's failing is the indexing of `socket_pool` by `session_id`
22:54:41FromDiscord<nocturn9x> probably want to check with `hasKey` first
22:55:40FromDiscord<nocturn9x> have you nailed down exactly which line is failing? If so, how?
22:55:46FromDiscord<nocturn9x> Have you tried getting a stacktrace
22:56:56FromDiscord<nocturn9x> also also, keep in mind that `initTable` creates an object
22:56:58FromDiscord<nocturn9x> it's not a reference
22:57:05FromDiscord<nocturn9x> so you might not be accessing the table you think you are
22:57:23FromDiscord<nocturn9x> if you want a reference instead of something passed by value, consider `newTable`
22:57:47FromDiscord<nocturn9x> (edit) "stacktrace" => "stacktrace?"
22:58:20FromDiscord<nocturn9x> (assuming you just created a reproducible snippet and that the table isn't actually global, if it is then it shouldn't matter, but then I can't see how nim considers that to be `gcsafe`)
23:02:50*coldfeet quit (Quit: Lost terminal)
23:04:20FromDiscord<user2m> sent a code paste, see https://play.nim-lang.org/#pasty=FkkBbztv
23:04:35FromDiscord<nocturn9x> In reply to @user2m "socket_pool is a global": ok so you're casting to gcsafe
23:04:47FromDiscord<nocturn9x> it's a thing I literally just now got rid of in my engine
23:04:47FromDiscord<nocturn9x> because it's kinda bad
23:05:05FromDiscord<nocturn9x> you're telling the compiler your code can be treated as if it were not accessing a global GC'ed memory block
23:05:06FromDiscord<nocturn9x> but it is
23:05:10FromDiscord<nocturn9x> that can lead to problems, as it is now
23:05:30FromDiscord<nocturn9x> can you perhaps refactor it such that it doesn't do that?
23:05:45FromDiscord<nocturn9x> pass the state around in some way, maybe as a heap reference
23:10:47FromDiscord<user2m> In reply to @nocturn9x "can you perhaps refactor": Hmm I'm not really sure how to do this other than using a global to store all the ws. can you point me to some resources?
23:11:03FromDiscord<nocturn9x> well you could have threads communicate via channels
23:11:33FromDiscord<user2m> In reply to @nocturn9x "well you could have": I'm deploying to a single threaded vps - would that still work?
23:12:09FromDiscord<user2m> Also the framework I'm using is prologue which is async
23:12:31FromDiscord<nocturn9x> ah, I see
23:12:37FromDiscord<nocturn9x> then you likely want some equivalent of channels but async
23:12:43FromDiscord<nocturn9x> I've never really dabbled in nim async tbh
23:13:15FromDiscord<nocturn9x> I recently wrote my own crude thread pool implementation to clean up some of my old, inefficient code based on `createThread` and found them very pleasant to use
23:13:22FromDiscord<nocturn9x> simple, does what it says on the tin and not much more
23:13:52FromDiscord<nocturn9x> I would be surprised if the underlying event loop library you're using didn't support some similar primitive
23:14:27FromDiscord<nocturn9x> I do have quite a bit of experience in writing coroutine runners in python and the synchronization primitives are generally the easiest things to write
23:14:31FromDiscord<nocturn9x> locks, queues, channels, events, etc.
23:14:59FromDiscord<nocturn9x> I/O is usually the annoying bit, since you start dealing with the real world :P
23:22:44FromDiscord<Elegantbeef> @user2m `var ConnectionPool` is not a valid generic parameter
23:23:07FromDiscord<Elegantbeef> Like that turns into `ConnectionPool` and you lose any varness