<< 29-06-2025 >>

00:23:49*jjido quit (Quit: My laptop has gone to sleep. ZZZzzz…)
01:26:05FromDiscord<random_user1999> hello nimsters
01:27:15FromDiscord<thearthurm> In reply to @random_user1999 "hello nimsters": Sup sir
01:27:22FromDiscord<random_user1999> hello
01:27:24FromDiscord<thearthurm> I saw someone say nim has compiler bugs
01:27:35FromDiscord<thearthurm> What's up with that, I haven't noticed anything
01:27:36FromDiscord<random_user1999> ofc like every other language
01:28:03FromDiscord<thearthurm> Fair
01:30:00FromDiscord<random_user1999> In reply to @thearthurm "Fair": even rust has compiler bugs
01:30:17FromDiscord<random_user1999> gcc clang msvc
01:30:32FromDiscord<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:31FromDiscord<aintea> In reply to @thearthurm "What's up with that,": It does but you have to go deep within the complex stuff
08:52:37FromDiscord<aintea> Like really deep
08:53:21FromDiscord<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:36FromDiscord<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:16FromDiscord<_cyberdot> Hey everyone! 🙂 New to this amazing language
11:30:24*tokyovigilante joined #nim
11:32:43FromDiscord<_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:54FromDiscord<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:11FromDiscord<_cyberdot> So there is no way to reference a value if that value is not a reference itself upon creation?
12:00:34FromDiscord<lainlaylie> there are ways depending on what you want to achieve
12:01:03*nils` joined #nim
12:01:23FromDiscord<lainlaylie> in the worst case you can resort to a pointer
12:18:23FromDiscord<_cyberdot> I see. Let's hope in future versions reference manipulation becomes more flexible.
12:18:28FromDiscord<_cyberdot> Thanks for your help
12:25:12*jjido quit (Quit: My laptop has gone to sleep. ZZZzzz…)
12:30:11FromDiscord<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:02FromDiscord<_cyberdot> Views look interesting but feels like a workaround for the problem I am having
13:26:26FromDiscord<_cyberdot> (edit) "feels" => "feel"
13:36:58*Artea quit (Quit: ZNC 1.9.1 - https://znc.in)
13:48:41FromDiscord<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:34FromDiscord<_cyberdot> sent a long message, see https://pasty.ee/ingsFQxW
14:10:25FromDiscord<_cyberdot> But since the Vector2 itself is not a ref on raylib, I am finding the issue I screenshoted
14:10:48FromDiscord<_cyberdot> Maybe I am just overthinking something that does not require as much attention
14:10:56FromDiscord<_cyberdot> And just stick with the code duplication
14:11:11FromDiscord<_cyberdot> (edit) "as" => "that"
14:18:04FromDiscord<_cyberdot> I am using the naylib implementation of raylib if that changes anything
14:43:24FromDiscord<_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:57FromDiscord<_cyberdot> https://media.discordapp.net/attachments/371759389889003532/1388895271533936811/image.png?ex=6862a505&is=68615385&hm=e6ee1e37af0abd59e60df59cdcd4105377a9d2bfe87bccd051c0680020ad99ff&
14:55:28FromDiscord<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:07FromDiscord<griffith1deadly> In reply to @_cyberdot "": are you coming from C#?
15:16:13FromDiscord<_cyberdot> In reply to @lainlaylie "i dont understand your": Forget the coordinate param btw haha that should not be there
15:17:49FromDiscord<_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:54FromDiscord<_cyberdot> (edit) "engineer," => "engineer. Here,"
15:20:00FromDiscord<_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:42FromDiscord<griffith1deadly> sent a code paste, see https://play.nim-lang.org/#pasty=CbDGviCA
15:21:19FromDiscord<_cyberdot> Yeah, I was trying to avoid the ptr way
15:22:01FromDiscord<_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:41FromDiscord<griffith1deadly> you can't get `safe reference aka ref` of `object` without copy directly
15:23:32FromDiscord<_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:38FromDiscord<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:06FromDiscord<_cyberdot> Ok, I'll do a reading on that section
15:25:29FromDiscord<_cyberdot> I guess I am coming with some assumptions of how pointers and references should work on Nim
15:27:14FromDiscord<_cyberdot> Thanks for the help and patience, @griffith1deadly @lainlaylie.
15:32:38FromDiscord<griffith1deadly> sent a code paste, see https://play.nim-lang.org/#pasty=iMcYQMNV
15:32:54FromDiscord<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:53FromDiscord<_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:56FromDiscord<_cyberdot> I was definitely overcomplicating it
15:50:06FromDiscord<_cyberdot> I will play a bit with {.byaddr.} to see if it replicates the behaviour I am trying.
15:50:53FromDiscord<_cyberdot> Thanks a lot!
16:03:55*jjido joined #nim
16:05:41*xet7 joined #nim
16:11:34*nils` joined #nim
16:32:05FromDiscord<_nenc> byaddr is based on template...? is it really the same as what it's name says
16:32:13FromDiscord<_nenc> (edit) "says" => "says?"
16:33:54FromDiscord<_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:02FromDiscord<_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:16FromDiscord<_cyberdot> sent a code paste, see https://play.nim-lang.org/#pasty=giIQWdvA
16:54:02FromDiscord<_cyberdot> (edit) "https://play.nim-lang.org/#pasty=fgkBregP" => "https://play.nim-lang.org/#pasty=HtKyNfjP"
16:54:41FromDiscord<_cyberdot> I guess case is returning the result of vector.x and not vector.x itself
16:55:37FromDiscord<_cyberdot> So far seems to be the most pointer-like feature in Nim
16:55:53FromDiscord<_cyberdot> Except for the explicit ptr
16:56:36FromDiscord<_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:32FromDiscord<_cyberdot> sent a code paste, see https://play.nim-lang.org/#pasty=meglAAmT
17:41:40FromDiscord<_cyberdot> This is not beautiful but works
17:42:14FromDiscord<_cyberdot> Saves with not having to de-reference using [] operator every time you access it
17:42:43FromDiscord<_cyberdot> (edit) "it" => "the variable"
17:43:57FromDiscord<_cyberdot> (edit) "variable" => "variable. Makes it somewhat safer to use ptr"
17:44:49*skippy8 quit (Quit: WeeChat 4.6.3)
18:10:01FromDiscord<_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:17FromDiscord<Robyn [She/Her]> In reply to @griffith1deadly "you can use ": `new(float)`
18:15:59FromDiscord<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:53FromDiscord<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:30FromDiscord<_cyberdot> I really like this solution
23:03:59*jjido quit (Quit: My laptop has gone to sleep. ZZZzzz…)