<< 23-07-2026 >>

00:00:43*sdothum quit (Remote host closed the connection)
00:02:54*sdothum joined #nim
00:10:13FromDiscord<pipeliner.osdev> hey which compiler is faster?↵clang? mvsc(vcc)? gcc? icc?
00:37:51FromDiscord<im_rob> sent a code paste, see https://play.nim-lang.org/#pasty=ZkOlSQOr
00:38:11FromDiscord<im_rob> (edit) "https://play.nim-lang.org/#pasty=VizjmjeI" => "https://play.nim-lang.org/#pasty=OVLNWEmW"
01:02:15*mal`` quit (*.net *.split)
01:02:15*vival quit (*.net *.split)
01:02:15*tty303 quit (*.net *.split)
01:02:16*karolyi quit (*.net *.split)
01:02:16*nariyel quit (*.net *.split)
01:02:16*tanami quit (*.net *.split)
01:02:16*jj quit (*.net *.split)
01:07:56*mal`` joined #nim
01:07:56*vival joined #nim
01:07:56*tty303 joined #nim
01:07:56*karolyi joined #nim
01:07:56*nariyel joined #nim
01:07:56*tanami joined #nim
01:07:56*jj joined #nim
01:08:42*jj quit (Max SendQ exceeded)
01:08:56*jj joined #nim
01:27:17*rockcavera quit (Remote host closed the connection)
01:38:42FromDiscord<_timurski> In reply to @im_rob "Can someone help me": change `body` to `untyped`
01:40:12FromDiscord<_timurski> can't have a `typed` body when there's no body yet. but this is indeed a confusing error message
01:42:02FromDiscord<_timurski> Nim's comptime complexity unfortunately does make it a lot more prone to bugs
01:46:11FromDiscord<Robyn [She/Her]> In reply to @pipeliner.osdev "hey which compiler is": in which way? compilation speed or when running a binary? Compilation speed will nearly never be an issue, since it's the Nim compiler that adds most of the compilation time↵↵Runtime speed, iirc Clang produced faster binaries than gcc
02:02:54FromDiscord<im_rob> In reply to @_timurski "can't have a `typed`": I needed the untyped for reflection on the proc's return type and thought I was lucky when I got this error message
02:03:01FromDiscord<im_rob> Appreciate it
02:03:27FromDiscord<im_rob> I understand very little of this
02:03:31FromDiscord<im_rob> macros very new to me
02:04:01FromDiscord<_timurski> it's very understandable, it might help to do something as simple as to read the first half of "Crafting Interpreters"
02:04:11FromDiscord<_timurski> knowing just a bit more about compiler design can help a lot
02:04:25FromDiscord<Robyn [She/Her]> In reply to @im_rob "Can someone help me": I have a question, what are you trying to do?
02:05:24FromDiscord<_timurski> LLMs are also actually quite good at writing macros in my experience, because you can easily debug them with `expandMacros` and there's a lot of code which is just a pain to write by hand
02:05:56FromDiscord<_timurski> but you should definitely understand them yourself if you're using them in your project
02:06:06FromDiscord<Robyn [She/Her]> ngl i wouldn't trust a LLM to write macros
02:06:34FromDiscord<Robyn [She/Her]> i wouldn't trust a LLM for most code meant for serious use besides for small things
02:06:37FromDiscord<_timurski> my best success with it was getting to optimize spline evaluations, which is extremely easy to verify correctness for
02:06:50FromDiscord<Robyn [She/Her]> ah? spline evaluations?
02:06:52FromDiscord<_timurski> yes
02:06:54FromDiscord<im_rob> In reply to @_timurski "it's very understandable, it": I'll take a look
02:06:55FromDiscord<_timurski> evaluating b-splines
02:07:29FromDiscord<_timurski> In reply to @battery.acid.bubblegum "i wouldn't trust a": my experience is just that if you give specific instructions where there's no ambiguity, it usually works great
02:07:43FromDiscord<_timurski> "implement algorithm X in this proc" is usually fine
02:07:51FromDiscord<_timurski> however as soon as you get into any architectural decisions it all goes to shit
02:08:29FromDiscord<Robyn [She/Her]> that makes sense, gotcha
02:09:55FromDiscord<_timurski> In reply to @battery.acid.bubblegum "ah? spline evaluations?": it managed to implement a compile-time version of Horner's method (spline degrees were known at comptime) where it's very obvious that the generated code can't get any faster, leading to 640 million spline evaluations / sec on my mac m1
02:10:36FromDiscord<_timurski> which is pretty damn good
02:10:51FromDiscord<_timurski> definitely something a human could do as well, not anything genius-level, but it saves time
02:41:56*SchweinDeBurg joined #nim
02:46:09FromDiscord<pipeliner.osdev> In reply to @battery.acid.bubblegum "in which way? compilation": speed of running binary
04:18:35FromDiscord<lainlaylie> #nim-ai
05:07:29FromDiscord<asviest> In reply to @battery.acid.bubblegum "in which way? compilation": I wouldn't say so, last time when I tested, compiling nim code with clang (especially zig cc) was much faster. I don't sure why, maybe nim compiler overhead reduced because parallel compilation of different modules (I'm not sure if Nim before 2.4 can do that) or because I have some C deps that compiles faster but seems that compilation with clang (zig cc) is definetly fast
06:27:04*termer quit (Remote host closed the connection)
06:27:25*termer joined #nim
06:29:41*Skippy8 joined #nim
06:56:41*Skippy8 quit (Ping timeout: 247 seconds)
07:40:39FromDiscord<mratsim> In reply to @battery.acid.bubblegum "ngl i wouldn't trust": I have a Nim -> Cuda/OpenCL/Vulkan/WebGPU compiler implemented in macros and DeepSeek V4 Flash is able to navigate it fine, even the getType/getTypeImpl/getTypeInst madness
07:40:59FromDiscord<mratsim> also macro fails at compile-time so instant compiler feedback
07:41:09FromDiscord<mratsim> (edit) "macro fails" => "macros fail"
07:42:56FromDiscord<mratsim> but like @_timurski said, for greenfield you need to either DYI or very strong steering. For incremental addition it's fine. For refactoring, make very clear goals.
07:43:24FromDiscord<_timurski> what's DYI?
07:58:43*Skippy8 joined #nim
08:02:48*SchweinDeBurg quit (Remote host closed the connection)
08:04:07*SchweinDeBurg joined #nim
08:14:47*Skippy8 quit (Ping timeout: 270 seconds)
08:15:21*Skippy8 joined #nim
08:19:47*Skippy8 quit (Ping timeout: 260 seconds)
08:22:52FromDiscord<mratsim> In reply to @_timurski "what's DYI?": typo, DIY -> Do It Yourself
09:46:55FromDiscord<_ot> was there @ everyone ping or something
10:41:44*Skippy8 joined #nim
10:43:29*Mister_Magister quit (Excess Flood)
10:43:53*Mister_Magister joined #nim
10:57:05*Skippy8 quit (Ping timeout: 241 seconds)
10:59:49*Skippy8 joined #nim
11:24:56FromDiscord<mratsim> In reply to @_ot "was there @ everyone": I don't think so but it might have been deleted
11:26:28*Skippy8 quit (Ping timeout: 243 seconds)
11:35:38*FromDiscord quit (Remote host closed the connection)
11:35:51*FromDiscord joined #nim
11:39:46*FromDiscord quit (Remote host closed the connection)
11:39:59*FromDiscord joined #nim
12:10:30FromDiscord<Robyn [She/Her]> In reply to @mratsim "I have a Nim": hm. fair ig
12:20:48FromDiscord<Phil> In reply to @_timurski "what's DYI?": Don't Yodle Instantly
12:20:57FromDiscord<Phil> Always prepare
12:21:09FromDiscord<Phil> (edit) "Always prepare ... " added "first"
12:54:32*zero` quit (Ping timeout: 260 seconds)
13:12:09*zero` joined #nim
13:25:33*SchweinDeBurg quit (Remote host closed the connection)
13:25:41*SchweinD1 joined #nim
13:27:30*Skippy8 joined #nim
13:47:44*Skippy8 quit (Ping timeout: 256 seconds)
15:32:04*Skippy8 joined #nim
15:48:46*skulk joined #nim
15:49:08skulkanyone have any tips on debugging weird ARC/ORC issues where a ref gets invalidated after being returned from a function?
15:49:44skulkI have a nondeterministic situation where a proc returns a ref (which is valid at the time of return) but seems to get garbage-collected and causes a segfault when it's dereferenced by the caller
15:50:16skulkand it seems to have a very specific set of conditions to trigger it, resisting any attempts at creating a small example that I can share
15:50:28skulk(I can just switch to --mm:markAndSweep and it goes away)
17:16:35*jjido joined #nim
17:17:02*Skippy8 quit (Ping timeout: 260 seconds)
17:18:25*Skippy8 joined #nim
18:04:55FromDiscord<puffball1567> sent a long message, see https://pasty.ee/qJkDPivb
18:22:05*Mister_Magister_ joined #nim
18:22:59*Mister_Magister quit (Ping timeout: 266 seconds)
18:23:55*redj quit (Ping timeout: 270 seconds)
18:25:18*Mister_Magister_ is now known as Mister_Magister
18:36:42*redj joined #nim
18:36:56FromDiscord<im_rob> In reply to @_timurski "it's very understandable, it": Putting this out there for others that are unfamiliar with macros and compilers, can second this recommendation. ↵Just glancing has already been helpful. Going to follow through the rest just for the exercise of learning.↵Many thanks!
18:37:16FromDiscord<im_rob> (edit) "Going" => "I'm going" | "I'm goingto follow through the rest ... just" added "of the book"
18:40:59jjidowhich book?
18:41:54FromDiscord<im_rob> In reply to @jjido "which book?": "Crafting Interpreters"↵↵I'm open to others if you have any in mind.
18:42:33FromDiscord<im_rob> This is a subject I've been avoiding for no good reason. Time to learn
18:42:33jjidoI studied that one already
19:00:51FromDiscord<_timurski> In reply to @im_rob "Putting this out there": I'm glad!
19:19:41FromDiscord<helix0172_61946> chat is a sigsev during compilation normal or nah
19:28:36*xet7 quit (Quit: Leaving)
19:31:13FromDiscord<im_rob> In reply to @helix0172_61946 "chat is a sigsev": what os?
19:31:19FromDiscord<helix0172_61946> Linux
19:31:24FromDiscord<helix0172_61946> Ubuntu to be specific
19:32:17*jjido quit (Ping timeout: 245 seconds)
19:32:48FromDiscord<im_rob> compiling nim itself or code you wrote?
19:32:54FromDiscord<helix0172_61946> code i wrote
19:33:15FromDiscord<im_rob> I mean it's not normal but it's not uncommon depending on what's going on
19:33:42FromDiscord<im_rob> what compiler you using?
19:33:45FromDiscord<helix0172_61946> Damn called me out for having no idea what im doing
19:34:12FromDiscord<im_rob> haha
19:34:22FromDiscord<helix0172_61946> sent a code paste, see https://play.nim-lang.org/#pasty=XtRcVQZS
19:35:36*SchweinD1 quit (Remote host closed the connection)
19:35:55*SchweinDeBurg joined #nim
19:36:43FromDiscord<im_rob> maybe nim version issue?
19:37:10FromDiscord<im_rob> I see 2.2.4 has a few sigsev issues that were fixed in later versions
19:37:34FromDiscord<im_rob> In reply to @helix0172_61946 "Damn called me out": for the record I'm likely not far off from this myself
19:38:06*SchweinDeBurg quit (Remote host closed the connection)
19:38:08FromDiscord<helix0172_61946> In reply to @im_rob "maybe nim version issue?": I was trying to get the .treeRepr of a nim node (nnkSym) i just created, it didnt like that
19:38:26*SchweinDeBurg joined #nim
19:38:50FromDiscord<im_rob> care to share the code?
19:39:31FromDiscord<im_rob> mostly for my own curiosity
19:40:33FromDiscord<helix0172_61946> Let me see if i can throw together a minimal example
19:51:07FromDiscord<helix0172_61946> sent a code paste, see https://play.nim-lang.org/#pasty=beelHesl
19:51:25FromDiscord<helix0172_61946> It needs the return value for some reason, otherwise the error is handled properly so this might be an actual bug
19:52:02*SchweinDeBurg quit (Quit: WeeChat 4.8.0-dev)
19:52:58FromDiscord<im_rob> well obviously it segfaults because you call segfault
19:53:04FromDiscord<im_rob> no no I'll see myself out...
19:53:18FromDiscord<helix0172_61946> That was w rage bait
19:53:26FromDiscord<im_rob> I'm here all night
19:53:34FromDiscord<im_rob> but yeah does seem like a compiler bug?
19:53:44FromDiscord<im_rob> or more like a poor description of the issue
19:53:57FromDiscord<im_rob> I believe, and bare with me digging into macros and the compiler is new to me
19:54:26FromDiscord<im_rob> but I believe that newNimNode(nnkSym) is invalid
19:55:00FromDiscord<im_rob> (edit) "newNimNode(nnkSym)" => "`newNimNode(nnkSym)`"
19:55:53FromDiscord<im_rob> [nnkSym is a compiler-resolved symbol ](https://nim-lang.org/docs/macros.html)↵↵"Identifiers are nnkIdent nodes. After the name lookup pass these nodes get transferred into nnkSym nodes."
19:56:31FromDiscord<im_rob> which I believe implies that nnkSym nodes are produces during semantic analysis and not for manual construction?
19:57:01FromDiscord<im_rob> @_timurski Hope you're cool with me at'ing you. Could you weigh in?
19:58:34FromDiscord<helix0172_61946> I was attempting to match trees which is how i normally go about creating macros. I did see that quote in the manual so i moved to a newIdentNode and hoped it would work. Havent gotten to a point where i can test that yet though
20:14:22*om3ga quit (Ping timeout: 260 seconds)
20:21:40*jjido joined #nim
20:54:22*jjido quit (Ping timeout: 245 seconds)
21:23:52*rockcavera joined #nim
21:24:12*tiorock joined #nim
21:24:12*tiorock quit (Changing host)
21:24:12*tiorock joined #nim
21:24:12*rockcavera is now known as Guest3944
21:24:12*Guest3944 quit (Killed (molybdenum.libera.chat (Nickname regained by services)))
21:24:12*tiorock is now known as rockcavera
22:18:53*jjido joined #nim
22:26:02*jjido quit (Ping timeout: 245 seconds)
22:34:50*jjido joined #nim
22:39:47*jjido quit (Ping timeout: 245 seconds)
23:24:57*om3ga joined #nim
23:46:02FromDiscord<helix0172_61946> I should not have banked on expressions https://media.discordapp.net/attachments/371759389889003532/1529998054483034162/image.png?ex=6a63f93a&is=6a62a7ba&hm=dffc6effe818c2e69c51d5ce667310014ad0d8c2d2b695fb7e3c75d4cbbb7f68&
23:46:16FromDiscord<helix0172_61946> I wonder if a lamba would fix this??
23:48:49FromDiscord<helix0172_61946> Actually why am i doing this inside of the quote do
23:50:03*rockcavera quit (Remote host closed the connection)
23:57:59FromDiscord<helix0172_61946> Oh i see what the issue is, that if statement is not an expression but ive been treating it like it was