<< 15-09-2024 >>

00:00:22*SchweinDeBurg joined #nim
00:17:16*beholders_eye quit (Ping timeout: 252 seconds)
02:10:06*SchweinDeBurg quit (Quit: WeeChat 4.5.0-dev)
02:10:17*SchweinDeBurg joined #nim
02:15:48*lucasta quit (Quit: Leaving)
06:46:31*ntat joined #nim
07:50:11*coldfeet joined #nim
08:18:08*albe quit (Quit: The Lounge - https://thelounge.chat)
09:19:26*xet7 joined #nim
09:19:43FromDiscord<summarity> I have a proc that is called from C with a pointer to a value. The Nim proc should write to this value. What's the correct way to declare this? `var`? `out`? Something else? The equivalent C function signature would be `void foo(int val);`.
09:33:24FromDiscord<Robyn [She/Her]> In reply to @summarity "I have a proc": `var` if the C function mutates the data, `out` if the C function sets the given variable to a value
09:34:07FromDiscord<Robyn [She/Her]> Difference between `var` and `out` is the latter assumes the data is unset and thus unsafe to read from until it's set in the current scope, the compiler warns you about it iirc
09:35:34FromDiscord<summarity> thx
09:36:37FromDiscord<Robyn [She/Her]> No worries
10:22:37*om3ga_ joined #nim
10:22:55*om3ga quit (Ping timeout: 264 seconds)
11:12:10FromDiscord<andeee23> sent a code paste, see https://play.nim-lang.org/#pasty=jmaYnqbW
11:12:45FromDiscord<andeee23> (edit) "https://play.nim-lang.org/#pasty=zwNHoaai" => "https://play.nim-lang.org/#pasty=MDJfZrsl"
11:26:57*beholders_eye joined #nim
11:38:30FromDiscord<summarity> You can bind an enum with a particular field size using `T {.size: sizeof(cuint).} = enum A, B`
12:37:19*beholders_eye quit (Ping timeout: 260 seconds)
13:12:46*om3ga_ quit (Ping timeout: 252 seconds)
13:15:56*om3ga joined #nim
13:31:53*coldfeet quit (Remote host closed the connection)
13:43:48FromDiscord<demotomohiro> In reply to @andeee23 "how can I interop": enum with size pragma doesn't work? https://nim-lang.org/docs/manual.html#implementation-specific-pragmas-size-pragma
13:46:08FromDiscord<andeee23> In reply to @demotomohiro "enum with size pragma": yeah that did work for the error on the enum, i didn’t explain my issue properly cause i was confused ↵↵the problem is that i can’t define a tagged union object based on this bigger enum
13:47:20FromDiscord<andeee23> but i looked over some sdl2 nim wrappers and seems like there’s no way around it, they just cast the pointers to the right object after doing a regular if check instead of a case of
13:48:42FromDiscord<demotomohiro> When you wrap union types in C, you probably use union pragma, not object variant. https://nim-lang.org/docs/manual.html#foreign-function-interface-union-pragma
13:55:19FromDiscord<andeee23> In reply to @demotomohiro "When you wrap union": huh didn't know about that pragma, will try it out
13:55:26FromDiscord<andeee23> (edit) "huh" => "huh," | "out" => "out, thanks"
14:17:15*beholders_eye joined #nim
14:17:50*attah quit (Remote host closed the connection)
14:19:50*attah joined #nim
15:20:47FromDiscord<summarity> sent a code paste, see https://play.nim-lang.org/#pasty=VkRqPllO
15:24:34FromDiscord<summarity> Hm, I think it's `array[N, ptr ST]`. At least the allocated size matches C
15:24:34*beholders_eye quit (Read error: Connection reset by peer)
15:26:19FromDiscord<odexine> In reply to @summarity "Hm, I think it's": this is correct, to my knowledge
15:30:13*beholders_eye joined #nim
15:50:27Amun-RaI would use union pragma
15:51:32Amun-Rawait, I am even using pragma for that particular event object: https://github.com/amnr/nsdl2/blob/master/src/nsdl2/sdl2inc/sdl2events.nim#L427-L467
15:51:33Amun-Ra;)
16:28:45*lucasta joined #nim
16:32:58*disso-peach joined #nim
16:44:25FromDiscord<cineration> I'm trying to use debby for some database stuff and for whatever reason one of my models throws an error `type mismatch: got 'int' for 'id' but expected 'typedesc[int]'`. There is no discernable difference between the model I'm using and my other models and can't seem to figure this out. Anybody know what could be happening here?
16:45:09FromDiscord<cineration> I can't create records, get or anything because it expects a `typedesc[T]` for everything
16:46:20FromDiscord<cineration> My other models work just fine, it's just 1 specific model I'm using and the definition isn't any different than my other models, except for the naming of the fields
16:51:22FromDiscord<cineration> Ah nvm, I might actually just be a stupid person 😂
16:55:13FromDiscord<enthus1ast.> `-d:nimPreviewFloatRoundtrip` gives 400% speedup in my benchmark o.0 holy moly
16:56:39FromDiscord<enthus1ast.> with this i easily beat the other contenders by 2 2.5 times
16:58:21FromDiscord<enthus1ast.> so if you do alot of float to string, consider this flag!
17:33:29FromDiscord<narimiran> Today is the last day to submit your talks for #nimconf!! You need to fill this form: https://forms.gle/DA17FKxBX8jQ87ES8
18:54:09*lucasta quit (Remote host closed the connection)
19:32:19*ntat quit (Quit: Leaving)
20:45:33*def- quit (Quit: -)
20:46:46*def- joined #nim
20:47:41*Guest60 joined #nim
20:48:24Guest60sup
20:49:47*def- quit (Client Quit)
20:51:39*Guest60 quit (Client Quit)
20:53:53*def- joined #nim
20:56:18*Guest82 joined #nim
20:57:42*Guest82 is now known as ovenpasta
21:02:23ovenpastaHi, I wrote a small UI lib using SDL2 and pixie. While rendering some ui items, I notice memory usage increases a few mb each rendering cycle. Switching from orc to refc solves the problem, I've tested both mingw and linux gcc. What could be the reason? What should I do to understand? Should I keep using refc?
21:04:30FromDiscord<Elegantbeef> You could try `-d:useMalloc` to see if it's Nim's allocator
21:04:57FromDiscord<Elegantbeef> You also could try a more recent Nim to see if there are any bug fixes in devel for your issue
21:13:36ovenpastaI've tried the `-d:useMalloc` without luck, I'll see with devel...
21:47:38*beholders_eye quit (Read error: Connection reset by peer)
21:53:31*beholders_eye joined #nim
22:16:55*lucasta joined #nim
22:27:22*ovenpasta quit (Quit: Client closed)