<< 18-10-2026 >>

00:44:02*hazardchem quit (Read error: Connection reset by peer)
00:44:11*hazardchem joined #nim
00:54:01FromDiscord<kt.sarkic> In reply to @Amun-Ra "nim doc generates html": why are you an app
01:04:51FromDiscord<dykatz> Probably because of the IRC bridge
01:41:05*sdothum quit (Ping timeout: 246 seconds)
01:44:58*sdothum joined #nim
02:07:54FromDiscord<egbert_37195> In reply to @b0rsuk "When is the DLC": Lol, no DLC, gonna jump straight to a major version update and learn how to do procedural terrain
02:46:12FromDiscord<Abdulrahman> In reply to @muddmaker "Probably because of the": Irc in 2026
03:31:33*cornfeedhobo quit (Ping timeout: 255 seconds)
04:10:39*cornfeedhobo joined #nim
04:43:37*longptr joined #nim
04:46:26longptrHey all, question on how Nim handles arguments to a function marked 'var' -- can someone shed light on when/how or if you can hint at the compiler to use pointers "behind the scenes" for managing data passed into a function that you expect to be modified? The C way of course is to pass a pointer manually, deference it in code, etc. For dealing with large entities (big arrays, structs, etc) Ideally the nim compiler would use a pass-by-reference approach behind
04:46:27longptrthe scenes.
05:05:31FromDiscord<zkopt_> In reply to @longptr "Hey all, question on": nim's function variable is similar to C's function pointer
05:05:38FromDiscord<zkopt_> it's just address of function start point
05:54:07longptrzkopt_: I meant like this : proc divmod(a, b: int; res, remainder: var int) = ; remainder is declared as variable that can be modified in the procedure's body. The only way to do that is A) Pass the value to the procedure via stack, modify it and on return, the data is copied back into the variable (behind the scenes by the compiler B) In C-style programming passing a pointer to remainder (pass by reference). I was asking with Nim, if you're working with large
05:54:08longptrdata structures and you want the procedure to modify the data, is the compiler 'smart' enough to pass by reference? Can you control this behavior or influence it?
06:00:19FromDiscord<Laylie> I'm under the impression that a var parameter is always a pointer
06:01:27FromDiscord<Laylie> https://nim-lang.org/docs/manual.html#procedures-var-parameters
06:02:25FromDiscord<Laylie> > Var parameters are implemented as hidden pointers. The above example is equivalent to\: ... ptr int
06:06:11longptrDamn, shouldn't have missed that in the documentation, thank you :)
06:11:42FromDiscord<zkopt_> sent a long message, see https://paste.rs/SW55P
07:34:40*sixfourtwelve joined #nim
08:06:28FromDiscord<b0rsuk> In reply to @egbert_37195 "Lol, no DLC, gonna": I think you're rewriting a game from C++ to Nim as an exercise? You seem to already have some programming experience. There's lots of commented out code in one of your files. I thought you were gradually converting it.
08:45:38*sixfourtwelve quit (Read error: Connection reset by peer)
08:45:54*sixfourtwelve joined #nim
09:42:18*xtr00 joined #nim
10:26:04*insanescholar_ joined #nim
11:59:31FromDiscord<zkopt_> my library was too big that AI agent's context is nearly full
12:38:13*xtr00 quit (Read error: Connection reset by peer)
12:38:19*xtr00_ joined #nim
12:39:01FromDiscord<tempestro> sent a code paste, see https://paste.rs/3W1Wa
13:10:37FromDiscord<Abdulrahman> sent a code paste, see https://paste.rs/V3Fl3
13:11:10FromDiscord<tempestro> discriminated unions
13:11:29FromDiscord<tempestro> You switch on `t`
13:11:47FromDiscord<Abdulrahman> Do you set 1 attribute and the others are set using the ofs according to what user passes?
13:12:36FromDiscord<tempestro> I haven't actually compiled a constructor for one of these yet, I'm just complaining the member types have to be unique
13:13:41FromDiscord<tempestro> You can have Nim do this "automatically" for you using inheritance and methods, but then that moves the boilerplate elsewhere (and doubles it)
13:19:20FromDiscord<toitle3554> sent a code paste, see https://paste.rs/AtJ1i
13:20:36FromDiscord<tempestro> oh, turns out a solution got merged just two weeks ago↵https://github.com/nim-lang/Nim/pull/26364
13:20:37FromDiscord<tempestro> https://github.com/nim-lang/Nim/pull/26364
13:20:40FromDiscord<tempestro> lol
13:20:44FromDiscord<toitle3554> I think nimony will resolve this (maybe? someone correct me if wrong) since it'll enforce accessing discriminated fields in a case statement, similar to how rust handles its enums. Recently checked if it's possible to give multiple fields the same name in nimony and it doesn't seem like it's allowed yet
13:21:00FromDiscord<toitle3554> In reply to @tempestro "oh, turns out a": oh nice! didn't know about this
13:22:36*acidsys joined #nim
13:26:22FromDiscord<crulran> Is there a easy way to make buttons in nim with raylib?
13:28:04FromDiscord<toitle3554> In reply to @crulran "Is there a easy": there's raygui, which is maintained by raylib's author and is compatible with raylib. I don't know if any nim bindings exist for it though
13:30:25FromDiscord<tempestro> In reply to @tempestro "oh, turns out a": never mind, turns out names still have to be unique goddammit
13:42:02*sdothum quit (*.net *.split)
13:42:02*Mister_Magister quit (*.net *.split)
13:42:03*cm quit (*.net *.split)
13:42:03*tk quit (*.net *.split)
13:42:04*GnuYawk12970 quit (*.net *.split)
13:42:04*deavmi quit (*.net *.split)
13:45:47FromDiscord<Abdulrahman> sent a long message, see https://paste.rs/Vgawr
13:46:38FromDiscord<Abdulrahman> This is how i did it in my sdl3 based library called nimgfx
13:48:53*sdothum joined #nim
13:48:54*Mister_Magister joined #nim
13:48:54*cm joined #nim
13:48:54*tk joined #nim
13:48:54*GnuYawk12970 joined #nim
13:48:54*deavmi joined #nim
14:01:44FromDiscord<_timurski> In reply to @longptr "data structures and you": compiler passes even non-var by reference if it's more than 3x bigger than a float
14:12:13*acidsys quit (Ping timeout: 242 seconds)
14:24:27*insanescholar_ quit (Ping timeout: 241 seconds)
14:36:20*insanescholar_ joined #nim
14:47:01*sdothum quit (Ping timeout: 243 seconds)
15:01:16FromDiscord<crulran> In reply to @abdulrahman.103 "Make drawButton which takes": What about actions for like pulling like in a 2d golf game?
15:02:32*sdothum joined #nim
15:23:30*insanescholar_ quit (Ping timeout: 269 seconds)
15:34:59*xtr00_ quit (Read error: Connection reset by peer)
15:42:23FromDiscord<Abdulrahman> In reply to @crulran "What about actions for": well you got the pressed event and the down indicator if its continuous use down if its 1 time use the pressed event
15:42:41FromDiscord<Abdulrahman> idk how your pulling works
15:43:21FromDiscord<Abdulrahman> in my tetris clone i used both at the same time to do some functionality
15:44:02FromDiscord<Abdulrahman> its IsKeyPressed and IsKeyDown for buttons in raylib
15:44:21FromDiscord<Abdulrahman> you can abstract over those
15:44:31FromDiscord<Abdulrahman> idk if mouse click is a key in raylib or not
16:07:14*emery quit (Quit: https://quassel-irc.org - Chat comfortably. Anywhere.)
16:46:47*xutaxkamay quit (Read error: Connection reset by peer)
16:47:16*emery joined #nim
17:01:52*xutaxkamay joined #nim
17:18:32*xutaxkamay_ joined #nim
17:19:32*xutaxkamay quit (Ping timeout: 259 seconds)
17:19:33*xutaxkamay_ is now known as xutaxkamay
17:20:08*joast quit (Quit: Leaving.)
17:39:19*xtr00 joined #nim
17:54:29*joast joined #nim
18:28:05*KawaiiSelbst quit (Remote host closed the connection)
18:28:39*KawaiiSelbst joined #nim
19:06:53*KawaiiSelbst quit (Remote host closed the connection)
19:07:39*KawaiiSelbst joined #nim
19:16:05*KawaiiSelbst quit (Remote host closed the connection)
19:16:22*KawaiiSelbst joined #nim
19:20:50*KawaiiSelbst quit (Remote host closed the connection)
19:21:36*KawaiiSelbst joined #nim
20:12:33*xutaxkamay quit (Ping timeout: 253 seconds)
20:20:01*xutaxkamay joined #nim
20:24:49*KawaiiSelbst quit (Remote host closed the connection)
20:26:04*KawaiiSelbst joined #nim
20:51:45*xet7 quit (Quit: Leaving)
20:58:18*insanescholar_ joined #nim