<< 14-05-2025 >>

00:00:22*skippy8 quit (Quit: WeeChat 4.5.2)
00:07:17*acidsys quit (Ping timeout: 248 seconds)
00:08:15*acidsys joined #nim
00:28:50FromDiscord<frusadev> Is there any union type in nim ?
00:48:14*SchweinDeBurg joined #nim
00:50:25*rockcavera quit (Remote host closed the connection)
00:52:27FromDiscord<Elegantbeef> @frusadev there are both tagged and untagged unions. Tagged unions are called object variants in Nim
01:58:15*SchweinDeBurg quit (Quit: WeeChat 4.7.0-dev)
04:31:34*ntat joined #nim
04:35:14*SchweinDeBurg joined #nim
05:14:00*xutaxkamay joined #nim
05:49:32Amun-Rathere's also C style union for C interop
05:51:11FromDiscord<Elegantbeef> Those would be the untagged ones
05:51:28Amun-Rayes
05:51:44FromDiscord<Elegantbeef> Well you said also but I already mentioned them 😛
05:52:11Amun-RaI blame me for my inability to read the backlog in whole ;)
06:58:06FromDiscord<tauruuuuuus> In reply to @leorize "setjmp on the other": Ok, I'm not an expert on setjmp stuff, just wanted to understand if there was any benefit/performance issues/etc. for each of those!
07:04:20FromDiscord<0xfab_10> the benefit of setjmp is that when you're really deep in the call stack you can just do a big jump backwards instead of many small jumps
07:16:29*ntat quit (Quit: leaving)
07:19:28FromDiscord<tauruuuuuus> got it, thanks
07:20:06FromDiscord<tauruuuuuus> I was wrapping my head about how that works for `try/finally` blocks in code running for small MCUs, that makes it clearer
07:48:14FromDiscord<leorize> note that this is only true when you are using refc with no destructors↵(@0xfab_10)
07:48:21FromDiscord<leorize> since refc can clean up memory after the fact
07:48:45FromDiscord<leorize> but for destructors-based stuff like arc/orc, you still have to unwind frames one by one
07:50:04FromDiscord<0xfab_10> yeah
07:51:39*ntat joined #nim
08:15:10*beholders_eye joined #nim
09:01:53FromDiscord<jseb> In reply to @battery.acid.bubblegum "`seq[set[Compass]]`": a sequence of set ? You mean, storing the maze as booleans operations on set ?
09:02:30FromDiscord<jseb> (edit) "?" => "?↵That's what i was trying to do yesterday, but i gave end at the end"
09:06:58FromDiscord<Robyn [She/Her]> In reply to @jseb "a sequence of set": yep, and i missed that sorry
09:10:50FromDiscord<jseb> oh no problem, it was just to be sure. I try again
09:40:23FromDiscord<aintea> How should I choose between `Natural` and `uint` ?
09:44:33FromDiscord<jseb> if you don't mind overflow on boundaries, you can use uint , otherwise use Natural which is forbidding overflow
09:46:09FromDiscord<aintea> I which cases should I not mind overflows
09:46:10FromDiscord<jseb> sent a code paste, see https://play.nim-lang.org/#pasty=OudSldMB
09:46:40FromDiscord<aintea> Also is it possible to make an array of x elements, x being known at runtime ?
09:46:50FromDiscord<aintea> at least an openArray, since arrays are compile time allocated
09:47:45FromDiscord<jseb> (edit) "https://play.nim-lang.org/#pasty=vuVVRxvh" => "https://play.nim-lang.org/#pasty=HwECsXrQ"
09:48:49*ntat quit (Quit: leaving)
09:49:03FromDiscord<jseb> with a sequence you can do that (you will grow the seq to the needed number of elements)
09:49:16FromDiscord<aintea> yes but I need the sequence to be a certain size and never change
09:49:31*ntat joined #nim
09:50:05FromDiscord<jseb> honestly i'm a terrible newb, so let's someone else answer ^^'
09:59:28FromDiscord<dawidek.2137> You can use newseqwithlen ad a let, I think that prevents adding to it
10:00:45FromDiscord<dawidek.2137> But you’re not going to get the len as a part of the type
10:07:25*ntat quit (Read error: Connection reset by peer)
10:07:37*ntat joined #nim
10:39:58FromDiscord<Laylie> sent a code paste, see https://play.nim-lang.org/#pasty=rbxInHXW
11:04:20FromDiscord<jseb> In reply to @Laylie "jseb, is this no": i'm impressed. That's so elegant ! Exactly what i was searching. I think i'm beginning to understand set and their use
11:52:47*ntat quit (Quit: leaving)
12:36:04FromDiscord<pmunch> Oh no 😦 version `GLIBC_2.38' not found
12:37:56FromDiscord<nnsee> In reply to @pmunch "Oh no 😦 version": what are you trying to run?
12:38:25FromDiscord<pmunch> A small program
12:38:42FromDiscord<pmunch> I've been compiling it locally, then scp-ing it to a server and running it there
12:39:27FromDiscord<nnsee> use zigcc to statically compile it with musl, i suppose
12:39:52FromDiscord<pmunch> This means I either A) need to set up some Docker based build thing to locally build my project. B) Figure out how to compile my project with musl. C) Set up Nim and dependencies on the target server
12:40:04FromDiscord<pmunch> Neither of which is very appealing..
12:41:36FromDiscord<nnsee> option B should be relatively simple
12:41:36FromDiscord<nnsee> https://github.com/enthus1ast/zigcc
12:43:20*ntat joined #nim
12:44:56FromDiscord<pmunch> Huh, well that was fairly trivial
12:44:57FromDiscord<pmunch> Thanks!
12:45:11Amun-Rayou can use -static too
12:45:19Amun-Ra(depends on program features)
12:45:23Amun-Radepending*
12:48:27FromDiscord<pmunch> Just `-static`?
12:48:30FromDiscord<pmunch> Oh, with --passL?
12:49:11FromDiscord<nnsee> In reply to @Amun-Ra "you can use -static": well if the issue is with glibc that won't help, i don't think
12:55:11FromDiscord<pmunch> Hmm, well the zigcc path didn't work either..
12:55:18FromDiscord<pmunch> I get a SIGILL after a second or two
12:57:21FromDiscord<anuke> In my experience docker was the only thing that worked easily
12:58:15FromDiscord<anuke> Musl didn't work for me due to certain library headers not being compiled for it
13:01:28FromDiscord<pmunch> Ah, never mind. I didn't have force rebuild so it was probably linking in some old cache files
13:02:35FromDiscord<pmunch> Ooops, never mind that, I had actually just forgotten to restart it
13:05:30FromDiscord<nnsee> if you get a SIGILL it might be because it's compiling with optimizations for your cpu
13:06:05FromDiscord<nnsee> you might need to manually specify to compile with no CPU-specific optimizations. I forgot what the flag was for that
13:13:07FromDiscord<pmunch> Hmm
13:16:05*andy-turner joined #nim
13:16:23FromDiscord<pmunch> Tried `nimble build --cc:clang --clang.exe="zigcc" --clang.linkerexe="zigcc" --forceBuild:on --passL:"-O0" --passC:"-O0"`, but no dice
13:20:07FromDiscord<nnsee> In reply to @pmunch "Tried `nimble build --cc:clang": i think the flags were -mcpu and -mtune
13:20:23FromDiscord<pmunch> Ah `-march=x86_84` worked
13:20:36FromDiscord<pmunch> Not sure how that is different from `mcpu` and `mtune`
13:22:47FromDiscord<nnsee> apparently:↵> -mcpu unfortunately has different semantics for different targets. It's deprecated for x86 (being a synonym for -mtune) but not for ARM, where it's a sum of -march and -mtune.
13:32:38*xutaxkamay quit (Ping timeout: 265 seconds)
13:52:57*xutaxkamay joined #nim
14:22:54*GnuYawk quit (Quit: The Lounge - https://thelounge.chat)
14:23:18*GnuYawk1 joined #nim
14:38:57*xtr00 quit (Ping timeout: 252 seconds)
14:42:10*xtr00 joined #nim
15:07:49*Ekho quit (Remote host closed the connection)
15:27:48*Ekho joined #nim
15:56:53*skippy8 joined #nim
16:05:23FromDiscord<choltreppe> sent a code paste, see https://play.nim-lang.org/#pasty=dmBfpjLt
16:09:33FromDiscord<Elegantbeef> `move newObj(foo, ba).someField`
16:59:51*SchweinDeBurg quit (Quit: WeeChat 4.7.0-dev)
17:12:36*ntat quit (Quit: leaving)
17:13:19*ntat joined #nim
17:35:47FromDiscord<choltreppe> sent a code paste, see https://play.nim-lang.org/#pasty=dtSRdyfh
17:38:01*beholders_eye quit (Ping timeout: 276 seconds)
18:15:44*andy-turner quit (Read error: Connection reset by peer)
18:15:51*andy-turner_ joined #nim
18:23:04*beholders_eye joined #nim
18:40:54*beholders_eye quit (Ping timeout: 260 seconds)
18:48:33*beholders_eye joined #nim
18:55:54*andy-turner_ quit (Remote host closed the connection)
18:56:17*andy-turner_ joined #nim
19:00:05*beholders_eye quit (Ping timeout: 252 seconds)
19:40:36*andy-turner_ quit (Read error: Connection reset by peer)
19:40:45*andy-turner_ joined #nim
19:54:07*bioinfo joined #nim
20:02:01FromDiscord<nitely_> In reply to @choltreppe "tried that first. I": try ensureMove
20:30:35FromDiscord<Elegantbeef> @nitely_ The issue is that the procedure doesn't return a R-value but an L-value, so no amount of trickery is going to do anything unless it returns a `var T`
20:34:38*ntat quit (Quit: leaving)
20:36:55FromDiscord<summarity> > signature for '=copy' must be proc[T: object](x: var T; y: T)↵Is it possible to implement an assignment operator for a case where I have `MyType[T]` on the left and `T` on the right? It seems like from this error, that both sides must be the exact same type.
20:46:05*andy-turner_ quit (Quit: Leaving)
20:46:38*andy-turner joined #nim
20:49:37*beholders_eye joined #nim
20:52:54FromDiscord<summarity> sent a code paste, see https://play.nim-lang.org/#pasty=nmTnjnXl
20:53:20FromDiscord<summarity> (edit) "https://play.nim-lang.org/#pasty=XkiNuQSK" => "https://play.nim-lang.org/#pasty=TajmLrWn"
20:59:58*dv^_^9 joined #nim
21:01:10*dv^_^ quit (Read error: Connection reset by peer)
21:01:10*dv^_^9 is now known as dv^_^
21:10:41*andy-turner quit (Quit: Leaving)
21:10:57*andy-turner joined #nim
21:14:01FromDiscord<Elegantbeef> Not without a converter so it's not really ideal
21:14:01FromDiscord<Elegantbeef> Better to just do `type MyType[T] = distinct T` and then do `lhs = MyType[int](rhs)`
21:24:13*beholders_eye quit (Ping timeout: 276 seconds)
21:26:50*andy-turner quit (Quit: Leaving)
21:27:06*andy-turner joined #nim
21:30:43FromDiscord<summarity> hm, yeah that's not an alternative as in this case the API needs to look as much like a normal assignment as possible, but thanks 👍
21:35:12*andy-turner quit (Quit: Leaving)
21:40:01*rockcavera joined #nim
22:45:29*Jjp137_ quit (Quit: Leaving)
22:47:57*Jjp137 joined #nim
22:50:01*rockcavera quit (Ping timeout: 276 seconds)
22:51:58*skippy8 quit (Quit: WeeChat 4.5.2)
22:52:48*rockcavera joined #nim
22:52:48*rockcavera quit (Changing host)
22:52:48*rockcavera joined #nim
23:09:52*tiorock joined #nim
23:09:52*tiorock quit (Changing host)
23:09:52*tiorock joined #nim
23:09:52*rockcavera is now known as Guest477
23:09:52*tiorock is now known as rockcavera
23:13:49*Guest477 quit (Ping timeout: 252 seconds)