<< 03-11-2025 >>

01:07:38*Mister_Magister quit (Quit: bye)
01:10:10*Mister_Magister joined #nim
01:45:55*beholders_eye quit (Ping timeout: 264 seconds)
02:29:37*cornfeedhobo quit (Quit: ZNC - https://znc.in)
02:56:09*cornfeedhobo joined #nim
05:55:42*derpydoo joined #nim
05:58:16*cornfeedhobo quit (Quit: Goodbye)
06:02:30*SchweinDeBurg quit (Quit: WeeChat 4.8.0-dev)
06:02:57*SchweinDeBurg joined #nim
06:07:02*cornfeedhobo joined #nim
07:31:33FromDiscord<kiloneie> sent a code paste, see https://play.nim-lang.org/#pasty=urshpsgf
07:47:49FromDiscord<lainlaylie> what type do you expect `param[]` to have where param is a `pointer`?
07:50:01FromDiscord<kiloneie> I am expecting it to be the tuple like in the other example, but something happens when you pass to a proc...
07:50:28FromDiscord<lainlaylie> but the compiler has no reason to think it's a tuple
07:50:40FromDiscord<lainlaylie> you need to do a cast or conversion
08:07:22FromDiscord<kiloneie> I have not touched casting ever... https://media.discordapp.net/attachments/371759389889003532/1434816211622825995/Screenshot_2025-11-03_09-06-38.png?ex=6909b43a&is=690862ba&hm=913b326a60ebc1773fd44629076ac5f471b96e2386c36ddc0993c894a69adc8a&
08:11:35FromDiscord<nuitjour_82503> Guys, how to speed up / cancel the lookup for BLAS and LAPACK libraries when using Datamancer ? I don't use them so I won't install them.
08:15:55FromDiscord<vindaar> sent a long message, see https://pasty.ee/RqmKToou
08:21:05FromDiscord<kiloneie> In reply to @lainlaylie "you need to do": I can't find documentation on this, do you maybe know where to find ?
08:27:26FromDiscord<nnsee> In reply to @kiloneie "I don't get it...": why are you passing a raw `pointer`?
08:28:41FromDiscord<kiloneie> In reply to @nnsee "why are you passing": Because i haven't used them passed ref objects, so i don't know this.
08:31:08FromDiscord<kiloneie> And i just, simply used what was in the SDL2 example for those timers.
08:34:53FromDiscord<nnsee> you're trying to dereference a raw pointer using `[]` but the compiler has no idea what type is behind that pointer
08:35:33FromDiscord<nnsee> since the type is simply `pointer`
08:39:26FromDiscord<kiloneie> How would i, not "out of memory", and what is the best way, safest, to do this ?... https://media.discordapp.net/attachments/371759389889003532/1434824278590623764/Screenshot_2025-11-03_09-38-55.png?ex=6909bbbd&is=69086a3d&hm=195f2f9749e854ae95a48997ed59b1e0674d707d22d0d5a57f22879547cc3fb3&
08:47:36FromDiscord<lainlaylie> i think your cast is wrong, you should cast to a ptr tuple, not the tuple itself
08:49:06FromDiscord<nnsee> can't you just accept a `ptr tuple` in the proc signature instead of just a `pointer`?
08:49:34FromDiscord<nnsee> (edit) "tuple`" => "tuple[...]`"
08:49:56FromDiscord<lainlaylie> i am assuming the proc signature is from some C library that supports passing in some "user data"
08:50:46FromDiscord<lainlaylie> In reply to @kiloneie "I can't find documentation": On casting and conversion?↵https://nim-lang.org/docs/manual.html#statements-and-expressions-type-conversions↵https://nim-lang.org/docs/manual.html#statements-and-expressions-type-casts
08:51:30*beholders_eye joined #nim
08:51:30FromDiscord<kiloneie> It's from SDL2, so i don't know yet.
08:57:16FromDiscord<kiloneie> Idk if i am doing something wrong or not. I have no idea how to type convert this, that documentation is... i need to use a proc ? https://media.discordapp.net/attachments/371759389889003532/1434828763987836958/Screenshot_2025-11-03_09-55-50.png?ex=6909bfeb&is=69086e6b&hm=788b607811518019eb1e029e1a53c030e137f0dda8f6f71477018140d71a8ec4&
08:59:21FromDiscord<kiloneie> In reply to @lainlaylie "i am assuming the": I don't know if those are allowed to be changed, but it's from sdl2.
09:00:16FromDiscord<lainlaylie> In reply to @kiloneie "Idk if i am": seems fine
09:00:25FromDiscord<lainlaylie> those inlay hints are pretty noisy
09:03:49*beholders_eye quit (Ping timeout: 246 seconds)
09:04:36FromDiscord<kiloneie> In reply to @lainlaylie "those inlay hints are": Yeh, i try to just be explicit to silence them.↵↵Well, i guess i will have to figure out how to not out of memory...
09:07:07FromDiscord<ieltan> are you doing ffi ? you're basically writing c in nim no wonder you have issues
09:08:39FromDiscord<ieltan> In reply to @kiloneie "Idk if i am": 1. there are two reasons for a SIGSEGV, the type cast is wrong or you have a null or dangling pointer
09:10:20FromDiscord<amun0666> The most probable is type sent - type received mismatch.
09:10:28FromDiscord<ieltan> 2. for OOM i dont know, you're copying timer2Data on the stack so intuitively if it's a huge tuple it should be a stack overflow instead so i actually have no clue what's happening
09:11:04FromDiscord<amun0666> Stack overflow would rather trigger another sigsegv.
09:12:29FromDiscord<kiloneie> Well the layer: Layer -> Layer: seq[Entity] https://media.discordapp.net/attachments/371759389889003532/1434832594104746174/Screenshot_2025-11-03_10-11-56.png?ex=6909c37c&is=690871fc&hm=a2ee3bb225f347dfec6c82829e699ee95340d0ef8faa89e63e235927f7febdc0& https://media.discordapp.net/attachments/371759389889003532/1434832594561663017/Screenshot_2025-11-03_10-12-10.png?ex=6909c37c&is=690871fc&hm=f6ff52b7bab3f7db82a4e98ca4e3c178af02d2aa000bd43
09:12:48FromDiscord<ieltan> In reply to @amun0666 "Stack overflow would rather": Yeah, but he's getting an oom instead??
09:15:02FromDiscord<lainlaylie> is timer2Data actually still alive when the timer fires?
09:15:50FromDiscord<amun0666> I would pass as (void ) userdata only types lifetime I control myself
09:17:03FromDiscord<kiloneie> In reply to @lainlaylie "is timer2Data actually still": It's supposed to be, timer2 is supposed to trigger the destroyEvent, but i am not 100% sure
09:17:49FromDiscord<kiloneie> Though, shouldn't the derefed version, NOT have this problem then ?
09:18:32FromDiscord<amun0666> There will be oops If the timer outlives the data behind the pointer.
09:18:32FromDiscord<lainlaylie> timer2Data is on the stack, it's gone once the function returns and then your userdata is pointing to something random
09:18:35*derpydoo quit (Quit: derpydoo)
09:19:16FromDiscord<amun0666> Ah, right. Here: https://media.discordapp.net/attachments/371759389889003532/1434834303858249738/image.png?ex=6909c513&is=69087393&hm=8ac68e4e1c0ba6b2b91af2f98d551800e46c29ba73f9afa9e24281aaf81e5850&
09:19:58FromDiscord<kiloneie> This version too ? https://media.discordapp.net/attachments/371759389889003532/1434834475719594014/Screenshot_2025-11-03_10-18-36.png?ex=6909c53c&is=690873bc&hm=4a092bd5a3d658346c0e52cac951273424c4e39e02b67dcddb5b8415b3f54e23&
09:20:07FromDiscord<amun0666> Yes.
09:20:51FromDiscord<amun0666> If that proc ends `timer2Data` is no longer valid.
09:21:42FromDiscord<kiloneie> So what should i do ? I have never had to deal with this, and i guess this is the time when i will have to start.
09:22:28FromDiscord<amun0666> Either store that data somewhere with more permanent lifetime or, C-like, `alloc` memory for the data, store it, then `free` in the timer.
09:24:35FromDiscord<ieltan> or use a more idiomatic sdl wrapper for nim
09:25:15FromDiscord<kiloneie> In reply to @ieltan "or use a more": I will migrate to SDL 3 very soon, cannot change yet.
09:25:34FromDiscord<ieltan> 😭
09:27:26FromDiscord<amun0666> Ugly, but it'll work: https://play.nim-lang.org/#pasty=QGEwrABe
09:28:59FromDiscord<amun0666> `alloc_test` shows you how to prepare data for the timer, `free_test` how to use/free it.
09:30:11FromDiscord<amun0666> But if you exit the program before timer triggers, you'll end up with unfreed memory.
09:30:37FromDiscord<amun0666> Same if you cancel the trigger.
09:30:44FromDiscord<amun0666> Timer
09:31:05FromDiscord<lainlaylie> sent a code paste, see https://play.nim-lang.org/#pasty=oDTxSGod
09:34:41FromDiscord<kiloneie> sent a long message, see https://pasty.ee/teAbQpqD
09:34:50*beholders_eye joined #nim
09:35:09FromDiscord<lainlaylie> ugly
09:35:33FromDiscord<kiloneie> In reply to @lainlaylie "ugly": Whats ugly ?
09:35:48FromDiscord<lainlaylie> alloc with manual sizeof then manual copymem
09:37:05FromDiscord<nuitjour_82503> In reply to @vindaar "I don't remember if": thanks, it just takes away a few seconds of compilation time each time
09:37:54FromDiscord<vindaar> In reply to @nuitjour_82503 "thanks, it just takes": I don't think the reason for slower compilation is the actual BLAS / LAPACK search. That's fast. You probably think that, because you see that being printed and it takes a while for other stuff to start being printed.
09:39:50FromDiscord<vindaar> note that some libraries like datamancer, arraymancer and a bunch of others of mine are indeed quite slow to compile unfortunately. Mostly due to quite heavy usage of macros. The unfortunate reality though is that profiling the compilation is not that straightforward (it's possible, but in the end not that helpful to really understand what particular things are the bottlenecks). I have big hopes for incremental compilation, at the latest
09:59:50FromDiscord<nuitjour_82503> sent a code paste, see https://play.nim-lang.org/#pasty=ydSJZVAs
10:11:29FromDiscord<nuitjour_82503> The speed of display might be a factor, but the rest displays quite fast
10:14:50FromDiscord<vindaar> yeah, those are expected and unrelated to the actual library search
10:15:52FromDiscord<nnsee> yes, the dots are just your program being compiled
10:16:05FromDiscord<nnsee> you would also have those even without any blas hints
10:23:25*beholders_eye quit (Ping timeout: 264 seconds)
10:35:02*beholders_eye joined #nim
10:45:27FromDiscord<nuitjour_82503> Thanks for the clarification
11:52:26FromDiscord<amun0666> Add --verbosity=0 to hide them.
11:55:31*beholders_eye quit (Ping timeout: 264 seconds)
11:57:15*beholders_eye joined #nim
13:17:52FromDiscord<xuanxueshileo> sent a code paste, see https://play.nim-lang.org/#pasty=kxZQUhcT
13:19:13FromDiscord<lainlaylie> why wouldnt it?
13:21:56FromDiscord<xuanxueshileo> I think func won't modify outer memory space as a pure funciton.
13:23:18FromDiscord<nnsee> In reply to @xuanxueshileo "I think func won't": https://nim-lang.org/docs/manual.html#effect-system-side-effects
13:23:29FromDiscord<xuanxueshileo> thanks
14:38:29*hygo quit (Quit: WeeChat 4.7.1)
16:33:07*vsantana joined #nim
20:05:49*syl quit (Quit: C-x C-c)
20:47:29*syl joined #nim
21:01:16*syl quit (Quit: C-x C-c)
21:03:57*hygo joined #nim
21:07:25*syl joined #nim
21:34:21*rockcavera joined #nim
21:57:03*lx12ucy joined #nim