00:23:49 | * | jjido quit (Quit: My laptop has gone to sleep. ZZZzzz…) |
01:26:05 | FromDiscord | <random_user1999> hello nimsters |
01:27:15 | FromDiscord | <thearthurm> In reply to @random_user1999 "hello nimsters": Sup sir |
01:27:22 | FromDiscord | <random_user1999> hello |
01:27:24 | FromDiscord | <thearthurm> I saw someone say nim has compiler bugs |
01:27:35 | FromDiscord | <thearthurm> What's up with that, I haven't noticed anything |
01:27:36 | FromDiscord | <random_user1999> ofc like every other language |
01:28:03 | FromDiscord | <thearthurm> Fair |
01:30:00 | FromDiscord | <random_user1999> In reply to @thearthurm "Fair": even rust has compiler bugs |
01:30:17 | FromDiscord | <random_user1999> gcc clang msvc |
01:30:32 | FromDiscord | <random_user1999> compilers are a huge project that is bound to have many problems |
02:54:08 | * | thunder joined #nim |
03:28:54 | * | thunder quit (Quit: Leaving) |
03:56:21 | * | skippy8 joined #nim |
05:56:16 | * | xet7 quit (Remote host closed the connection) |
06:56:53 | * | SchweinDeBurg quit (Ping timeout: 248 seconds) |
07:16:43 | * | SchweinDeBurg joined #nim |
07:54:29 | * | jjido joined #nim |
08:20:04 | * | Jjp137 quit (Ping timeout: 260 seconds) |
08:20:24 | * | Jjp137 joined #nim |
08:52:31 | FromDiscord | <aintea> In reply to @thearthurm "What's up with that,": It does but you have to go deep within the complex stuff |
08:52:37 | FromDiscord | <aintea> Like really deep |
08:53:21 | FromDiscord | <aintea> For example playing with object variants, uninitialized variables and orc will sometimes give you a specific error but it's wrong, it shouldn't be that error that is printed |
08:53:36 | FromDiscord | <aintea> But all errors we see get reported and fixed so no need to panic |
10:39:28 | * | beholders_eye joined #nim |
10:43:32 | * | tokyovigilante quit (Remote host closed the connection) |
11:22:17 | * | nils` quit (Ping timeout: 268 seconds) |
11:30:16 | FromDiscord | <_cyberdot> Hey everyone! 🙂 New to this amazing language |
11:30:24 | * | tokyovigilante joined #nim |
11:32:43 | FromDiscord | <_cyberdot> I have a question that has been bothering me for the last week. Why is this not possible? I have been trying to access object properties by reference without any success. Is it possible at all? If I recall correctly, C structs allow that kind of access. https://media.discordapp.net/attachments/371759389889003532/1388844629541130383/image.png?ex=686275db&is=6861245b&hm=37e811683378ea5312702e0384d0ff58ce4fe28d3c1b3bcd1a398ec94a219fa1& |
11:49:54 | FromDiscord | <lainlaylie> whether something is a ref or not is decided when it's created, you can't turn a non ref into a ref |
11:57:11 | FromDiscord | <_cyberdot> So there is no way to reference a value if that value is not a reference itself upon creation? |
12:00:34 | FromDiscord | <lainlaylie> there are ways depending on what you want to achieve |
12:01:03 | * | nils` joined #nim |
12:01:23 | FromDiscord | <lainlaylie> in the worst case you can resort to a pointer |
12:18:23 | FromDiscord | <_cyberdot> I see. Let's hope in future versions reference manipulation becomes more flexible. |
12:18:28 | FromDiscord | <_cyberdot> Thanks for your help |
12:25:12 | * | jjido quit (Quit: My laptop has gone to sleep. ZZZzzz…) |
12:30:11 | FromDiscord | <demotomohiro> There is experimental view types: https://nim-lang.github.io/Nim/manual_experimental.html#view-types |
13:01:15 | * | jjido joined #nim |
13:26:02 | FromDiscord | <_cyberdot> Views look interesting but feels like a workaround for the problem I am having |
13:26:26 | FromDiscord | <_cyberdot> (edit) "feels" => "feel" |
13:36:58 | * | Artea quit (Quit: ZNC 1.9.1 - https://znc.in) |
13:48:41 | FromDiscord | <Laylie> if you tell us what the problem is someone might be able to suggest a solution |
14:03:36 | * | jjido quit (Quit: My laptop has gone to sleep. ZZZzzz…) |
14:09:34 | FromDiscord | <_cyberdot> sent a long message, see https://pasty.ee/ingsFQxW |
14:10:25 | FromDiscord | <_cyberdot> But since the Vector2 itself is not a ref on raylib, I am finding the issue I screenshoted |
14:10:48 | FromDiscord | <_cyberdot> Maybe I am just overthinking something that does not require as much attention |
14:10:56 | FromDiscord | <_cyberdot> And just stick with the code duplication |
14:11:11 | FromDiscord | <_cyberdot> (edit) "as" => "that" |
14:18:04 | FromDiscord | <_cyberdot> I am using the naylib implementation of raylib if that changes anything |
14:43:24 | FromDiscord | <_cyberdot> This example is much closer to what I want to achieve https://media.discordapp.net/attachments/371759389889003532/1388892613200973824/image.png?ex=6862a28b&is=6861510b&hm=d5afb9443f5a002c68f67b2477269d04f6b589aeb5714a16d3d67ab42396b208& |
14:53:57 | FromDiscord | <_cyberdot> https://media.discordapp.net/attachments/371759389889003532/1388895271533936811/image.png?ex=6862a505&is=68615385&hm=e6ee1e37af0abd59e60df59cdcd4105377a9d2bfe87bccd051c0680020ad99ff& |
14:55:28 | FromDiscord | <lainlaylie> i dont understand your code example. could you use var parameters or if-expressions here? |
15:01:49 | * | disso-peach joined #nim |
15:15:07 | FromDiscord | <griffith1deadly> In reply to @_cyberdot "": are you coming from C#? |
15:16:13 | FromDiscord | <_cyberdot> In reply to @lainlaylie "i dont understand your": Forget the coordinate param btw haha that should not be there |
15:17:49 | FromDiscord | <_cyberdot> In reply to @griffith1deadly "are you coming from": I work mainly with Python since I am a data engineer, I am trying to emulate the way C is able to reference everything by creating pointers over non-pointer values. Since that is not an explicit mechanic in Nim, I guess my code has come out a bit like C# |
15:18:54 | FromDiscord | <_cyberdot> (edit) "engineer," => "engineer. Here," |
15:20:00 | FromDiscord | <_cyberdot> The idea here is that position can become a pointer to either vector.X or vector.Y, depending on what I want to change on vector. |
15:20:42 | FromDiscord | <griffith1deadly> sent a code paste, see https://play.nim-lang.org/#pasty=CbDGviCA |
15:21:19 | FromDiscord | <_cyberdot> Yeah, I was trying to avoid the ptr way |
15:22:01 | FromDiscord | <_cyberdot> So essentially you're saying that the vector.x or vector.y should already be a ref, as someone stated already above |
15:22:41 | FromDiscord | <griffith1deadly> you can't get `safe reference aka ref` of `object` without copy directly |
15:23:32 | FromDiscord | <_cyberdot> So, in the case of what I want to do, it is not possible to access an existing property of an object without copying that property altogether |
15:23:38 | FromDiscord | <griffith1deadly> In reply to @_cyberdot "So essentially you're saying": it's should not be a ref, i think you need learn where use safe reference and stack memory in nim |
15:25:06 | FromDiscord | <_cyberdot> Ok, I'll do a reading on that section |
15:25:29 | FromDiscord | <_cyberdot> I guess I am coming with some assumptions of how pointers and references should work on Nim |
15:27:14 | FromDiscord | <_cyberdot> Thanks for the help and patience, @griffith1deadly @lainlaylie. |
15:32:38 | FromDiscord | <griffith1deadly> sent a code paste, see https://play.nim-lang.org/#pasty=iMcYQMNV |
15:32:54 | FromDiscord | <griffith1deadly> (edit) "https://play.nim-lang.org/#pasty=VOXhbwGU" => "https://play.nim-lang.org/#pasty=GnqMkqLH" |
15:32:58 | * | nils` quit (Ping timeout: 272 seconds) |
15:36:53 | FromDiscord | <_cyberdot> In reply to @griffith1deadly "safe references are mostly": I see. On this example you're basically copying the coordinate into position as a new value and then writing over the original coordinate, instead of referencing the value to avoid said copies. |
15:37:56 | FromDiscord | <_cyberdot> I was definitely overcomplicating it |
15:50:06 | FromDiscord | <_cyberdot> I will play a bit with {.byaddr.} to see if it replicates the behaviour I am trying. |
15:50:53 | FromDiscord | <_cyberdot> Thanks a lot! |
16:03:55 | * | jjido joined #nim |
16:05:41 | * | xet7 joined #nim |
16:11:34 | * | nils` joined #nim |
16:32:05 | FromDiscord | <_nenc> byaddr is based on template...? is it really the same as what it's name says |
16:32:13 | FromDiscord | <_nenc> (edit) "says" => "says?" |
16:33:54 | FromDiscord | <_nenc> isn't it some kind of source code level alias↵(it's cool though, and i think it's behavior is similar to "byaddr") |
16:34:02 | FromDiscord | <_nenc> (edit) "isn't it some kind of source code level alias↵(it's cool though, and i think it's behavior is similar to ... "byaddr")" added "literally" |
16:49:38 | * | xet7 quit (Remote host closed the connection) |
16:51:01 | * | xet7 joined #nim |
16:53:16 | FromDiscord | <_cyberdot> sent a code paste, see https://play.nim-lang.org/#pasty=giIQWdvA |
16:54:02 | FromDiscord | <_cyberdot> (edit) "https://play.nim-lang.org/#pasty=fgkBregP" => "https://play.nim-lang.org/#pasty=HtKyNfjP" |
16:54:41 | FromDiscord | <_cyberdot> I guess case is returning the result of vector.x and not vector.x itself |
16:55:37 | FromDiscord | <_cyberdot> So far seems to be the most pointer-like feature in Nim |
16:55:53 | FromDiscord | <_cyberdot> Except for the explicit ptr |
16:56:36 | FromDiscord | <_cyberdot> (edit) "itself" => "itself, for example" |
17:09:24 | * | skippy8 quit (Quit: WeeChat 4.6.3) |
17:10:47 | * | skippy8 joined #nim |
17:11:28 | * | skippy8 quit (Client Quit) |
17:27:14 | * | beholders_eye quit (Ping timeout: 260 seconds) |
17:28:41 | * | beholders_eye joined #nim |
17:37:01 | * | skippy8 joined #nim |
17:41:32 | FromDiscord | <_cyberdot> sent a code paste, see https://play.nim-lang.org/#pasty=meglAAmT |
17:41:40 | FromDiscord | <_cyberdot> This is not beautiful but works |
17:42:14 | FromDiscord | <_cyberdot> Saves with not having to de-reference using [] operator every time you access it |
17:42:43 | FromDiscord | <_cyberdot> (edit) "it" => "the variable" |
17:43:57 | FromDiscord | <_cyberdot> (edit) "variable" => "variable. Makes it somewhat safer to use ptr" |
17:44:49 | * | skippy8 quit (Quit: WeeChat 4.6.3) |
18:10:01 | FromDiscord | <_cyberdot> So I stand corrected when I said pointers in Nim were not flexible enough haha |
18:10:44 | * | Goodbye_Vincent1 quit (Remote host closed the connection) |
18:11:37 | * | Goodbye_Vincent1 joined #nim |
18:15:17 | FromDiscord | <Robyn [She/Her]> In reply to @griffith1deadly "you can use ": `new(float)` |
18:15:59 | FromDiscord | <Robyn [She/Her]> In reply to @griffith1deadly "you can use ": ah nvm yeah idk how to do that if those aren't alr references |
18:20:24 | * | xutaxkamay quit (Ping timeout: 252 seconds) |
18:25:10 | * | xutaxkamay joined #nim |
18:26:40 | * | jjido quit (Quit: My laptop has gone to sleep. ZZZzzz…) |
18:28:53 | FromDiscord | <Elegantbeef> sent a code paste, see https://play.nim-lang.org/#pasty=LgLCfYIa |
18:30:49 | * | jjido joined #nim |
19:08:18 | * | beholders_eye quit (Ping timeout: 272 seconds) |
19:28:09 | * | tokyovigilante quit (Remote host closed the connection) |
19:30:06 | * | m5zs7k quit (Ping timeout: 276 seconds) |
19:35:37 | * | pmp-p quit (Ping timeout: 268 seconds) |
19:36:45 | * | m5zs7k joined #nim |
19:55:51 | * | pmp-p joined #nim |
20:09:14 | * | tokyovigilante joined #nim |
20:11:47 | * | beholders_eye joined #nim |
20:18:57 | * | jjido quit (Quit: My laptop has gone to sleep. ZZZzzz…) |
20:36:20 | * | xet7 quit (Remote host closed the connection) |
20:37:04 | * | beholders_eye quit (Quit: WeeChat 4.6.3) |
20:42:30 | * | beholders_eye joined #nim |
21:11:12 | * | jjido joined #nim |
21:17:24 | * | beholders_eye quit (Ping timeout: 252 seconds) |
22:17:30 | FromDiscord | <_cyberdot> I really like this solution |
23:03:59 | * | jjido quit (Quit: My laptop has gone to sleep. ZZZzzz…) |