| 00:44:02 | * | hazardchem quit (Read error: Connection reset by peer) |
| 00:44:11 | * | hazardchem joined #nim |
| 00:54:01 | FromDiscord | <kt.sarkic> In reply to @Amun-Ra "nim doc generates html": why are you an app |
| 01:04:51 | FromDiscord | <dykatz> Probably because of the IRC bridge |
| 01:41:05 | * | sdothum quit (Ping timeout: 246 seconds) |
| 01:44:58 | * | sdothum joined #nim |
| 02:07:54 | FromDiscord | <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:12 | FromDiscord | <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:26 | longptr | Hey 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:27 | longptr | the scenes. |
| 05:05:31 | FromDiscord | <zkopt_> In reply to @longptr "Hey all, question on": nim's function variable is similar to C's function pointer |
| 05:05:38 | FromDiscord | <zkopt_> it's just address of function start point |
| 05:54:07 | longptr | zkopt_: 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:08 | longptr | data 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:19 | FromDiscord | <Laylie> I'm under the impression that a var parameter is always a pointer |
| 06:01:27 | FromDiscord | <Laylie> https://nim-lang.org/docs/manual.html#procedures-var-parameters |
| 06:02:25 | FromDiscord | <Laylie> > Var parameters are implemented as hidden pointers. The above example is equivalent to\: ... ptr int |
| 06:06:11 | longptr | Damn, shouldn't have missed that in the documentation, thank you :) |
| 06:11:42 | FromDiscord | <zkopt_> sent a long message, see https://paste.rs/SW55P |