<< 05-08-2023 >>

00:04:37FromDiscord<ieltan> In reply to @avahe "The video? Yeah he": Wouldn't bet on it tbh
00:05:15FromDiscord<Prestige> Yeah, we'll see
00:32:06FromDiscord<michaelb.eth> sent a code paste, see https://play.nim-lang.org/#ix=4Cov
00:33:25FromDiscord<michaelb.eth> building the static lib on macOS seems broken w.r.t. `libui-ng` itself, fwiw
01:42:33*lfanew joined #nim
01:49:42*lfanew quit (Changing host)
01:49:42*lfanew joined #nim
01:49:53*lfanew left #nim (#nim)
01:50:19*lfanew joined #nim
02:38:05*ajunior quit (Quit: My MacBook Pro has gone to sleep. ZZZzzz…)
02:49:52*ajunior joined #nim
02:57:16NimEventerNew thread by Ward: Dark Theme Problem in Nim Manual, see https://forum.nim-lang.org/t/10376
03:51:01FromDiscord<.kanaxa> In reply to @isofruit "If you want I": Ooooh this is quite nice - it's a static site generator of sorts, for books?
03:51:16FromDiscord<.kanaxa> Speaking of books, I've been reading Dr Salewski's Nim book
03:51:29FromDiscord<.kanaxa> Content-wise it's good, but the good doctor really needs an editor
03:51:52FromDiscord<.kanaxa> Very verbose,aand a lot of verbiage that could be cut down (while still maintaining the conversational tone)
03:52:16FromDiscord<.kanaxa> And I'm saying that as a lawyer who has to suffer through legalese and verbiage constantly
03:54:18FromDiscord<.kanaxa> In reply to @michaelb.eth "came back to this": I tried libui-ng yesterday as well, it''s definitely native looking
03:54:43FromDiscord<.kanaxa> Am very keen on writing a quick app just to see how writing a utility GUI app in Nim on Windows/Mac/Linux feels
04:03:53FromDiscord<michaelb.eth> In reply to @.kanaxa "Am very keen on": go 4 it, and let us know how it goes!
04:09:38FromDiscord<Phil> In reply to @.kanaxa "Ooooh this is quite": Yeah sorta.↵Here some nimibook examples:↵https://can-lehmann.github.io/owlkettle/docs/tutorial.html↵https://norm.nim.town/models.html
04:11:30FromDiscord<Elegantbeef> I even embed my writeups in my website using iframes and nimib 😄
04:12:14FromDiscord<Elegantbeef> Don't know how nice the experience is, but meh
04:14:58FromDiscord<Chronos [She/Her]> In reply to @Elegantbeef "Don't know how nice": Doesn't sound great for accessibility tools
04:15:32FromDiscord<Elegantbeef> Do iframes break accessibility tooling?
04:15:57FromDiscord<Chronos [She/Her]> Oh wait iframes not canvas
04:16:09FromDiscord<Chronos [She/Her]> Okay then I'm guessing it should be fine on that part?
04:16:27FromDiscord<Chronos [She/Her]> In reply to @yu.vitaqua.fer.chronos "Oh wait iframes not": My sleep deprivation is a problem I'm not gonna be fixing, sorry :p
04:21:09FromDiscord<Chronos [She/Her]> I'm currently wondering on how I should handle the abstraction of data for my backend hm... I'm probably gonna want macros and custom types for constraints and for making it integrate with Nim types nicely anyway
04:21:14FromDiscord<Chronos [She/Her]> Painful but oh well
04:22:07FromDiscord<Chronos [She/Her]> For now I'll just manually make encoders/decoders for serialising and deserialising data
04:22:29FromDiscord<Chronos [She/Her]> ...hm
04:22:52FromDiscord<Chronos [She/Her]> To be fair, for a proof of concept, hardcoding the data in is fine
04:23:44FromDiscord<.kanaxa> https://scripter.co/nim-deploying-static-binaries/
04:23:54FromDiscord<.kanaxa> Article on Nim with musl-libc
04:26:19FromDiscord<.kanaxa> Wasn't reading it for that, actually stumbled on it while looking for Nimscript stuff
04:27:18FromDiscord<.matrixagent> In reply to @.kanaxa "Article on Nim with": i mean, why?
04:27:55FromDiscord<.kanaxa> According to the author, something about getting around deployment dependency issues with glibc versions
04:28:06FromDiscord<Chronos [She/Her]> In reply to @.matrixagent "i mean, why?": I believe one use is avoiding incompatible versions of musl or glibc from being an issue
04:28:15FromDiscord<.kanaxa> But I find that odd
04:28:34FromDiscord<.matrixagent> In reply to @yu.vitaqua.fer.chronos "I believe one use": cant you link glibc static?
04:28:37FromDiscord<Chronos [She/Her]> Also statically compiling stuff tends to be slightly faster only because you aren't delegating the calls to the dll stuff which the OS handles
04:29:08FromDiscord<Chronos [She/Her]> In reply to @.matrixagent "cant you link glibc": shrug never done it myself, it probably is something about the output size? Maybe musl is smaller than glibc or something
04:29:39FromDiscord<.matrixagent> In reply to @yu.vitaqua.fer.chronos "*shrug* never done it": why does that even matter
04:29:47FromDiscord<.matrixagent> unless your targeting embedded
04:30:05FromDiscord<.matrixagent> we live in an age where we ship whole browsers for a single app
04:30:08FromDiscord<Chronos [She/Her]> Also musl isn't stuck with a ton of legacy cruft since it's younger I think
04:30:26FromDiscord<.matrixagent> In reply to @yu.vitaqua.fer.chronos "Also musl isn't stuck": musl is slower than glibc
04:30:39FromDiscord<.matrixagent> its within inferior quality thats for sure
04:30:51FromDiscord<Chronos [She/Her]> The cleaner codebase makes up for it
04:30:59FromDiscord<.matrixagent> its slower
04:31:04FromDiscord<Chronos [She/Her]> Glibc has inline ASM which is why it's faster
04:31:10FromDiscord<Chronos [She/Her]> Speed isn't everything, you know
04:31:18FromDiscord<.matrixagent> it pretty much is for me
04:31:25FromDiscord<Chronos [She/Her]> The quality of the product is much, much more important
04:31:40FromDiscord<.matrixagent> the users dont care about quality
04:31:43FromDiscord<Chronos [She/Her]> I'd rather a working, slower product than a shoddy barely working faster product
04:31:47FromDiscord<.matrixagent> if your app is laggy they wont even give it a shot
04:32:10FromDiscord<Chronos [She/Her]> Which is why you strike a happy medium
04:32:19FromDiscord<.matrixagent> agreed
04:32:23FromDiscord<Chronos [She/Her]> But... The difference isn't noticable with musl and glibc's speed
04:33:08FromDiscord<Chronos [She/Her]> And again, maintainability is better with musl (in their codebase) because, again, less legacy cruft and ASM
04:33:48FromDiscord<.matrixagent> i mean let me show you a simple video why speed matters
04:33:53FromDiscord<.matrixagent> just watch 30 seconds
04:34:26FromDiscord<Chronos [She/Her]> I'm not saying speed doesn't matter
04:34:42FromDiscord<Chronos [She/Her]> I'm saying that the difference isn't noticable in practice
04:34:49FromDiscord<.matrixagent> https://youtu.be/9cLJqu4ha34?t=451
04:34:57FromDiscord<Chronos [She/Her]> You shave off a few microseconds here and there, that doesn't exactly do much
04:35:00FromDiscord<.matrixagent> ryujinx is with C# and yuzu is with C++
04:35:03FromDiscord<.matrixagent> the performance is huge
04:35:07FromDiscord<.matrixagent> 20 fps diff
04:35:37FromDiscord<.matrixagent> o wait wrong video
04:35:43FromDiscord<Chronos [She/Her]> In reply to @.matrixagent "https://youtu.be/9cLJqu4ha34?t=451": This talks about Vulkan vs OpenGL
04:35:54FromDiscord<.matrixagent> yup wrong vid
04:35:57FromDiscord<.matrixagent> gimme a min
04:36:05FromDiscord<Chronos [She/Her]> OpenGL is much higher level and hides stuff while Vulkan is very "do it yourself"
04:36:07FromDiscord<Chronos [She/Her]> Aight
04:36:33FromDiscord<.matrixagent> https://youtu.be/f4Wt-PnBAUQ?t=149
04:36:34FromDiscord<.matrixagent> this
04:37:18FromDiscord<.matrixagent> https://youtu.be/ba5esrsqVF4?t=24
04:37:29FromDiscord<.matrixagent> here is a benchmark for a newer game that really shows the diff
04:38:42FromDiscord<Chronos [She/Her]> In reply to @.matrixagent "https://youtu.be/f4Wt-PnBAUQ?t=149": Majorly different implementations, makes sense they'd have a difference in quality
04:38:59FromDiscord<.matrixagent> yeah but also one is in C# and one is in C++
04:39:13FromDiscord<.matrixagent> in C++ you can squeeze as much perfomance as possible
04:39:43FromDiscord<.matrixagent> its also impressive that C# can reach this level of performance with an optimizing interpreter
04:40:33FromDiscord<Chronos [She/Her]> Exactly
04:41:24FromDiscord<Chronos [She/Her]> You're still missing my point in the first place though, in production, unless every microsecond matters, you're not going to see or have an issue with the lib impl
04:41:43FromDiscord<.matrixagent> i mean it heavly depends on what your making
04:41:46FromDiscord<Chronos [She/Her]> And they're also designed for different things to, musl being designed to be easy to statically link to
04:41:51FromDiscord<.matrixagent> sometimes microseconds mean everything
04:41:58FromDiscord<.matrixagent> sometimes it literally means nothing
04:42:13FromDiscord<Chronos [She/Her]> For a game or even the average application, you won't notice
04:42:23FromDiscord<Festive> How do I ask for input inline?
04:42:37FromDiscord<Chronos [She/Her]> That's why people use massive engines or as you said, shipping browsers for their apps
04:42:38FromDiscord<Festive> readLine(stdin) does it on the next line
04:42:47FromDiscord<.matrixagent> a game you would most certainly notice ms chronos
04:43:05FromDiscord<Chronos [She/Her]> In reply to @Festive "readLine(stdin) does it on": What do you mean?
04:43:10FromDiscord<.matrixagent> thats why the C# garbage collector has some serious optimizations under the hood
04:43:16FromDiscord<lfanew> In reply to @Festive "readLine(stdin) does it on": does it? you might just be writing a newline on your input "prompt"
04:43:23FromDiscord<lfanew> try using write instead of echo or writeline
04:43:28FromDiscord<Festive> In reply to @yu.vitaqua.fer.chronos "What do you mean?": echo "[#] Do you want to hide console? [Y/N]: "↵var consoleHide = readLine(stdin)
04:43:41FromDiscord<Festive> I want it to be on the same line
04:43:41FromDiscord<lfanew> In reply to @Festive "echo "[#] Do you": echo is appending the newline, not readline
04:43:53FromDiscord<Festive> In reply to @lfanew "echo is appending the": so how do I not append a newline
04:44:02FromDiscord<Chronos [She/Her]> yeah, use `stdout.write "text"`
04:44:24FromDiscord<.matrixagent> In reply to @lfanew "echo is appending the": cant you override it like python?
04:44:51FromDiscord<Chronos [She/Her]> In reply to @.matrixagent "a game you would": Okay, count one second for me right now
04:44:57FromDiscord<.matrixagent> In reply to @yu.vitaqua.fer.chronos "Okay, count one second": done
04:45:06FromDiscord<Festive> Thanks, that's what I needed
04:45:10FromDiscord<Festive> Now it's all pretty and compact 😉
04:45:13FromDiscord<lfanew> if you can it's not very apparent in docs
04:45:29FromDiscord<Chronos [She/Her]> In reply to @.matrixagent "done": Times that by 1000 and you get a millisecond
04:45:37FromDiscord<Chronos [She/Her]> In reply to @lfanew "if you can it's": Echo doesn't have that, no
04:45:45FromDiscord<.matrixagent> In reply to @yu.vitaqua.fer.chronos "Times that by 1000": uh?
04:45:55FromDiscord<Chronos [She/Her]> In reply to @.matrixagent "uh?": 1000 ms
04:45:55FromDiscord<.matrixagent> 1 second 1000 isnt a millisecond
04:46:28FromDiscord<Chronos [She/Her]> Sorry I'm running on fumes atm, but if you times a second by 1000, you get 1000 ms
04:46:32FromDiscord<Chronos [She/Her]> Times that again by 1000
04:46:35FromDiscord<.matrixagent> In reply to @yu.vitaqua.fer.chronos "1000 ms": and? in game dev a gc pause of 500 ms is a skipped fps
04:46:38FromDiscord<jakraes> What type does type() return? If that even makes sense lol
04:46:46FromDiscord<.matrixagent> but it wont matter since the gc wont run every fps
04:46:53FromDiscord<Chronos [She/Her]> And now you have 1000000 microseconds, can you tell me you can count every microsecond?
04:47:39FromDiscord<.matrixagent> In reply to @yu.vitaqua.fer.chronos "And now you have": ms you know that yesterday how we had an argument about malloc being slow when the ram acess time is in nano seconds and the allocation is probably under 10 ms
04:48:21FromDiscord<.matrixagent> in real time computing like games and emulators even 300 ms matters
04:48:43FromDiscord<Chronos [She/Her]> In reply to @jakraes "What type does type()": A typedesc, from what it seems like
04:48:47FromDiscord<.matrixagent> seriously a game isnt much different in real time than a trading server
04:49:09FromDiscord<jakraes> In reply to @yu.vitaqua.fer.chronos "A typedesc, from what": 🫡 Thank you, I'll see if that works
04:49:21FromDiscord<Elegantbeef> `type` is the old version of `typeof`
04:49:24FromDiscord<Chronos [She/Her]> I genuinely can't see how 500 microseconds would be an issue in production really
04:49:40FromDiscord<.matrixagent> In reply to @yu.vitaqua.fer.chronos "I genuinely can't see": then you havent written anything real time
04:49:48FromDiscord<Elegantbeef> Lol
04:49:56FromDiscord<Elegantbeef> 500 us is nothing
04:50:06FromDiscord<.matrixagent> In reply to @Elegantbeef "500 us is nothing": sure says the guy who says malloc is slow
04:50:11FromDiscord<.matrixagent> 😉
04:50:22FromDiscord<Chronos [She/Her]> You're right, I haven't, I legit can't wrap my head around the fact 500 microseconds would matter, which is why I'm insistent on this
04:50:58FromDiscord<Chronos [She/Her]> Look at Minecraft, they certainly don't care for every microsecond :p
04:51:04FromDiscord<.matrixagent> In reply to @yu.vitaqua.fer.chronos "You're right, I haven't,": i mean, can you imagine a fighter jet having a computer delay about 100ms when its traveling at the speed of sound and its trying to fire at something
04:51:18FromDiscord<.matrixagent> its unacceptable
04:51:52FromDiscord<.kanaxa> 1. When compiling, the Nim compiler accepts this switch/flag: `--app:console|gui|lib|staticlib` ↵↵2. I can see how the `lib` flag is used for generating shared libraries, but what is the `gui` flag for? I've been able to build `libui-ng` apps without that flag, what does it do?
04:51:55FromDiscord<Chronos [She/Her]> In reply to @.matrixagent "i mean, can you": That's a different scenario in where every microsecond counts, games are very much not fighter jets travelling at the speed of sound lol
04:52:06FromDiscord<.matrixagent> In reply to @yu.vitaqua.fer.chronos "That's a different scenario": sure and wait
04:52:16FromDiscord<Chronos [She/Her]> In reply to @.kanaxa "1. When compiling, ": Genuinely no idea, sorry, surely the docs say something?
04:52:20FromDiscord<.matrixagent> In reply to @yu.vitaqua.fer.chronos "Look at Minecraft, they": minecraft java is inferior compared to bedrock
04:52:31FromDiscord<huantian> woah
04:52:33FromDiscord<huantian> you just like
04:52:38FromDiscord<.matrixagent> thats even with java having a parralel GC and pre allocating heap size too
04:52:38FromDiscord<huantian> angered the entire internet with that statement
04:52:58FromDiscord<.matrixagent> In reply to @huantian "angered the entire internet": in performance, its the truth
04:53:02FromDiscord<huantian> you gotta specify performance
04:53:19FromDiscord<Chronos [She/Her]> In reply to @.matrixagent "minecraft java is inferior": MC Bedrock was made in C++/C# (idk which one) purely because mobile devices especially are much, much less weaker than your PC, and Java edition has jank code
04:53:22FromDiscord<huantian> in literally every other aspect that matters when I play minecraft your statment is wrong
04:53:42FromDiscord<.matrixagent> In reply to @yu.vitaqua.fer.chronos "MC Bedrock was made": yes C++, no java is just not made for what they are trying to do
04:53:45FromDiscord<.matrixagent> look at project zomboid
04:53:51FromDiscord<.matrixagent> the lag spikes are insane
04:54:04FromDiscord<.matrixagent> and they even use a hyper tuned GC with a crazy llvm based JIT
04:54:19FromDiscord<Festive> sent a long message, see http://ix.io/4Cp9
04:55:05FromDiscord<xtrayambak> In reply to @Festive "What's clr.nim(220)": Are you using C#?
04:55:19FromDiscord<Festive> Im using nim, but im trying to run a C# program
04:55:24FromDiscord<Chronos [She/Her]> In reply to @.matrixagent "yes C++, no java": More like they have so much old code bogging it down, it's a known fact that Java Edition has poor performance, it's why performance mods exist
04:55:26FromDiscord<xtrayambak> What?
04:55:29FromDiscord<xtrayambak> How?
04:55:44FromDiscord<xtrayambak> afaik Nim can't understand CLR code
04:55:52FromDiscord<Chronos [She/Her]> In reply to @Festive "Im using nim, but": Loading C# dlls work differently btw afaik
04:55:54FromDiscord<.matrixagent> In reply to @yu.vitaqua.fer.chronos "More like they have": optifine which boosts minecraft performance is using C++ and jni iirc 😄
04:55:59FromDiscord<Chronos [She/Her]> They use a completely different format
04:56:04FromDiscord<lfanew> In reply to @.kanaxa "1. When compiling, ": I think the GUI flag is useful for GUI application builds because it'll do things like prevent a console from opening when you're running your app. That's about as best of a reason I can think of
04:56:05FromDiscord<huantian> In reply to @.matrixagent "optifine which boosts minecraft": optifine? nah
04:56:06FromDiscord<Festive> I think that's why actually
04:56:09FromDiscord<huantian> wew're past optifine now
04:56:10FromDiscord<Chronos [She/Her]> In reply to @.matrixagent "optifine which boosts minecraft": JNI is janky and Optifine is horrible for newer versions
04:56:11FromDiscord<Festive> I run a file that doesn't need dlls and it works fine
04:56:15FromDiscord<Festive> but the second it requests a dll it just breaks
04:56:18FromDiscord<.matrixagent> In reply to @huantian "wew're past optifine now": optifine++?
04:56:19FromDiscord<xtrayambak> In reply to @.matrixagent "optifine which boosts minecraft": Sodium is pure Java and performs better though
04:56:27FromDiscord<.matrixagent> In reply to @xtrayambak "Sodium is pure Java": link?
04:56:41FromDiscord<Chronos [She/Her]> Literally grab Sodium, Sodium Extras and Starlight
04:56:47FromDiscord<huantian> what about lithium
04:56:49FromDiscord<.matrixagent> from where?
04:56:52FromDiscord<xtrayambak> In reply to @.matrixagent "optifine++?": https://github.com/CaffeineMC/sodium-fabric
04:56:53FromDiscord<huantian> and every element ever apparently
04:56:56FromDiscord<Festive> sent a code paste, see https://play.nim-lang.org/#ix=4Cpa
04:56:59FromDiscord<Chronos [She/Her]> In reply to @huantian "what about lithium": Lithium also optimises server logic
04:57:03FromDiscord<Festive> All I know is that it doesn't work with files that have dependancies
04:57:10FromDiscord<Festive> (edit) "All I know is that it doesn't work with files that have ... dependancies" added "external"
04:57:11FromDiscord<Chronos [She/Her]> In reply to @.matrixagent "from where?": CurseForge, GitHub and Modrinth have them
04:57:16FromDiscord<Festive> (edit) "dependancies" => "dependencies"
04:57:20FromDiscord<.matrixagent> In reply to @xtrayambak "https://github.com/CaffeineMC/sodium-fabric": intresting
04:57:22FromDiscord<jakraes> Sodium is currently the best fps booster for java minecraft, optifine is falling behind super fast
04:57:26FromDiscord<huantian> modrith is the place to be for these mods tho
04:57:30FromDiscord<xtrayambak> In reply to @yu.vitaqua.fer.chronos "Literally grab Sodium, Sodium": Perhaps we're going too offtopic 😅
04:57:31FromDiscord<jakraes> Facts
04:57:34FromDiscord<huantian> or github
04:57:34FromDiscord<Chronos [She/Her]> Modrinth is great
04:57:34FromDiscord<.matrixagent> so minecraft java just has garbage code
04:57:35FromDiscord<huantian> yeah this is very offtopic
04:57:39FromDiscord<Chronos [She/Her]> In reply to @xtrayambak "Perhaps we're going too": Perhaps lol
04:57:54FromDiscord<huantian> In reply to @.matrixagent "so minecraft java just": getting better though, iirc starlight is mostly obsolete with 1.20?
04:57:54FromDiscord<.matrixagent> i dont think anyone minds
04:57:58FromDiscord<xtrayambak> In reply to @.matrixagent "so minecraft java just": It allocates 200 MB in a second and deallocates it the next frame
04:57:59FromDiscord<Chronos [She/Her]> In reply to @.matrixagent "so minecraft java just": Yeah, very poor code, could be a good idea to rewrite it in Nim 😛
04:58:04FromDiscord<xtrayambak> that should tell you how it runs
04:58:10FromDiscord<huantian> well we squished out a convo about C#
04:58:11FromDiscord<huantian> lmao
04:58:12FromDiscord<Chronos [She/Her]> In reply to @.matrixagent "i dont think anyone": The fact mods exist for this shows people do mind lol
04:58:23FromDiscord<Chronos [She/Her]> In reply to @huantian "getting better though, iirc": Yeah, slowly tho
04:58:24FromDiscord<huantian> In reply to @huantian "getting better though, iirc": so vanilla code is getting better
04:58:27FromDiscord<.matrixagent> In reply to @xtrayambak "It allocates 200 MB": man yesterday i was playing minecraft + some modpack and the allocation was 600mb/s
04:58:29FromDiscord<.matrixagent> its insane
04:58:30FromDiscord<Festive> In reply to @huantian "well we squished out": 😭
04:58:32FromDiscord<Chronos [She/Her]> Oh shit yeah lmao, lets move to #offtopic
04:58:36FromDiscord<.matrixagent> sure
04:58:53FromDiscord<xtrayambak> In reply to @yu.vitaqua.fer.chronos "Yeah, very poor code,": Lettuce storm Mojang headquarters and protest
04:58:55FromDiscord<Chronos [She/Her]> sent a code paste, see https://play.nim-lang.org/#ix=4Cpb
04:59:03FromDiscord<xtrayambak> "We want Nim! We want Nim!"
04:59:19FromDiscord<Chronos [She/Her]> In reply to @xtrayambak "Lettuce storm Mojang headquarters": Lol modding community would have an uproar
04:59:33FromDiscord<Festive> In reply to @yu.vitaqua.fer.chronos "Sorry aha, I don't": 💀 neither do I im just working off scraps I found on the internet
04:59:40FromDiscord<xtrayambak> Most of the modding community probably doesn't know what a Nim is
04:59:57FromDiscord<Festive> I dont get why a file needing a dll just breaks it
05:00:00FromDiscord<Chronos [She/Her]> In reply to @Festive "💀 neither do": Fair enough lmao
05:00:05FromDiscord<xtrayambak> Hell, most of the programming community doesn't
05:00:17FromDiscord<Chronos [She/Her]> In reply to @Festive "I dont get why": Perhaps it's something to do with memory management?
05:00:29FromDiscord<Festive> In reply to @yu.vitaqua.fer.chronos "Perhaps it's something to": Probably, since the file is in memory it must do some wonky stuff
05:00:32FromDiscord<xtrayambak> In reply to @yu.vitaqua.fer.chronos "Perhaps it's something to": C# is garbage collected but uses a different GC strat
05:00:34FromDiscord<Chronos [She/Her]> In reply to @xtrayambak "Hell, most of the": Yeaaah lol
05:00:40FromDiscord<xtrayambak> perhaps that's conflicting with the Nim GC?
05:00:50FromDiscord<Festive> which one does C# use?
05:00:54FromDiscord<xtrayambak> But that'd likely throw a SIGSEGV pointing to gc.nim
05:00:54FromDiscord<Chronos [She/Her]> In reply to @xtrayambak "perhaps that's conflicting with": Was boutta say, yeah that may be it
05:00:54FromDiscord<Festive> I can compile with the same one
05:00:56FromDiscord<Festive> maybe that will fix
05:01:09FromDiscord<Chronos [She/Her]> In reply to @Festive "which one does C#": Their own implementation unsupported by Nim lol
05:01:14FromDiscord<Festive> bruh
05:01:15FromDiscord<Festive> 💀
05:01:37FromDiscord<Chronos [She/Her]> You could probably try messing with the GC on Nim's side but I wouldn't know really
05:02:03FromDiscord<Festive> I'm not rewriting the entire language to make one program work
05:02:21FromDiscord<xtrayambak> In reply to @Festive "I'm not rewriting the": Just the garbage collector
05:02:23FromDiscord<Chronos [She/Her]> Look at `GC_ref` in system.nim, maybe?
05:02:24FromDiscord<xtrayambak> Not the entire languahe
05:02:28FromDiscord<xtrayambak> (edit) "languahe" => "language"
05:02:50FromDiscord<Festive> In reply to @yu.vitaqua.fer.chronos "Look at `GC_ref` in": Marks the object x as referenced, so that it will not be freed until it is unmarked via GC_unref. If called n-times for the same object x, n calls to GC_unref are needed to unmark x. Source Edit
05:03:12FromDiscord<Festive> So if I use this on an object, nim's gc won't touch it ?
05:03:17FromDiscord<Elegantbeef> What?
05:03:24FromDiscord<Festive> Im not sure
05:03:32FromDiscord<Festive> I have no clue about the internal workings of nimlang
05:03:38FromDiscord<Festive> Im just guessing
05:03:47FromDiscord<Chronos [She/Her]> In reply to @Festive "What's clr.nim(220)": Beef look here
05:04:17FromDiscord<Festive> Im trying to run C#, but whenever a file requires a DLL, it just breaks with that error
05:04:22FromDiscord<Festive> (edit) "breaks" => "quits"
05:04:27FromDiscord<Chronos [She/Her]> My guess it's probably the GC in Nim and C# not playing nicely with eachother since festive mentioned native libs crash it
05:05:25FromDiscord<elegantbeef> Bridge is not having any of it
05:05:26FromDiscord<Elegantbeef> The hell are you guys talking about
05:05:32FromDiscord<dowylju> sent a code paste, see https://play.nim-lang.org/#ix=4Cpd
05:05:34FromDiscord<lfanew> I don't do much C#, but wouldn't the C# managed code run under a different runtime outside of Nim? They shouldn't conflict
05:05:40FromDiscord<elegantbeef> Indeed
05:05:49FromDiscord<lfanew> Like under CLR or whatever they call theirs
05:05:50FromDiscord<elegantbeef> The only confliction is if you are passing data from Nim to the C#
05:05:59FromDiscord<elegantbeef> Or vice versa
05:06:07FromDiscord<Festive> In reply to @Elegantbeef "The hell are you": I'm executing a C# executable using nimlang in memory. ↵When I do so, if the C# executable isn't 100% native and requests a DLL from somewhere, it results in that error that you saw before, from clr.nim.
05:06:10FromDiscord<elegantbeef> GC'd memory cannot be passed safely
05:06:30FromDiscord<elegantbeef> Probably an issue with incorrect paths or similar
05:06:35FromDiscord<Phil> In reply to @Elegantbeef "`newStmtList(myCode)`": From what I'm seeing, newStmtList requires me to throw in the body in an AST Form to create the NimNode.↵That's 40 lines or so of nim code, I'd really like to not have to provide them in AST Form.↵I'll see how else I can get around this
05:06:50FromDiscord<elegantbeef> What?
05:07:25FromDiscord<Festive> first time ive seen beef on discord
05:07:44FromDiscord<Phil> Back then we were talking about how stuff generated via `newCall` can't take in a body parameter that is basically a code-block the same way templates and macros can
05:08:12FromDiscord<elegantbeef> sent a code paste, see https://play.nim-lang.org/#ix=4Cpe
05:08:40FromDiscord<Festive> In reply to @elegantbeef "Probably an issue with": In the executable?
05:08:49FromDiscord<Festive> or in the nim program
05:08:54FromDiscord<elegantbeef> Probably the C# code or w/e
05:09:01FromDiscord<elegantbeef> Sounds like malware though, so stop it get some help
05:09:36FromDiscord<Festive> Im just trying to see if I can fix some code I found on github that didn't fully work
05:09:42FromDiscord<Festive> https://github.com/icyguider/Nimcrypt2
05:10:36FromDiscord<.kanaxa> In reply to @lfanew "I think the GUI": Oh, good point! Must be why Windows opens a console on running the executable
05:10:48FromDiscord<lfanew> In reply to @dowylju "Hello sorry to interrupt": quite a few strats for these kinds of things depending on your situation. i prefer zmq cause there's already a lib for it. other fun ways you can do this is shared files on filesystem, unix sockets, and more
05:11:14FromDiscord<lfanew> (edit) "In reply to @dowylju "Hello sorry to interrupt": quite a few strats for these kinds of things depending on your situation. i prefer zmq cause there's already a lib ... for" added "(https://github.com/nim-lang/nim-zmq)"
05:12:53FromDiscord<Phil> facepalm↵Now I understand why my newCall call blows up, not all my varargs are NimNodes
05:13:15FromDiscord<dowylju> I'm looking at the zmq one and it seems to use a server/client. Would this be too much, the child will always be started by the parent.
05:13:36FromDiscord<dowylju> I might misunderstand something because I'm still new to Nim
05:14:13FromDiscord<Phil> sent a long message, see http://ix.io/4Cpf
05:14:48FromDiscord<lfanew> In reply to @dowylju "I'm looking at the": Too much in what way are you thinking?
05:15:53FromDiscord<dowylju> I was thinking that just reading from stdin would be easier (faster?) than using a server style setup
05:16:54FromDiscord<dowylju> and the child process always is started from the parent, not seperately
05:17:00FromDiscord<lfanew> is this a one way, one-shot pass of data from parent to child? or will it be constant data between them?
05:17:08FromDiscord<dowylju> Constant data
05:17:26FromDiscord<elegantbeef> In reply to @isofruit "Wait a second, is": of course
05:17:30FromDiscord<elegantbeef> The nimnodes will be placed as is
05:17:50FromDiscord<lfanew> yeah i'd reach for some kinda IPC strat then. if that isn't sufficient you could look at threading models but i'm not too keen on threading in nim
05:17:59FromDiscord<lfanew> (edit) "keen" => "wise" | "wiseon ... threadingworks" added "how" | "onhowthreading ... in" added "works"
05:18:29FromDiscord<dowylju> OK, thank you
05:19:07FromDiscord<elegantbeef> It's quite odd that `inputstream` doesnt work properly
05:19:32FromDiscord<Phil> In reply to @elegantbeef "The nimnodes will be": In that case, given that at my origin macro in which I call my `seq[Parameter]` is not a NimNode:↵How do I turn it into one?↵And given that I need to iterate over the contents of `seq[Parameter]` to make a `nnkFormalParams` node, how do I unpack my `seq[Parameter]` from a NimNode once `generateAnonProc` has received it as Nimnode?
05:19:33FromDiscord<elegantbeef> Regardless how odd it'd be to use stdin like this, it should work
05:19:40FromDiscord<lfanew> if it's a pretty simple program you can approach it with a file they both use, just be careful to free the file handle is all. if one's only read then that's no biggie
05:19:46FromDiscord<elegantbeef> `seq[Parameter]` is a Nim Node
05:19:55FromDiscord<elegantbeef> if it's not `static` it's a NimNode
05:20:05FromDiscord<Phil> it`s static seq[Parameter] specifically so that it isn't
05:20:16FromDiscord<elegantbeef> Well then you need to do `newLit seq[Parameter]`
05:20:27FromDiscord<elegantbeef> sorry `newLit yourSeq`
05:20:42FromDiscord<dowylju> The use case is: to update a ASCII graphic from a child process
05:22:24FromDiscord<elegantbeef> lfanew is there a reason you sent me a friend request even though we have not spoken? 😄
05:23:05FromDiscord<lfanew> In reply to @dowylju "The use case is:": Got ya. Yeah I see what you mean like maybe child could just get stdin from parent, but they are two separate processes still and process isolation limits interaction. being the parent only grants a few cool things like sending signals and what not
05:23:18FromDiscord<lfanew> yeah i was gonna try to sell you some essential oils lol
05:23:26FromDiscord<elegantbeef> Damn I'm missing out
05:23:28FromDiscord<lfanew> no i have no idea how i did that probably scrolling past all the offtopic stuff back and forth
05:23:39FromDiscord<elegantbeef> Would be cooler if you had an MLM for me to join
05:24:03FromDiscord<lfanew> this can be the start of one at least. get two more in and you're set yourself
05:24:18FromDiscord<elegantbeef> Inverted funnel!
05:25:02FromDiscord<dowylju> I'm only having trouble getting the child to get output from the parent.
05:26:52FromDiscord<Phil> Okay the fact that macros can't turn types into static strings is becoming mildly irritating
05:27:18FromDiscord<elegantbeef> Well you know what static means right? 😄
05:27:38FromDiscord<Phil> I mean a typedesc, not a type of an instnace
05:27:41FromDiscord<Phil> (edit) "instnace" => "instance"
05:27:43FromDiscord<elegantbeef> Same thing
05:27:50FromDiscord<Festive> I think I figured out my issue
05:27:52FromDiscord<elegantbeef> A macro is only semantically checked once
05:28:01FromDiscord<Phil> Like, why is $MyType not doable statically in macros but in procs it works?
05:28:11FromDiscord<elegantbeef> Cause macros only have a single instance
05:28:21FromDiscord<Phil> so I outsource that code into a proc and I'm gucci?
05:28:38FromDiscord<Phil> no wait, can't, I accept typedescs as untyped,ugh
05:28:43FromDiscord<elegantbeef> Into another delayed macro
05:29:57FromDiscord<elegantbeef> sent a code paste, see https://play.nim-lang.org/#ix=4Cpj
05:39:30FromDiscord<elegantbeef> @Phil What's this macro actually doing though?
05:45:38*azimut quit (Ping timeout: 240 seconds)
05:48:10FromDiscord<Phil> sent a long message, see http://ix.io/4Cpr
05:48:41FromDiscord<Phil> (edit) "http://ix.io/4Cpr" => "http://ix.io/4Cps"
05:49:51FromDiscord<Phil> (edit) "http://ix.io/4Cps" => "http://ix.io/4Cpt"
05:50:30FromDiscord<Phil> The reason why the body can be identical is that I generate different assignment statements based on `specialMappingOperations` , so it's not that my code needs to access them, the user can if needed
05:51:28FromDiscord<Phil> Ugh maybe I should just drop the project, I'm sure it's doable with a DSL to generate the assignment-statements the user wants in a far more beautiful way in some manner but I'm lacking in macro experience to get there
05:54:03FromDiscord<Elegantbeef> I still just make some helper procs and standardised trait
05:54:57FromDiscord<Phil> How hard is learning to write a DSL in nim?↵Actually how do you even write one?
05:55:13FromDiscord<Elegantbeef> You take in untyped ast then emit what you want
05:56:48FromDiscord<Phil> Hmmm i have a pretty limited set of assignment operations I want to be able to make
05:56:56FromDiscord<Phil> So let me think
06:00:46FromDiscord<Phil> sent a long message, see http://ix.io/4Cpy
06:01:00FromDiscord<Phil> (edit) "http://ix.io/4Cpy" => "http://ix.io/4Cpz"
06:01:22FromDiscord<Phil> (edit) "http://ix.io/4Cpz" => "http://ix.io/4CpA"
06:01:23FromDiscord<Phil> That seems... manageable in scope
06:01:24FromDiscord<Phil> (edit) "scope" => "scope?"
06:01:29FromDiscord<Phil> (edit) "scope?" => "scope (?)"
06:01:39FromDiscord<Elegantbeef> Sure, also seems possible without an entire dsl though
06:02:08FromDiscord<Phil> I mean I tried and I got close to wanting to throw my laptop at a wall at implicit rule number 20 on how to deal with macros in macros in macros
06:07:29*ntat joined #nim
06:10:50FromDiscord<.matrixagent> if i want to suggest a feature for the nim compiler where can i do so?
06:11:12FromDiscord<.matrixagent> do i just open a bug form/request/fix (idk) on the nim compiler repo?
06:11:57FromDiscord<Elegantbeef> There is the nim-lang/rfc repo
06:12:07FromDiscord<.matrixagent> link?
06:12:09FromDiscord<Elegantbeef> But you best actually have a sensible feature and not just "I want X feature from Z language"
06:12:23FromDiscord<.matrixagent> im going to suggest a compiler flag that only omits C
06:12:52FromDiscord<Elegantbeef> You mean the one that already exists
06:12:52FromDiscord<Elegantbeef> `-c`
06:13:00FromDiscord<.matrixagent> it generates C only?
06:13:08FromDiscord<Phil> Pretty sure it does
06:13:17FromDiscord<.matrixagent> i gotta try this
06:13:18FromDiscord<lfanew> see advanced sect. https://nim-lang.org/docs/nimc.html
06:13:23FromDiscord<lfanew> all kinds of fun flags
06:13:54FromDiscord<Phil> The fastest RFC ever, from "This should exist" to "This is implemented" in -x years
06:14:00FromDiscord<.matrixagent> nope https://media.discordapp.net/attachments/371759389889003532/1137267242162192466/image.png
06:14:01FromDiscord<Phil> (edit) "-x" => "negative x"
06:14:24FromDiscord<Elegantbeef> It does
06:14:30FromDiscord<.matrixagent> wheres it at
06:14:31FromDiscord<Elegantbeef> `--nimout:./`
06:14:36FromDiscord<Elegantbeef> or `--nimCache:./`
06:14:59FromDiscord<.matrixagent> `command line(1, 2) Error: invalid command line option: '--nimout'`
06:15:15FromDiscord<Elegantbeef> rtfm
06:15:39FromDiscord<.kanaxa> Out of curiosity, why does this readline work in standard Nim:↵↵let x = readLine(stdin)↵echo "Printing: ", x
06:16:15FromDiscord<.matrixagent> sent a code paste, see https://play.nim-lang.org/#ix=4CpF
06:16:20FromDiscord<.matrixagent> so basiclly i should take the file and stick it
06:16:22FromDiscord<.kanaxa> sent a code paste, see https://play.nim-lang.org/#ix=4CpG
06:17:01FromDiscord<Phil> In reply to @.kanaxa "Out of curiosity, why": nimscript is basically all the code that nim can run at compiletime
06:17:02FromDiscord<Elegantbeef> Nimscript is a subset of Nim
06:17:12FromDiscord<Phil> and some bells and whistles added to that baseline
06:17:25FromDiscord<.kanaxa> In reply to @.kanaxa "Out of curiosity, why": I read the source, it seems to alias back to `readLine` anyway, so I don't get why NimScript doesn't allow `readLine(stdin)` https://media.discordapp.net/attachments/371759389889003532/1137268100681711646/image.png
06:18:27FromDiscord<.matrixagent> i think im just gonna compile nim from source on my switch and compile from there
06:18:33FromDiscord<.matrixagent> since thats what i wanna do anyways
06:18:51FromDiscord<Chronos [She/Her]> In reply to @.kanaxa "I read the source,": The proc there is compiled and made accessible to Nimscript specifically
06:19:02FromDiscord<Chronos [She/Her]> That's why it's a proc instead of a template for example
06:19:14FromDiscord<Elegantbeef> Nim's VM overrides some procedures
06:20:18FromDiscord<.kanaxa> Mmm, I see - so my approach and understanding is correct then, it's an entirely different proc in Nimscript(`readLineFromStdin()`) rather than the usual (`readLine(stdin)`)
06:20:30FromDiscord<.kanaxa> (edit) "Nimscript(`readLineFromStdin()`)" => "Nimscript (`readLineFromStdin()`)"
06:20:37FromDiscord<Chronos [She/Her]> Yep, I believe so
06:21:59FromDiscord<Elegantbeef> Due to the fact the nimvm cannot import C code yes
06:22:10FromDiscord<Elegantbeef> there is `libffi` which can be enabled but no compiler ships with it enabled
06:23:31FromDiscord<.matrixagent> what is .magic in nim?
06:24:05FromDiscord<Elegantbeef> Compiler implemented logic
06:24:13FromDiscord<.matrixagent> so generics?
06:24:52FromDiscord<Elegantbeef> No
06:24:53FromDiscord<Elegantbeef> Compiler implemented logic
06:25:13FromDiscord<.matrixagent> ...how does the compiler implement logic
06:25:24FromDiscord<.matrixagent> isnt its job to transpile your code to C or assembky
06:25:26FromDiscord<.matrixagent> (edit) "assembky" => "assembly"
06:25:37FromDiscord<Elegantbeef> No the compiler has specific logic for magic procedures for different backends
06:25:48FromDiscord<.matrixagent> weird
06:25:58FromDiscord<griffith1deadly> sent a code paste, see https://play.nim-lang.org/#ix=4CpI
06:26:03FromDiscord<Elegantbeef> Nim is not a transpiler it's an entire language that uses C as an IR
06:26:15FromDiscord<griffith1deadly> (edit) "sent" => "What is the best way to organize sharing of ``ref object`` between threads? ↵the idea is as follows ↵main logical thread creates" | "code paste, see https://play.nim-lang.org/#ix=4CpI" => "packet (network) -> network thread -> some logic↵what is the path without using a channel?"
06:26:20FromDiscord<.matrixagent> https://en.wikipedia.org/wiki/Nim_(programming_language)#:~:text=Nim%20was%20created%20to%20be,macros%20and%20term%20rewriting%20macros.
06:26:28FromDiscord<.matrixagent> and also somone might want to edit the nim wikipedia page
06:26:41FromDiscord<.matrixagent> sent a code paste, see https://play.nim-lang.org/#ix=4CpJ
06:27:12FromDiscord<Elegantbeef> Don't have cycles and pass them as `sink` griffith
06:28:04FromDiscord<.matrixagent> fixed the wiki
06:28:12FromDiscord<Phil> (https://nim-lang.org/docs/destructors.html#move-semantics in case docs are needed)
06:28:43FromDiscord<griffith1deadly> In reply to @Elegantbeef "Don't have cycles and": What if we have cycles?
06:28:51FromDiscord<Elegantbeef> Don't
06:29:09FromDiscord<Elegantbeef> Or keep the data in a global variable/seq
06:29:18FromDiscord<Phil> With a lock?
06:29:30FromDiscord<_gumbercules> I still wonder if Nimskull is going to do something like: https://www.more-magic.net/posts/internals-gc.html for their GC
06:29:41FromDiscord<_gumbercules> and ditch the arc/orc stuff
06:29:53FromDiscord<_gumbercules> I have no idea what's going on with that project anymore
06:29:56FromDiscord<_gumbercules> and haven't for a while...
06:30:00FromDiscord<Elegantbeef> I doubt it
06:30:40FromDiscord<griffith1deadly> In reply to @Elegantbeef "Or keep the data": global seq require using lock's↵what way without locks?
06:31:12FromDiscord<Elegantbeef> There is no way to share cyclical types in a sane way across threads unless you disarm destructors
06:32:04FromDiscord<_gumbercules> just `allocShared`? and use atomics / locks?
06:32:07FromDiscord<_gumbercules> or is that not sane?
06:33:35FromDiscord<_gumbercules> In reply to @Elegantbeef "I doubt it": yeah I'm pretty sure cheney on the MTA still requires thread local heaps
06:33:48FromDiscord<griffith1deadly> In reply to @_gumbercules "just `allocShared`? and use": as i recall, allocShared seq and use it between thread's cause crash↵i think it need lock for normal working↵what the way without locks?
06:33:50FromDiscord<_gumbercules> which is one reason Chicken doesn't support hardware threads
06:34:24FromDiscord<_gumbercules> In reply to @griffith1deadly "as i recall, allocShared": I don't know how you share memory between threads without synchronizing access
06:34:47FromDiscord<_gumbercules> If you don't need to access the memory on the thread you're calling from, you can move it
06:35:44FromDiscord<Elegantbeef> And in that case you should just use nim-lang/threading's channels
06:35:47FromDiscord<_gumbercules> But assuming multiple threads need access to the memory, I'm not aware of any other way than using locks / atomics. And if you're using locks and atomics I wouldn't use seq
06:35:54FromDiscord<griffith1deadly> In reply to @_gumbercules "If you don't need": I think I need this.↵The idea is that the main thread just creates the object, and another thread interacts with the object
06:36:06FromDiscord<Elegantbeef> So then why can the other thread not own the object?
06:36:10FromDiscord<_gumbercules> In reply to @griffith1deadly "I think I need": Yea then just move it to the other thread
06:36:29FromDiscord<_gumbercules> I believe the procedure is literally called `move`
06:36:35FromDiscord<Elegantbeef> Either use `std/isolation` or nim-lang/channels to do it
06:36:46FromDiscord<_gumbercules> or just use locks and atomics 😉
06:37:03FromDiscord<Elegantbeef> `ensureMove` is more like it gumber 😄
06:37:12FromDiscord<griffith1deadly> In reply to @Elegantbeef "Either use `std/isolation` or": channel's just deepCopy object, not?
06:37:14FromDiscord<Elegantbeef> Don't want an implicit copy
06:37:19FromDiscord<_gumbercules> channels == message passing
06:37:21FromDiscord<Elegantbeef> Not nim-lang/threading's
06:37:44FromDiscord<_gumbercules> and incur the overhead
06:38:05FromDiscord<_gumbercules> are you avoiding locks out of complexity?
06:38:14FromDiscord<Elegantbeef> threading's channels use `isolated` data which means the data is a closed cycle and safe to move
06:38:29FromDiscord<griffith1deadly> In reply to @_gumbercules "are you avoiding locks": yes
06:38:37FromDiscord<_gumbercules> couldn't you just `createThread` and then `ensureMove` the argument?
06:38:41FromDiscord<Elegantbeef> Just pass the data using isolated
06:39:04FromDiscord<Elegantbeef> Assuming isolated works I guess 😄
06:39:09FromDiscord<_gumbercules> In reply to @griffith1deadly "yes": yeah - I mean if you don't need the calling thread or any other thread besides the one you're passing the data to, to access that memory you're golden
06:39:14FromDiscord<_gumbercules> In reply to @Elegantbeef "Assuming isolated works I": bingo
06:39:43FromDiscord<Elegantbeef> Isolation is a bit better than just moving since the compiler ensures the data is an isolated graph
06:39:51FromDiscord<_gumbercules> but I've written a lot of multithreaded code and my advice is once you enter this arena the more you understand about concurrency and synchronization the better off you'll be
06:40:04FromDiscord<_gumbercules> at the end of the day you have tools like asan, valgrind, leak detectors etc
06:40:11FromDiscord<Elegantbeef> But given I do not multithread, i've not used isolated so have 0 clue how ineffective it is
06:40:22FromDiscord<_gumbercules> sure there is a ton of nuance and there are many rabbit holes
06:41:15FromDiscord<_gumbercules> but I also think you'll learn a lot by diving in the deep end - if your goal is to learn. if your'e trying to build something for production by all means do what's safest
06:41:44FromDiscord<user2m> sent a code paste, see https://play.nim-lang.org/#ix=4CpP
06:42:11FromDiscord<Elegantbeef> are you in a WSL?
06:42:38FromDiscord<_gumbercules> They shouldn't need to be
06:42:55FromDiscord<Elegantbeef> Right but it might detect linux and attempt to call gcc directly
06:42:58FromDiscord<_gumbercules> Is the MINGW / MSYS2 bin directory on your path?
06:43:06FromDiscord<Elegantbeef> No clue if mingw installs as gcc on windows
06:43:13FromDiscord<_gumbercules> it looks like it couldn't find `gcc.exe`
06:43:15FromDiscord<_gumbercules> it does
06:43:28FromDiscord<Elegantbeef> Right then path it is 😄
06:43:47FromDiscord<_gumbercules> https://media.discordapp.net/attachments/371759389889003532/1137274739149258772/image.png
06:44:21FromDiscord<Phil> Is there a proc or something that prints me the entire tree that is contained in a specific NimNode?
06:44:29FromDiscord<_gumbercules> `treeRepr`?
06:44:30FromDiscord<Elegantbeef> `treeRepr`
06:44:41FromDiscord<Phil> Perfect!
06:46:29FromDiscord<Elegantbeef> Eons ago I did make a small nimscripter example to make macros a bit more interactive https://streamable.com/6m5ww1
06:47:01FromDiscord<Elegantbeef> No clue if that's something you'd be interested in using, but https://github.com/beef331/nimscripter/tree/master/examples/macrorepl it's here
06:47:57FromDiscord<Phil> I'll keep it in a tab for now, I'm basically slowly making progress towards getting to a workflow of actually writing macros without wanting to bang my head against a wall
06:48:04FromDiscord<Phil> Once I have that done I'm looking for better tooling
06:48:36FromDiscord<Elegantbeef> `repr` and `treeRepr` are just the easiest though
06:50:40FromDiscord<Elegantbeef> griffith https://forum.nim-lang.org/t/10161#67262 here's reference btw
06:50:46FromDiscord<Phil> I'm liking astGenRepr so far for it gives me the macro-code that I can use directly and so helps with making the association of "this macro-code maps to this piece of generated nim code"
06:50:59FromDiscord<Elegantbeef> Ugh
06:51:10FromDiscord<Elegantbeef> Just use `genast` or `quote do` instead
06:51:15FromDiscord<Elegantbeef> It's 10000% more maintainable
06:51:37FromDiscord<Phil> I was about to write myself procs that generate the astGen for a given expression and just call those
06:51:59FromDiscord<griffith1deadly> In reply to @Elegantbeef "griffith https://forum.nim-lang.org/t/10161#67262 h": thanks
06:52:24FromDiscord<Elegantbeef> it does use channels but that bit can be changed for a `Thread[Isolated[T]]`
06:52:41FromDiscord<.kanaxa> Nim site seems down currently? https://media.discordapp.net/attachments/371759389889003532/1137276976835592262/image.png
06:54:44FromDiscord<lfanew> I don't think so, just that page. How'd you arrive to that link?
06:54:51FromDiscord<.kanaxa> Straight up from Google
06:55:11FromDiscord<.matrixagent> In reply to @.kanaxa "Nim site seems down": same for me
06:55:26FromDiscord<.matrixagent> @.kanaxa https://nim-lang.org/1.4.0/io.html
06:55:27FromDiscord<.matrixagent> works for me
06:55:28FromDiscord<Elegantbeef> `io` is no longer a module
06:55:30FromDiscord<lfanew> it's probably just not available on latest (2.0) try https://nim-lang.org/1.6.14/io.html
06:55:49FromDiscord<.kanaxa> In reply to @lfanew "it's probably just not": Ah, makes sense - yeah the 1.6 is working for me
06:56:11FromDiscord<Elegantbeef> https://nim-lang.org/docs/theindex.html all modules are documented here
06:56:24FromDiscord<.kanaxa> In reply to @Elegantbeef "https://nim-lang.org/docs/theindex.html *all* modul": Thanks! Haven't seen this one yet
06:56:42FromDiscord<.kanaxa> As a beginner like me coming to Nim it's quite overwhelming
06:57:08FromDiscord<.kanaxa> Features are often available, but documented in patches and strewn everywhere
06:57:34FromDiscord<.kanaxa> We really need a cookbook of sorts
06:58:15FromDiscord<.kanaxa> If I have time later this year I might get around doing it - could be a boon as well, since I'm an outsider coming in, so I have an outsider's perspective of the difficult of Nim for a beginner
06:58:46FromDiscord<.kanaxa> (edit) "difficult" => "difficulty"
06:58:59FromDiscord<user2m> In reply to @_gumbercules "it looks like it": yup that was it! I had to add the bin to PATH then restart
06:59:10FromDiscord<_gumbercules> \o/
07:00:38FromDiscord<lfanew> In reply to @.kanaxa "As a beginner like": A bit rough on timing here too as Nim has grown a bit. I think Araq said he'll start working on a 2nd edition of his book if not started already which will have 2.0 as the base version at least
07:00:51FromDiscord<lfanew> (edit) "grown" => "changed" | "bit." => "bit past month or so ."
07:02:25FromDiscord<.kanaxa> In reply to @Elegantbeef "`io` is no longer": Wow, the std filesystem-ops modules have really been revised https://media.discordapp.net/attachments/371759389889003532/1137279421351477288/image.png
07:13:15*cestmoi joined #nim
07:14:31FromDiscord<Phil> In reply to @.kanaxa "We really need a": TBH in lieu of the time/motivation to write an entire one of those I've gone to the far easier variant and write self-answered Stack Overflow Questions
07:15:57FromDiscord<.kanaxa> Without a cookbook though, institutional and valuable Nim knowledge gets buried, especially for the day-to-day things
07:16:32*rockcavera quit (Remote host closed the connection)
07:18:51FromDiscord<Phil> I believe in the power of googling Stack Overflow more than a cookbook.↵Like I don't disagree with you, I'm more telling the story from my perspective and the solutions that I see with the resources I have available
07:19:40FromDiscord<Phil> (edit) "cookbook.↵Like" => "cookbook (in terms of what time and brainspace I can invest).↵Like"
07:22:26FromDiscord<Elegantbeef> Maybe one day I'll start to formalise the stuffs I know
07:26:12FromDiscord<.matrixagent> whats the recommended nim gui lib
07:28:34FromDiscord<.kanaxa> In reply to @isofruit "I believe in the": Fair point
07:29:44FromDiscord<Phil> In reply to @.kanaxa "Fair point": Case in point, I'm writing an SO quesiton about what I just learned from beef with echo someNimNode.treeRepr↵I could write a cookbook, but that would take more time than I have available, particularly since this is more a side-product of my research into how to do nim metaprogramming
07:30:57FromDiscord<.kanaxa> Y'all heard about the SO usage dropping thingy?
07:31:10FromDiscord<Phil> Yep
07:31:10FromDiscord<.kanaxa> Something about its traffic or user numbers going down
07:31:26FromDiscord<.kanaxa> That makes me wonder a bit
07:31:34FromDiscord<.kanaxa> How it'd got to that level, and whether it's a sustainable thing in the long run
07:31:44FromDiscord<Phil> Me too, however I still regard it as a resource of most importantly accurate information
07:32:05FromDiscord<Phil> (edit) "information" => "information, that's why I'd still use it rather than e.g. writing a blog-post or sth"
07:32:44FromDiscord<Phil> In reply to @.kanaxa "How it'd got to": AI is eating away at the simpler "How do I solve this minor syntax-problem" userbase I'd say
07:33:15FromDiscord<.matrixagent> In reply to @.kanaxa "Y'all heard about the": if their community wasnt so bad
07:33:21FromDiscord<.matrixagent> maybe it wouldnt have droppeds
07:33:23FromDiscord<.matrixagent> (edit) "droppeds" => "dropped"
07:36:44FromDiscord<.kanaxa> This is going to sound crazy: but where is the stdlib module for `readfile()`? I can't find it - since `io` is already deprecated
07:37:01FromDiscord<Elegantbeef> https://nim-lang.org/docs/syncio.html#readFile%2Cstring
07:44:35FromDiscord<Phil> Self answered question incoming
07:45:16NimEventerNew question by Philipp Doerner: How can I see the contents of a NimNode?, see https://stackoverflow.com/questions/76840619/how-can-i-see-the-contents-of-a-nimnode
07:48:51FromDiscord<Phil> Out of curiosity, is there anyone out there that actually uses lisprepr?
07:49:33FromDiscord<Phil> I entirely acknowledge that I'm ignorant on the entire lisp-side of programming
07:52:47FromDiscord<jaar23> i wonder does nim has `byte` type like `[u8]`, `u8[]` ?
07:53:28FromDiscord<Elegantbeef> If you want to elaborate what those do perhaps
07:58:46FromDiscord<jaar23> sent a code paste, see https://play.nim-lang.org/#ix=4Cqb
07:59:10FromDiscord<jaar23> wondering if that is a different representation in nim?
07:59:29FromDiscord<Elegantbeef> `@myStr.toOpenArrayByte(0, myStr.high)`
08:01:30*ajunior quit (Quit: My MacBook Pro has gone to sleep. ZZZzzz…)
08:02:08FromDiscord<jaar23> why can i find more about `toOpenArrayByte()` proc?
08:02:23FromDiscord<Elegantbeef> https://nim-lang.org/docs/theindex.html#toOpenArray
08:02:55FromDiscord<bulan2> dkl ccb p
08:06:08FromDiscord<jaar23> how about converting `openArray[byte]` to string? ↵simply `$openArrayByte` ?
08:06:20FromDiscord<Elegantbeef> Nope
08:06:26FromDiscord<Elegantbeef> `$` would just stringify it
08:06:45FromDiscord<Elegantbeef> Which means `[0, 2, 3, ...]` or whatever
08:07:19FromDiscord<Elegantbeef> There is not a easy way to convert back afaik
08:09:40FromDiscord<jaar23> i see, not a easy way. i assume there is, right? 😆
08:10:23FromDiscord<jaar23> i'm going to read the byte array from network and reading it in string (if parseable) then write it back to the network again.
08:11:19FromDiscord<Elegantbeef> Why not just read it as a string?
08:11:26FromDiscord<Phil> As somebody that basically never deals with bytes:↵convert to chat and collect those into a seq[char] and convert that to string?
08:11:34FromDiscord<Phil> (edit) "As somebody that basically never deals with bytes:↵convert ... toa" added "each byte" | "chat" => "a char"
08:11:41FromDiscord<Elegantbeef> Nim strings unlike Rust strings are not unicode, and are not immutable
08:11:45FromDiscord<Elegantbeef> Bleh phil
08:11:55FromDiscord<Phil> Nobody said it had to be fast!
08:12:41FromDiscord<Phil> Wait that would assume that it's ASCII encoded errrrrr
08:12:42FromDiscord<Elegantbeef> sent a code paste, see https://paste.rs/rmtvE
08:12:59FromDiscord<Phil> Oh... wait how is that not an easy way beef?
08:13:13FromDiscord<Elegantbeef> No it doesnt
08:13:14FromDiscord<Elegantbeef> It's not in the stdlib, doesnt work on js or nimscript
08:13:27FromDiscord<Phil> In reply to @Elegantbeef "No it doesnt": I meant my approach would assume that
08:13:34FromDiscord<Elegantbeef> No it doesnt
08:13:50FromDiscord<Elegantbeef> Your operation is not encoding aware
08:14:03FromDiscord<Phil> Actually, fair
08:14:04FromDiscord<Elegantbeef> It works on utf8 utf16 utf32 ascii
08:14:22FromDiscord<jaar23> In reply to @Elegantbeef "Why not just read": can we?
08:14:36FromDiscord<Elegantbeef> It's just data `0..255` Byte is the same as `\0..\255`
08:14:39FromDiscord<Elegantbeef> Yes you can read strings
08:14:42FromDiscord<Phil> God I deal with this kind of stuff so rarely I read up on it like once a year when I need it and forget immediately after
08:14:44FromDiscord<Elegantbeef> Nim's api's generally prefer strings
08:15:44FromDiscord<Elegantbeef> https://nim-lang.org/docs/net.html#recv%2CSocket%2Cstring%2Cint%2Cint jaar
08:17:08FromDiscord<jaar23> oh wait, in nim we can directly read that network data into string?
08:17:24FromDiscord<Elegantbeef> Wild I know
08:17:25FromDiscord<Elegantbeef> There is even a low level `read` that takes a `pointer`
08:17:33FromDiscord<Elegantbeef> So you could write to anything you really wanted
08:18:13FromDiscord<Elegantbeef> This is the perks of not using string builders or utf8 aware strings
08:18:16FromDiscord<Elegantbeef> It's cheap to do all of this fun stuff
08:18:30FromDiscord<Elegantbeef> And with that I go
08:19:11FromDiscord<jaar23> okay, that really surprise me. As a user coming from java and rust, i always have to do the conversion after reading from network.
08:19:24FromDiscord<jaar23> i assume that is the default 😆
08:20:19*lfanew left #nim (#nim)
08:20:20FromDiscord<Phil> I just imagine beef following the classic "my job here is done" meme
08:20:34FromDiscord<Phil> (edit) "I just imagine beef following the classic "my job here is done" meme ... " added "and willowing his cape"
08:21:01FromDiscord<jaar23> i can imagine that.
08:21:05FromDiscord<Phil> (edit) "willowing" => "billowing"
08:33:50FromDiscord<.kanaxa> In reply to @Elegantbeef "`$` would just stringify": When I first came to Nim I found it insanely cool that the string-casting operator was the `$` sign - and string concatenation was `&` instead of `+` (which threw me off a bit)
08:34:15FromDiscord<.kanaxa> Instead of having to `str()` or `.toStr()` something
08:34:26FromDiscord<.kanaxa> And then I discovered Nim's operator overloading and I was like blown away
08:34:44FromDiscord<.kanaxa> And I was completely misled by ChatGPT when I asked it questions on those things, because it was hallucinating between languages haha
08:36:04FromDiscord<.kanaxa> Another thing that threw me off was `[]` vs `@[]` - because there's no fixed-sized lists in Python, and I was like... wait, what, why do you need an array and a sequence, when in Python a list is a sequence
08:36:12FromDiscord<.kanaxa> That cognitive dissonance
08:39:03FromDiscord<Phil> Okay I have arrived at the point where I'm realizing that a ton of the compiletime stuff I have done so far was way more complicated than literally just using macros
08:39:14FromDiscord<Phil> Like holy shit did I stretch the concept of generics and templates to its absolute limits
08:39:28FromDiscord<jensl> hey, does anyone here use a nim lsp in nvim?
08:39:53FromDiscord<Phil> There are a couple folks here but I keep forgetting who all does. I think PMunch is one of the guys that does
08:40:14FromDiscord<jensl> imma have to know how he did it
08:40:25FromDiscord<Phil> (That name mention should be enough to ping him given he uses matrix, we'll have to wait for him to come online or somebody else to step up)
08:40:53FromDiscord<jensl> bc mine says it's on but it's not completing sht
08:41:46FromDiscord<jensl> but maybe I'm dumb bc nvim doesn't even highlight my nim syntax
08:42:19FromDiscord<Phil> Hmmm PMunch stated he was pretty happy with nim highlighting etc. if I recall correctly, so definitely fixable
08:44:43FromDiscord<Phil> Hmmm how do I get all fields an object-type has if all I have is the NimNode `ident("MyType")` ?
08:45:04FromDiscord<Phil> (edit) "Hmmm how do I get all fields an object-type ... has`ident("MyObjectType")`" added "`MyObjectType`" | "`ident("MyType")`" => "`ident("MyObjectType")`"
08:48:07FromDiscord<Phil> Wait, maybe getImpl
08:58:14FromDiscord<jaar23> In reply to @.kanaxa "And I was completely": chatgpt cannot understand nim correctly. lol
08:59:25FromDiscord<Phil> In reply to @.kanaxa "And then I discovered": Keep in mind that particularly operator overloading can be an amazingly effective footgun
09:00:41FromDiscord<jaar23> In reply to @jensl "hey, does anyone here": i have been struggling abit over this too. ↵i tried multiple neovim distro, lazy, nvim-chad, doom, etc, none of them successfully setup with nim.
09:00:46FromDiscord<Phil> In reply to @.kanaxa "Another thing that threw": And yeah, fixed-length array (on the stack) vs mutable-length seq (on the heap) can be a bit of a thing to wrap your head around.↵Though I started in java so I guess I had a bit of a head start on that one
09:01:21FromDiscord<jaar23> until i found oh-my-nvim, and setup according to this, https://github.com/alaviss/nim.nvim and https://github.com/hardhackerlabs/oh-my-nvim
09:01:41FromDiscord<jaar23> then it is finally working on my nvim :nim4:
09:04:40FromDiscord<jaar23> not to mention, raw neovim with that setup would works too.
09:18:36NimEventerNew thread by Odysseus: A few (perhaps naive) questions, see https://forum.nim-lang.org/t/10377
09:30:36FromDiscord<Phil> Okay so I feel like `getImpl` is the way to get the definition of a type from its string representation.↵I just don't get how
09:31:17FromDiscord<Phil> Like, I have the NimNode of this proc definition:↵` proc myMapProc(source: A, target: B): string =`↵How do I figure out which fields B has ?
09:31:56FromDiscord<Phil> (edit) "Like, I have the NimNode of this proc definition:↵` proc myMapProc(source: A, target: B): string =`↵How do I figure out which fields B has ?" => "sent a long message, see http://ix.io/4CqS"
09:33:43FromDiscord<.kanaxa> In reply to @isofruit "Keep in mind that": Indeed - though a footgun is still a nice thing to have, used responsibly
09:33:46*qwestion quit (Ping timeout: 245 seconds)
09:33:56FromDiscord<.kanaxa> I just built my first Nimscript file to replace an earlier Bash script for running tmux
09:34:01FromDiscord<.kanaxa> OMG THIS IS AMAZINGBALLS
09:34:16FromDiscord<Phil> That was how I felt with replacing like a dozen of them with nimble tasks
09:34:23FromDiscord<.kanaxa> I could have done this in Python but it's so much clearer in Nim since I don't have to reference any modules
09:34:31FromDiscord<.kanaxa> And everything's just `exec`
09:34:40FromDiscord<.kanaxa> And my functions actually make sense now compared to Bash
09:50:39FromDiscord<.kanaxa> sent a code paste, see https://play.nim-lang.org/#ix=4Cr1
09:52:39FromDiscord<.kanaxa> Is there an idiomatic way to do this in Nim?
09:54:25FromDiscord<Phil> I haven't checked gorgeEx, but are you sure the exit code isn't simply accessible as part of whatever exception gorgeEx throws if it fails?
09:56:47FromDiscord<Phil> In reply to @.kanaxa "Okay I'm in a": I don't think you'll get an exception, I think your exit code will simply be of a value that represents "an error ocurred"
09:57:19FromDiscord<Phil> I'd need to check what the exit_code conventions were to tell you which value represents a success and which represent common failure types
09:57:26FromDiscord<Phil> (edit) "I'd need to check what the exit_code conventions ... were" added "in bash"
09:57:31FromDiscord<.kanaxa> Hmm, you have a point on the exit code
09:57:56FromDiscord<.kanaxa> Still, assuming that an exception was raised, how to do I get the exception message?
09:58:07NimEventerNew question by Philipp Doerner: How to get all fields of an object type `MyType` in a macro from a NimNode ident(&quot;MyType&quot;), see https://stackoverflow.com/questions/76841073/how-to-get-all-fields-of-an-object-type-mytype-in-a-macro-from-a-nimnode-ident
09:58:14FromDiscord<.kanaxa> I tried ` echo "Didn't run: ", getCurrentException() ` but it didn't work
09:58:30FromDiscord<.kanaxa> (edit) "I tried ` echo "Didn't run: ", getCurrentException() ` ... but" added "in the `except` clause,"
10:00:36FromDiscord<Phil> sent a code paste, see https://play.nim-lang.org/#ix=4Crb
10:00:45FromDiscord<Phil> blank except is discouraged generally
10:01:02FromDiscord<Phil> And also "didn't work" doesn't tell me how it didn't work 😛
10:01:19FromDiscord<Phil> As I still don't know if gorgeEx actually throws exceptions
10:01:22FromDiscord<.kanaxa> In reply to @isofruit "blank except is discouraged": True, but I'm accessing the https://nim-lang.org/docs/tut2.html↵↵It says here: _"...If you need to access the actual exception object or message inside an except branch you can use the getCurrentException() and getCurrentExceptionMsg() procs from the system module. Example:"_
10:01:29FromDiscord<.kanaxa> So I'm wondering how I can get to that exception message
10:02:18FromDiscord<.kanaxa> I've been testing out something like `discard 1/0` which should raise a DividebyZero error of sorts
10:02:27FromDiscord<.kanaxa> But it doesn't raise anything, and I can't get to the exception
10:03:00FromDiscord<.kanaxa> sent a code paste, see https://play.nim-lang.org/#ix=4Crd
10:03:41FromDiscord<Phil> ?↵Okay, give me your current nim version and how you compile that
10:03:45FromDiscord<Phil> Because that runs for me
10:03:58FromDiscord<.kanaxa> I'm on Nim 2.0.0
10:04:18FromDiscord<Phil> hmmm
10:04:27FromDiscord<Phil> For reference:↵https://play.nim-lang.org/#ix=4Cre↵↵Works on play nim lang
10:05:26FromDiscord<.kanaxa> Yeah it's really weird, when I removed all reference to `getCurrentExceptionMsg()`, the code works
10:05:30FromDiscord<Phil> Lul, no 1/0 does not raise an exception
10:05:31FromDiscord<.kanaxa> So I'm not sure why
10:06:01FromDiscord<.kanaxa> In reply to @isofruit "Lul, no 1/0 does": There's no `ZeroDivisionError` exception in Nim?
10:06:02FromDiscord<Phil> 1/0 is a float with a value of "inf"
10:06:02FromDiscord<.kanaxa> Dang
10:07:12FromDiscord<Phil> sent a code paste, see https://play.nim-lang.org/#ix=4Crf
10:08:03FromDiscord<.kanaxa> Running that exactly https://media.discordapp.net/attachments/371759389889003532/1137326143394029568/image.png
10:08:12FromDiscord<.kanaxa> But still getting this: _"...Error: undeclared identifier: 'getCurrentExceptionMsg' candidates (edit distance, scope distance); see '--spellSuggest': (3, 4): 'getCurrentException'"_
10:08:13FromDiscord<.kanaxa> Hmmmm
10:08:24FromDiscord<Phil> Ignore nimsuggest for a second, is that your terminal output after compiling?
10:08:30FromDiscord<.kanaxa> yeah
10:08:45FromDiscord<Phil> What is the entire code you're running?
10:08:48FromDiscord<.kanaxa> Is there some module I'm not importing for the identifier
10:09:08FromDiscord<Phil> I compiled my example without any imports whatsoever so that yours doesn't work is weird as heck
10:09:18FromDiscord<.kanaxa> In reply to @isofruit "What is the entire": OH WAIT
10:09:19FromDiscord<.kanaxa> What the hell
10:09:25FromDiscord<.kanaxa> I ran that in a Nimscript file
10:09:27FromDiscord<.kanaxa> No wonder
10:09:32FromDiscord<.kanaxa> The identifier's valid in a full Nim script
10:09:40FromDiscord<.kanaxa> Dammit
10:09:41FromDiscord<Phil> Well that clears that up 😄
10:09:49FromDiscord<.kanaxa> Argh, this is the confusion I got into just now
10:09:49FromDiscord<.kanaxa> Hahahaha
10:09:56FromDiscord<.kanaxa> Thanks for the pointers!
10:10:16FromDiscord<Phil> Sidenote, stuff like this is why I basically have all my nimscript code squeezed into my nimble file
10:10:26FromDiscord<Phil> No chance of mixing things up
10:10:33FromDiscord<.kanaxa> Mmmm, good point
10:10:39FromDiscord<Phil> And even with like a dozen tasks that thing is still less than 200 loc
10:10:47FromDiscord<.kanaxa> I'm actually trying to use Nimscript for automation and as a Bash replacement for now, not doing any packaging just yet with Nimble
10:10:55FromDiscord<Phil> Ahh check
10:11:23FromDiscord<.kanaxa> That being said though, on the earlier example
10:14:55FromDiscord<Phil> sent a code paste, see https://play.nim-lang.org/#ix=4Cri
10:15:07NimEventerNew thread by mohan24: Why this nim code is not valid?, see https://forum.nim-lang.org/t/10378
10:15:42FromDiscord<Phil> (edit) "https://play.nim-lang.org/#ix=4Cri" => "https://paste.rs/IAB2B"
10:22:03*disso-peach joined #nim
10:28:38FromDiscord<Phil> Heya enthus1ast, if you're there, could you check out my macro question here: https://stackoverflow.com/questions/76841073/how-to-get-all-fields-of-an-object-type-mytype-in-a-macro-from-a-nimnode-ident ?↵↵Trying to wrap my head around how to solve this and I'm not finding anything obvious in std/macros, thought maybe you stumbled over something for this
10:29:01FromDiscord<Phil> (edit) "stumbled over something for this" => "are familiar with an obvious solution"
10:29:16FromDiscord<.kanaxa> In reply to @isofruit "Heya enthus1ast, if you're": I wish I could help, but this is so far beyond me at this level
10:30:00FromDiscord<Phil> I mean, it took me ~18 months in nim to get comfortable enough in the language to properly approach macros
10:30:04FromDiscord<Phil> So no worries, I won't judge ^^
10:33:02FromDiscord<jensl> In reply to @jaar23 "i have been struggling": im using lazyvim and just tried installing both `nimlsp` and `nimlangserver` using Mason
10:33:14FromDiscord<jensl> but simple doing that apparently isn't enough
10:34:21FromDiscord<jaar23> In reply to @jensl "im using lazyvim and": Yes, I tried both too. But keep having error whenever loading Nim file. After I switch to oh-my-nvim then it works.
10:34:54FromDiscord<jaar23> I think there may be conflict or need extra setup on lazyvim
10:35:47FromDiscord<jensl> that's what I was thinking, but given they include it in the list of LSPs for you that seems silly
10:36:44FromDiscord<jensl> In reply to @jaar23 "I think there may": did you get syntax highlighting on lazyvim?
10:39:24FromDiscord<jaar23> In reply to @jensl "did you get syntax": Not always. On first load, the syntax is working. After some editing, the syntax highlight go haywire.
10:39:46FromDiscord<jensl> https://media.discordapp.net/attachments/371759389889003532/1137334123657179156/image.png
10:39:49FromDiscord<jensl> it gives me lsp info
10:39:50FromDiscord<jaar23> I guess there is no treesitter for nim too
10:40:01FromDiscord<jensl> but I get zero highlights lmao
10:40:42FromDiscord<jaar23> Have you change your theme with treesitter support? I'm using sonokai and it has the highlight
10:40:51FromDiscord<jensl> maybe it's the theme
10:40:55FromDiscord<jensl> im using kanagawa
10:44:06FromDiscord<shalokshalom> In reply to @jaar23 "I guess there is": One at least started an implementation
10:44:28FromDiscord<shalokshalom> I know about about the generation to treesitter files from other formats
10:44:51FromDiscord<shalokshalom> The indendation based stuff is usually not possible to port that way, so it's a petty for Nim
10:51:01FromDiscord<jensl> I changed the theme to gruvbox
10:51:04FromDiscord<jensl> didn't help
10:51:05FromDiscord<jensl> https://media.discordapp.net/attachments/371759389889003532/1137336972210339932/image.png
10:51:15FromDiscord<jensl> https://media.discordapp.net/attachments/371759389889003532/1137337012811206687/image.png
11:07:50FromDiscord<jaar23> In reply to @jensl "I changed the theme": I'm struggling for quite some times too. Until I changed the nvim distro. ↵Or you can try helix.
11:13:16FromDiscord<jensl> I love my lazyvim so I'll do my best
11:13:39FromDiscord<jensl> do I need to manually install `nimsuggest` using nimble?
11:16:41FromDiscord<Phil> nimsuggest is part of the compiler IIRC so it shouldn't be necessary, at most the language server might need an install
11:16:46NimEventerNew thread by Isofruit: How to get all fields of an object type `MyType` in a macro from a NimNode ident("MyType"), see https://forum.nim-lang.org/t/10379
11:17:11FromDiscord<jensl> In reply to @isofruit "nimsuggest is part of": that's what I thought
11:17:16FromDiscord<jensl> I have done `nimble install nimlsp`
11:18:40Amun-Raright, nimble search nimsuggest returns two options
11:22:48NimEventerNew thread by IvanS: Autome import throws error, see https://forum.nim-lang.org/t/10381
12:38:12*jmdaemon quit (Ping timeout: 240 seconds)
12:51:54*cestmoi quit (Ping timeout: 252 seconds)
13:59:46*psydruid quit (Write error: Connection reset by peer)
14:01:51FromDiscord<Phil> Okay I think I finally had my "it clicks" moment with macros, hot damn
14:01:59FromDiscord<Phil> Only took forever
14:02:51*rockcavera joined #nim
14:35:32*xet7 joined #nim
14:58:41NimEventerNew post on r/nim by NotMattA: Just got into Nim and played around with the macro system to copy over a feature I enjoyed in Zig: labelled/named loops, see https://reddit.com/r/nim/comments/15ixtkv/just_got_into_nim_and_played_around_with_the/
14:59:03FromDiscord<x.hat> Just got into Nim this weekend- I just played around with the macro system to copy over a feature I enjoyed in Zig called labelled/named loops: https://gist.github.com/MattAlp/ca24060733e1142ac4823179d69cedf9
14:59:18FromDiscord<x.hat> Oh, looks like the bot beat me to it haha
14:59:29FromDiscord<x.hat> Really enjoying the language so far!
15:20:48*ajunior joined #nim
15:30:33*azimut joined #nim
15:31:11*junaid_ joined #nim
16:04:09FromDiscord<tapeda> sent a code paste, see https://play.nim-lang.org/#ix=4Cta
16:05:58FromDiscord<Phil> Generally that's also the best idea to go about it:↵Use macros basically only as a last resort when all else fails you.
16:07:58*azimut quit (Ping timeout: 240 seconds)
16:16:21FromDiscord<shalokshalom> what was the code generation method, that is supposed to be used before one thinks about templates, again?
16:16:52FromDiscord<shalokshalom> I think it was like x -> Templates -> Macros
16:19:37FromDiscord<.kanaxa> In reply to @isofruit "Okay I think I": I love the clicky moments man, it's that feeling of epiphany
16:21:16ehmryis there a rule on when to use std/macros and when to use compiler/* modules?
16:21:23FromDiscord<demotomohiro> In reply to @x.hat "Just got into Nim": I also wrote namedWhile macro before.↵https://github.com/demotomohiro/littlesugar/blob/main/src/littlesugar/namedWhile.nim
16:21:45ehmryI have code that uses the compiler package and I forget exactly why I was using it
16:25:19FromDiscord<demotomohiro> You use std/macros when you write macros.↵Which module in compiler/ do you use?
16:28:35ehmrydemotomohiro: ast, idents, renderer, lineinfos
16:29:40ehmrywith 2.0.0 I get partial code rendering so I think I should go back to std/macros
16:29:59ehmryI'm not macro'ing, I'm generating code from scratch
16:31:05FromDiscord<demotomohiro> I guess you tried to get lower level AST info that macro module cannot?
16:31:17ehmrymust have been
16:31:55ehmryif I need something from compiler in macros is it reasonable to port it over and make a PR?
16:31:58*ajunior quit (Ping timeout: 246 seconds)
16:36:14FromDiscord<requiresupport> any idea why cross compilation from linux to windows gives following error? `fatal error: windows.h: No such file or directory`
16:36:19FromDiscord<requiresupport> used to work find before update
16:36:32*ajunior joined #nim
16:36:43FromDiscord<.kanaxa> sent a long message, see http://ix.io/4Cto
16:36:56FromDiscord<.kanaxa> (edit) "http://ix.io/4Cto" => "http://ix.io/4Ctp"
16:38:48Amun-Rano -d=mingw?
16:39:31FromDiscord<demotomohiro> I think gcc contains windows.h on windows.
16:39:32FromDiscord<requiresupport> added, the problem was I was using `--os:windows` 😓
16:39:56Amun-Ra:>
16:40:01FromDiscord<demotomohiro> Or you are not using gcc for windows?
16:40:17FromDiscord<requiresupport> was using mingw on linux to compile for windows
16:40:47*tiorock joined #nim
16:40:47*tiorock quit (Changing host)
16:40:47*tiorock joined #nim
16:40:47*rockcavera is now known as Guest5764
16:40:47*Guest5764 quit (Killed (osmium.libera.chat (Nickname regained by services)))
16:40:47*tiorock is now known as rockcavera
16:41:33Amun-Rathe only required define for this is mingw, and optional --cpu=i386/amd64
16:43:37FromDiscord<demotomohiro> In reply to @.kanaxa "I'm looking at the": `->` is a macro allows you to write a procedural type easier.↵It seems `noSideEffect` pragma is only applied to that procedural type.
16:46:19FromDiscord<jaar23> sent a code paste, see https://play.nim-lang.org/#ix=4Ctw
16:46:44FromDiscord<demotomohiro> In reply to @requiresupport "any idea why cross": Are you sure your Nim calls right gcc for cross compiling?↵Adding `--listcmd` compiler option to Nim shows command lines to call backend C compiler.
16:47:22FromDiscord<nasuray> In reply to @jensl "I love my lazyvim": my current setup uses `lazyvim` and `nimlsp` will occasionally fail but has been much more stable on 2.0. For syntax highlighting I use https://github.com/alaviss/nim.nvim
16:47:25FromDiscord<jaar23> In reply to @jaar23 "i think i'm not": if i uncomment the `sleep(1)` line and it working fines. i do not understand why .
16:48:03FromDiscord<requiresupport> In reply to @demotomohiro "Are you sure your": I fixed the problem, the problem was adding these params to compile `--os:windows`
16:50:28Amun-Raiirc it works with or without --os=windows on debian
16:50:39*ajunior quit (Ping timeout: 246 seconds)
16:52:55*ajunior joined #nim
16:56:41FromDiscord<Phil> sent a long message, see http://ix.io/4CtC
16:57:08FromDiscord<Phil> (edit) "http://ix.io/4CtC" => "http://ix.io/4CtD"
16:57:35*ajunior quit (Ping timeout: 245 seconds)
17:03:13FromDiscord<demotomohiro> In reply to @isofruit "God dangit. Had a": You probably need to copy NimNode tree and modify it instead of directly modifying NimNode from parameter.
17:04:51*ajunior joined #nim
17:06:38FromDiscord<Phil> In reply to @demotomohiro "You probably need to": Holy expletives that worked!
17:07:30FromDiscord<Phil> Okay I'm starting to actually like macros now, getting this endorphine rush of "Everything works now"
17:08:31Amun-RaI remember when my first macro worked…
17:09:59FromDiscord<bostonboston> `macro imarealprogrammer() = discard`
17:10:57*ajunior quit (Ping timeout: 246 seconds)
17:11:50FromDiscord<.kanaxa> In reply to @demotomohiro "`->` is a macro": I'm sorry, but I don't quite get your second sentence
17:12:40FromDiscord<.kanaxa> What is a 'procedural type'? I only know of the procedural programming paradigm
17:13:26FromDiscord<Phil> In reply to @.kanaxa "What is a 'procedural": He's speaking from a macro perspective
17:13:30FromDiscord<Phil> There language constructs have types
17:13:58FromDiscord<Phil> Actually no, never mind, he just means that the proc definition is a type itself, so you can more easily write proc definitions
17:14:25FromDiscord<Phil> Like this :↵`proc(bla: string)` ↵is a type
17:16:12FromDiscord<Phil> sent a code paste, see https://play.nim-lang.org/#ix=4CtI
17:16:25FromDiscord<Phil> `proc(bla: string)` is a procedural type in this scenario because it is the type of a proc
17:16:36FromDiscord<.kanaxa> In reply to @.kanaxa "I'm looking at the": What about the `{.noSideEffects}` part? Why is it set to the parameter, rather than the function?
17:16:54FromDiscord<Phil> In reply to @.kanaxa "What about the `{.noSideEffects}`": How familiar are you with functional programming?
17:16:55Amun-Rafunc(x:string):bool is a functional type
17:17:11FromDiscord<.kanaxa> In reply to @isofruit "How familiar are you": I've done it before, but I can't say I'm too familiar with it
17:17:20FromDiscord<.kanaxa> I'm aware of the concept of side effects
17:17:30FromDiscord<.kanaxa> I'm more curious about the pragma syntax for that in Nim
17:17:34FromDiscord<Phil> In reply to @.kanaxa "I've done it before,": It's more of the concept of side-effects:↵Does a proc do more than just map input to output? If so, it has side-effects
17:17:47FromDiscord<Phil> Reading from disk: A side effect↵echoing: A side effect↵etc.
17:18:11FromDiscord<.kanaxa> If a function is not to have side effects, why do we declare the {.noSideEffect} pragma to the parameter, rather than to the function? At least, per the `sugar` module's syntax
17:18:48FromDiscord<.kanaxa> The example code does run, I'm just having trouble wrapping my head around the syntax
17:19:06FromDiscord<Phil> With the pragma you basically guarantee that the only thing that the type ↵`(int {.noSideEffect.} -> int)` does (which maps an int to another int) is the mapping. ↵The compiler will break you if you try to put a proc in there that does mapping and also e.g. echoes
17:20:07FromDiscord<Phil> You were already familiar with it I now realizes after rereading, moving on:↵`->` is not real
17:20:39FromDiscord<Phil> In fact it is, as stated, a macro to turn `int -> int` into `proc(x: int): int` (x is irrelevant, can be whatever)
17:20:59FromDiscord<Phil> And it seems here that due to the way the macro transforms the expression the pragma goes directly after the parameter
17:21:06FromDiscord<.kanaxa> I've seen the arrow function like this in JS before, I've just never encountered a pragma like this at the parameter
17:21:11FromDiscord<.kanaxa> Which is why I'm so confused
17:21:44FromDiscord<.kanaxa> sent a long message, see http://ix.io/4CtM
17:22:31FromDiscord<Phil> It's less that it's applied to the parameters and more the way `->` transforms the expression into a `proc(x, y: int): int {.noSideEffect.}` expression
17:22:43FromDiscord<.kanaxa> Ahh
17:24:00FromDiscord<.kanaxa> In reply to @isofruit "It's less that it's": Oddly enough I tried that other syntax - `proc passTwo(f: ((int, int) -> int)): int {.noSideEffect.} = ...` - it's not valid syntax
17:24:09FromDiscord<Phil> One sec
17:24:14*ajunior joined #nim
17:24:17FromDiscord<.kanaxa> Macro-generated syntax really works my brain
17:29:44FromDiscord<Phil> sent a code paste, see https://play.nim-lang.org/#ix=4CtS
17:30:01FromDiscord<Phil> It's just about how `->` shuffles the pieces of code around
17:30:33*ajunior quit (Ping timeout: 246 seconds)
17:30:33FromDiscord<.kanaxa> Oh man! Thank you
17:30:35FromDiscord<.kanaxa> gotta study this
17:30:49FromDiscord<Phil> Honestly you shouldn't ever need to use the noSideEffect pragma
17:31:02FromDiscord<Phil> because you can just use `func` which is more expressive
17:31:15FromDiscord<Phil> a proc is a procedure and is allowed to have side-effect.↵A func isn't
17:31:23FromDiscord<Phil> (edit) "isn't" => "isn't, it is a function to map input to output"
17:31:53FromDiscord<.kanaxa> In reply to @isofruit "Honestly you shouldn't ever": I was aware of `func` but I didn't know the `noSideEffect` pragma wasn't meant for general use, rawghhh
17:32:54FromDiscord<Phil> In reply to @.kanaxa "I was aware of": I mean it makes sense in this context because the person wanted to write a proc-type in the style of a JS callback function but at the same time have no side effects.↵And then just didn't take into consideration that they might as well just write out "func"
17:33:04FromDiscord<Phil> (edit) ""func"" => "the proc definition the normal way using func"
17:34:04FromDiscord<Phil> Regarding pragmas, generally their useage while you code at a high-ish level (so no dealing with memory and metaprogramming) should be close to zero, maybe if a library uses them and asks you to annotate some stuff here or there but that should be documented by the lib.
17:34:34FromDiscord<Phil> The lower and more in-depth you go the more common they can become, but generally they aren't necessary for the bulk of your code.
17:34:35*azimut joined #nim
17:34:40FromDiscord<.kanaxa> Mmmmmmh, I see
17:34:59FromDiscord<.kanaxa> I keep seeing them everywhere in Nim code, so I thought they were high-usage syntax
17:35:09FromDiscord<.kanaxa> (edit) "high-usage" => "high-usage/common"
17:35:39FromDiscord<Phil> They can be, but by no means are they required in general.↵Like you can do some nifty stuff with them, such as annotating a proc to tell procs that call it which exceptions this one might throw
17:36:00FromDiscord<Phil> Or you might tag it and other procs might say "no, you can not use procs tagged like that here", or they might say "only procs tagged like that can be used in here"
17:36:34FromDiscord<Phil> But that is the kind of setup you do for projects that are either↵a) large↵and/or b) complex↵and/or c) involve a team of users
17:36:54*ajunior joined #nim
17:37:04FromDiscord<Phil> (edit) "complex↵and/or" => "complex (either in metaprogramming or in performance optimization and thus in dealing with memory)↵and/or"
17:37:13FromDiscord<Phil> (edit) "users" => "devs"
17:38:08FromDiscord<.kanaxa> This is so helpful man, thank you so much!
17:39:07FromDiscord<.kanaxa> Conceptually I can usually get what's happening, but it's the syntax that gets me, and what's idiomatic/common/best practices
17:41:33FromDiscord<Phil> For reference, in a codebase with around 10.000 loc I use around 125 pragmas.↵Around 90 of those are because the libs constructor and norm require their use to inform them about default values, foreign-key relationships, tableNames that a given model is associated with etc.↵↵another 20 or so are just the async pragma that prologue requires
17:41:40FromDiscord<Phil> (edit) "requires" => "requires, so again not my choice"
17:42:11FromDiscord<Phil> Leaving me with around ~15 or so pragmas I actually added myself to opt into a feature. ↵Which was to force specific procs to only be available at compiletime so that I can't misuse them
17:42:30FromDiscord<.kanaxa> Mmmm, I see
17:42:41FromDiscord<Phil> But even that is optional
17:42:48*ajunior quit (Ping timeout: 246 seconds)
17:43:06FromDiscord<Phil> So I really wouldn't jump into pragmas at all unless you're forced into it.↵They're the kind of thing personally I look up when I think "Man, it would be nifty if I could have X"
17:43:12*ajunior joined #nim
17:43:50FromDiscord<.kanaxa> In reply to @isofruit "So I really wouldn't": So definitely something I should reserve for later once I get proper into metaprogramming
17:43:54FromDiscord<Phil> Like the entire effects system: I do not use it for I have no usecase for it.↵I likely could, but the benefits of using it would (for me) not outweigh the drawback of the work involved
17:44:04FromDiscord<.kanaxa> Because I'm coming into Nim with this strong impression that it's a language for metaprogrammers
17:44:09FromDiscord<.kanaxa> Hence why I thought I had to get into it straight
17:44:13FromDiscord<Phil> In reply to @.kanaxa "So definitely something I": Reserve it as the kind of thing you deal with when you want to use a lib and the lib asks you pretty much
17:44:53FromDiscord<Phil> Otherwise you'll have your hands full getting used to the language in general
17:45:12FromDiscord<.kanaxa> Just wondering, is everyone here on this group professional/fulltime programmers? I recall reading some guesstimation on the forum about there being only about 80k+ active Nim programmers or something (derived as a more realistic 5-10% of the total Nim download count)
17:45:14FromDiscord<Phil> In reply to @.kanaxa "Because I'm coming into": All of those are opt in features.↵I didn't touch templates until I was like 6 months in and thought "Man, I want context managers like in python for this thing"
17:46:06FromDiscord<Phil> No idea, I think Beef would disavow being called professional in any capacity despite being a near bottomless well of knowledge.↵A couple folks I know here are, not sure about the majority
17:46:15FromDiscord<.kanaxa> In reply to @isofruit "Otherwise you'll have your": Yeah, I was messing around with Nim's regular expression stuff today, and I kept getting whacked with the differences: "Wait, you declare the string first, and then the pattern expression after? Wait, you now have `find`/`replace`, not `search`/`sub`?" Stuff like that
17:46:33FromDiscord<requiresupport> how do i define something if code is built for `--app:lib` ?
17:46:39FromDiscord<.kanaxa> (edit) "`search`/`sub`?"" => "`search`/`sub`? Wait, search returns an `int`, and not the match object's string?""
17:47:22FromDiscord<Phil> sent a code paste, see https://play.nim-lang.org/#ix=4CtU
17:47:57FromDiscord<demotomohiro> In reply to @requiresupport "how do i define": Do you want to call Nim procedures from C code?
17:49:05FromDiscord<requiresupport> `when defined(...)` if code is built with params `--app:lib`
17:49:22FromDiscord<requiresupport> (edit)
17:49:40*ajunior quit (Ping timeout: 246 seconds)
17:50:44FromDiscord<.kanaxa> In reply to @isofruit "All of those are": I'm barely a month in, got a long way to go
17:50:58FromDiscord<.kanaxa> I'm also messing around with metaprogramming in Python, so I'm keen on studying the differences between the two
17:51:02FromDiscord<.kanaxa> (edit) "the two" => "that and in Nim"
17:51:15FromDiscord<requiresupport> In reply to @requiresupport "<@288750616510201856> `when defined(...)`": `when appType == "lib"`
17:51:21FromDiscord<Phil> You mean messing with dunder functions in python?
17:51:50FromDiscord<Phil> (edit) "python?" => "python like `str`?"
17:54:01FromDiscord<.kanaxa> In reply to @isofruit "You mean messing with": Like metaclasses - I've never had a real need for them in Python, just curiosity
17:55:09FromDiscord<Phil> In reply to @.kanaxa "Like metaclasses - I've": Oh lord I barely remember them from Django, they had that stuff somewhere... were they the equivalent of an abstract class in java?↵I have entirely forgotten since then
17:56:45FromDiscord<.kanaxa> Sort of yeah, the ABC stuff and the metaclass_ thingy, classes that create classes - that stuff got me curious and was one of the things that led to me discover Nim
17:57:06*ajunior joined #nim
17:57:13FromDiscord<.kanaxa> (edit) "metaclass_" => "\_\_metaclass\_\_"
17:59:10Amun-RaPhil: it's a different kind of beast, metaclass is something that creates/modifies classes
17:59:53FromDiscord<Phil> I'm only aware of mixins in that regard but that was an architectural-thing, not a syntax thing
18:00:16FromDiscord<Phil> So what, they made an explicit language construct for the equivalent of the Factory Pattern?
18:00:41FromDiscord<Phil> (edit) "mixins" => "mixin classes"
18:01:04FromDiscord<.kanaxa> Sort of, yeah: https://stackoverflow.com/questions/100003/what-are-metaclasses-in-python
18:01:18Amun-Rasort of
18:01:21FromDiscord<.kanaxa> It's sort of to cater to Python's "everything's an object" paradigm, and the Python object model
18:02:02FromDiscord<.kanaxa> So anyone who's funky enough gets to mess around with the classmaker
18:02:11FromDiscord<.kanaxa> (edit) "So anyone who's funky enough gets to mess around with the classmaker ... " added "directly"
18:02:19FromDiscord<Phil> Right, Django had those for creating instances of Objects that map to database rows
18:02:29FromDiscord<Phil> "Managers" or sth I think
18:03:15FromDiscord<.kanaxa> Exactly, but on the application level I never had to mess around with the metaclass stuff, it was well-insulated from general use
18:03:25*ajunior quit (Ping timeout: 245 seconds)
18:03:45FromDiscord<.kanaxa> I imagine if you're YouTube/Google-scale where you need to rip out all the internal piping of Django, that's where you get into mucking around with that classmaking stuff directly
18:03:51FromDiscord<Phil> Lucky you, whenever I had to troubleshoot some stuff in there it took a bit to break my brain into the correct shape to think in
18:03:58FromDiscord<.kanaxa> I recall an article in which I think the Instagram guys did that
18:04:10FromDiscord<Phil> At least from what I remember from my Django project before I rewrote it last year
18:04:27FromDiscord<Phil> (edit) "At least from what I remember from my Django project before I rewrote it last year ... " added "in nim"
18:04:53FromDiscord<.kanaxa> In reply to @isofruit "Lucky you, whenever I": I'm just a lowly programmer, haha
18:05:05FromDiscord<.kanaxa> And since I'm not a proefssional one, I get to pick my choice of languages to work in/learn
18:05:20FromDiscord<.kanaxa> (edit) "proefssional one," => "professional one (just an enthusiast),"
18:05:28FromDiscord<Phil> I honestly think nim can be a learning treasure trove for programming concepts in general
18:05:54FromDiscord<Phil> Like basically even if you decide to dive into something else later on the concepts you can slowly amass in nim remain relevant, other languages just have different syntax for it
18:06:52FromDiscord<.kanaxa> In reply to @isofruit "Like basically even if": I'm inclined to agree, it's like a large/more serious step up from the more relaxed (or do whatever you want) programming style of Python
18:07:06FromDiscord<.kanaxa> The concepts are both the same and different, and can be quite a stepping stone
18:07:33FromDiscord<Phil> compile time and running code there, metaprogramming (okay that might not be as relevant in a lot of langs), overloading, how generics work, templates (That for example is relevant for C++ which has something similar but more for classes than code-snippets), compilers, C-interop, static-typing in general etc.
18:07:36FromDiscord<.kanaxa> E.g. in Python, lists are dynamically-sized, in Nim arrays are fixed-size - that's just one more leaping spot to get to C level where you have to work with fixed-length items directly
18:08:13FromDiscord<Phil> In reply to @.kanaxa "E.g. in Python, lists": Well tbh like 99% of the time you use seq's anyway because working with fixed-size is a pain ^^'
18:08:26FromDiscord<.kanaxa> Haha, really? dang
18:08:35FromDiscord<Phil> But yeah that's also an important concept
18:08:46FromDiscord<Phil> In java that one would be Array vs. ArrayList
18:09:36*ajunior joined #nim
18:10:56FromDiscord<.kanaxa> And syntax-wise and ease of tooling, Nim just feels much better - e.g. I'm learning Swift currently, and the enormous amounts of closures and shorthand syntaxes are a bit of a turn-off at times (e.g. shorthand closures), oddities like twin parameter names, the rather fractured standard library ecosystem (different on Mac OS vs everywhere else), the fact that you _have_ to use XCode at some point
18:11:18FromDiscord<.kanaxa> With Nim I can get by on a text editor and a terminal and a simple curl install, it's so nice
18:12:23FromDiscord<.kanaxa> (edit) "And syntax-wise and ease of tooling, Nim just feels much better - e.g. I'm learning Swift currently, and the enormous amounts of closures and ... shorthandtimes," added "curly brackets and" | "times (e.g. shorthand closures)," => "times, plus"
18:12:53FromDiscord<.kanaxa> (edit) "And syntax-wise and ease of tooling, Nim just feels much better - e.g. I'm learning Swift currently, and the enormous amounts of closures and curly brackets and shorthand syntaxes are a bit of a turn-off at times, plus oddities like twin parameter names, the rather fractured standard library ecosystem (different on Mac OS vs everywhere else), the fact that you _have_ to use XCode at some point ... " added "which is like a 10+
18:13:38FromDiscord<.kanaxa> Also the apple developer documentation is one of the most opaque documentation schemes I've ever read amongst all the languages, there are even apps built to supplement the official documentation
18:14:14FromDiscord<.kanaxa> At least I personally found it very difficult to understand, compared to Python's/Nim's docs
18:14:15FromDiscord<Phil> 😄 ↵Ah on the topic of things being opt in and not on a "Have to know" basis, basically just to drive the point home from Araq earlier:↵https://discord.com/channels/371759389889003530/768367394547957761/1137413636034416752↵> you don't have to learn nor use them if you don't want to but that applies to many other aspects of Nim as well: effect tracking, ptr hacking, "strict funcs" etc etc
18:14:58FromDiscord<Phil> (edit) "😄 ↵Ah on the topic of things being opt in and not on a "Have to know" basis, basically just to drive the point home ... from" added "here a quote"
18:15:52FromDiscord<.kanaxa> Great and very comforting reminder for newbies
18:15:54FromDiscord<.kanaxa> (edit) "Great and very comforting reminder for newbies ... " added "like me"
18:15:57FromDiscord<.kanaxa> (edit) "Great and very comforting reminder for ... newbies" added "Nim"
18:16:03*ajunior quit (Ping timeout: 246 seconds)
18:22:57*ajunior joined #nim
18:29:15*ajunior quit (Ping timeout: 245 seconds)
18:33:17*ajunior joined #nim
18:41:15*ajunior quit (Ping timeout: 246 seconds)
18:50:02*ajunior joined #nim
18:58:25*ajunior quit (Ping timeout: 245 seconds)
19:02:03FromDiscord<requiresupport> sent a code paste, see https://play.nim-lang.org/#ix=4Cuk
19:02:41*ajunior joined #nim
19:03:24FromDiscord<x.hat> In reply to @isofruit "Generally that's also the": TIL
19:07:40FromDiscord<arathanis> sent a code paste, see https://play.nim-lang.org/#ix=4Cum
19:07:46FromDiscord<arathanis> returns true, "Done!" prints.
19:08:38FromDiscord<Phil> I would wager the do-stuff bits continuously raise an exception
19:08:43*lfanew joined #nim
19:08:55*ajunior quit (Ping timeout: 240 seconds)
19:08:55FromDiscord<arathanis> oh i figured it was literally a placeholder lol
19:09:28FromDiscord<arathanis> still prints done, even if I raise an exception though.
19:09:31FromDiscord<requiresupport> I have an echo under exception too, but don't see anything echoed, so assumed it works
19:11:55FromDiscord<requiresupport> nvm found the issue, this function was part of a module im importing and it kept building the old version of the function event after `nimble install`
19:12:31*ntat quit (Quit: leaving)
19:15:41*ajunior joined #nim
19:21:51*ajunior quit (Ping timeout: 246 seconds)
19:26:57*ajunior joined #nim
19:33:00*ajunior quit (Ping timeout: 245 seconds)
19:35:21FromDiscord<0xrh0d4m1n> hey guys, any ideas on better dealing with modules to avoid the "never-ending" `../../../../../` ?
19:37:11FromDiscord<0xrh0d4m1n> is there any example of implementing some sort of pre-defined relative path like: `@myPath/myModule`
19:37:21FromDiscord<0xrh0d4m1n> (edit) "is there any example of implementing some sort of pre-defined relative path like: `@myPath/myModule` ... " added "?"
19:40:53*ajunior joined #nim
19:43:03FromDiscord<bostonboston> you might be able to do something with `$projectpath` or `$projectdir` but ive never used them
19:45:39FromDiscord<bostonboston> or maybe `{.strdefine.}`
19:45:56FromDiscord<0xrh0d4m1n> In reply to @bostonboston "you might be able": I was thinking on implementing some sort of a `hub` where from this hub any module could get anyhing... idk
19:46:54*junaid_ quit (Quit: leaving)
19:47:03*ajunior quit (Ping timeout: 246 seconds)
19:47:46FromDiscord<bung8954> why not use project root
19:48:03*junaid_ joined #nim
19:48:32FromDiscord<bostonboston> yeah so potentially `const hubPath {.strdefine.}: string = "../"` and `nim c -d:hubPath=[path to hub]`
19:48:54FromDiscord<0xrh0d4m1n> In reply to @bung8954 "why not use project": it is getting hard, it is a project of projects, I will try the approach from suggested by @bostonboston
19:49:09FromDiscord<0xrh0d4m1n> In reply to @bostonboston "yeah so potentially `const": thank you 🙂 ❤️
19:49:35FromDiscord<System64 ~ Flandre Scarlet> sent a code paste, see https://play.nim-lang.org/#ix=4CuM
19:49:40FromDiscord<bostonboston> ive never attempted to do that so if it does not work sorry
19:50:22*ajunior joined #nim
19:52:16FromDiscord<bung8954> I recommend use nim config file use can add include path
19:54:13FromDiscord<bostonboston> yep that sounds a lot cleaner than my method
19:56:32*junaid_ quit (Quit: leaving)
19:57:23*junaid_ joined #nim
19:58:28*ajunior quit (Ping timeout: 246 seconds)
19:59:13*junaid_ quit (Client Quit)
20:00:57*jmdaemon joined #nim
20:01:49*junaid_ joined #nim
20:08:04FromDiscord<x.hat> Does anyone know why the homebrew version of nim doesn't come with / build `testament`?
20:09:13FromDiscord<Phil> That's incredibly beyond me, apologies
20:13:56FromDiscord<jensl> In reply to @nasuray "my current setup uses": how did you install nim.nvim on lazyvim? im not a vim wiz soz
20:14:19FromDiscord<jensl> (edit) "on" => "using"
20:14:35*junaid_ quit (Quit: leaving)
20:16:16*junaid_ joined #nim
20:18:37FromDiscord<Elegantbeef> @Phil I do not fit the definition of professional in any regard, so of course!
20:18:49FromDiscord<Phil> I rest my case
20:18:57FromDiscord<System64 ~ Flandre Scarlet> Is it normal I have this error? https://media.discordapp.net/attachments/371759389889003532/1137479877604409444/image.png
20:19:01FromDiscord<Phil> Sidenote beef, doing my entire mapping idea via macro is just orders of magnitude simpler
20:19:25FromDiscord<Elegantbeef> Sure, it's even simplerif you just use a proc 😄
20:19:37FromDiscord<Phil> I lliterally just generate a bunch of `x.fieldName = y.fieldName` statements and attach them to the body that is already there
20:20:02FromDiscord<Phil> Do a check first if x.fieldName already gets assigned to earlier in the body that was already written but that's basically the entire part of the complexity
20:20:29FromDiscord<Phil> Now I just need to expand it to also work for ref types, named tuples and then check if inheritance screws me over somewhere
20:21:30FromDiscord<Elegantbeef> System functions cannot access global state
20:21:34FromDiscord<Elegantbeef> That's impure
20:21:54FromDiscord<System64 ~ Flandre Scarlet> oh↵Even if it is read only?
20:22:13FromDiscord<Elegantbeef> Of course
20:22:26FromDiscord<System64 ~ Flandre Scarlet> Oh alright
20:22:44FromDiscord<Elegantbeef> What's this check like?↵(@Phil)
20:22:54FromDiscord<bostonboston> I think the best way to think about (im stealing this comment) is a func maps inputs to outputs, if it does more than that its not a func
20:22:58FromDiscord<Elegantbeef> Phil can you show an small example of a usage and typedefs?
20:23:11FromDiscord<System64 ~ Flandre Scarlet> Because I have this global var, but I want other modules to only be able to read it https://media.discordapp.net/attachments/371759389889003532/1137480942957633547/image.png
20:23:22FromDiscord<Elegantbeef> Right boston
20:23:27FromDiscord<Elegantbeef> So make it a proc?
20:23:36FromDiscord<Elegantbeef> A function has the exact same output for the input
20:23:39FromDiscord<Elegantbeef> They're mathematically pure
20:23:41FromDiscord<jensl> In reply to @nasuray "my current setup uses": I got nim.nvim to work
20:23:44FromDiscord<jensl> ty
20:23:52FromDiscord<Elegantbeef> `1 + 1 = 2` always
20:24:06FromDiscord<Elegantbeef> a pure function with no parameters will always return the same value
20:24:12FromDiscord<Elegantbeef> Otherwise it's impure
20:24:15FromDiscord<jensl> did you have this same thing where it collapses indented code ?
20:24:23FromDiscord<jensl> https://media.discordapp.net/attachments/371759389889003532/1137481245400502352/image.png
20:24:58FromDiscord<Elegantbeef> `zR` jensl 😄
20:24:58FromDiscord<Elegantbeef> PS\: `import std/[net, osproc, strformat]`
20:25:02*junaid_ quit (Remote host closed the connection)
20:25:23FromDiscord<System64 ~ Flandre Scarlet> sent a code paste, see https://play.nim-lang.org/#ix=4Cv7
20:25:35FromDiscord<jensl> In reply to @Elegantbeef "`zR` jensl 😄": zR??
20:25:43FromDiscord<Elegantbeef> `template deltaTime: untyped = getDeltaTime()`
20:26:20FromDiscord<Elegantbeef> iirc zR unfolds
20:26:21FromDiscord<Elegantbeef> `z + R`
20:26:21FromDiscord<Elegantbeef> Whatever you prefer to write shortcuts as
20:27:00FromDiscord<jensl> ohh yes ty
20:27:19FromDiscord<jensl> but I don't even want it to do it in the first place 😅
20:27:33FromDiscord<jensl> it's nim.nvim doing it right/
20:27:41FromDiscord<jensl> (edit) "right/" => "right?"
20:29:01FromDiscord<System64 ~ Flandre Scarlet> In reply to @Elegantbeef "`template deltaTime: untyped =": Oh alright, thanks!↵Now the only problem is I can't use threads
20:29:08FromDiscord<Phil> sent a code paste, see https://play.nim-lang.org/#ix=4Cv8
20:29:12*thomasross joined #nim
20:29:40FromDiscord<Phil> I also have the ability to use a `{.asMapper.}` pragma instead but I'm not final on what I want my desired syntax to be or what the naming for those should be
20:29:55FromDiscord<.maverk> hello wonderful people
20:30:04FromDiscord<.maverk> i am new to nim programming
20:30:04FromDiscord<Phil> as for how I perform my check, one sec
20:31:23FromDiscord<.maverk> what does ``^`` do in nim ?
20:31:42FromDiscord<Elegantbeef> Creates a BackwardsIndex
20:31:58FromDiscord<nasuray> In reply to @jensl "but I don't even": you can disable folding with `vim.opt.foldenable = false`
20:33:09FromDiscord<Phil> I have a proc that scans every statement in the body essentially for `result.<Field>` and puts those `<Field>` in a seq.↵If I iterate over the fields of B and `<Field>` shows up I just skip it because I now it has an explicit mapping already provided by the user
20:33:53FromDiscord<.maverk> In reply to @Elegantbeef "Creates a BackwardsIndex": how ?
20:34:02FromDiscord<.maverk> can i see an example ?
20:34:02FromDiscord<jensl> In reply to @nasuray "you can disable folding": I tried this
20:34:05FromDiscord<jensl> https://media.discordapp.net/attachments/371759389889003532/1137483684086296576/image.png
20:34:10FromDiscord<jensl> but it doesn't work
20:34:21FromDiscord<Elegantbeef> `var a = ^1`
20:34:23FromDiscord<Phil> sent a code paste, see https://play.nim-lang.org/#ix=4Cva
20:35:14FromDiscord<Elegantbeef> https://play.nim-lang.org/#ix=4Cvb like phil this is the type of stuff I've been talking about this entire time
20:35:20FromDiscord<nasuray> In reply to @jensl "": It's not a package setting it's a global `vim` setting. you can see my config here https://git.dayl.in/daylin/dotfiles/src/branch/main/home/private_dot_config/nvim if it's helpful
20:36:02FromDiscord<jensl> ohh well it never folded untill I installed nim.nvim
20:36:09FromDiscord<jensl> ill check it out ty
20:36:39FromDiscord<Phil> In reply to @Elegantbeef "https://play.nim-lang.org/#ix=4Cvb like phil this": And you did not catch that the goal of that was a package.↵I want to be able to generate a full mapping proc including arbitrary assignments where I can not do simple `result.<field> = source.<field>`
20:36:44FromDiscord<Phil> If it were that simple I'd have written it that way
20:37:30FromDiscord<nasuray> In reply to @jensl "ohh well it never": The folding is set by `nvim/vim` the plugin is just telling it how it would fold a `.nim` file. If you want to only disable the behavior for specific file types you can use autocommands
20:37:37FromDiscord<scarlettalice> https://t.me/+baBKNFRxd78wNDU0
20:37:40FromDiscord<Phil> The key is that the entire thing is basically the proc you wrote together with user defined statements for custom assignments if they need it (or must provide in cases where e.g. `B` has a field that `A` does not, you must provide behaviour for how that field is supposed to be field in those scenarios)
20:38:24FromDiscord<Phil> Don't worry, I'm on that ban, give me a sec to get into matrix
20:38:53FromDiscord<Phil> There you go
20:39:44FromDiscord<.maverk> In reply to @Elegantbeef "`var a = ^1`": it doesn't work
20:40:16FromDiscord<Elegantbeef> it does
20:40:31FromDiscord<.maverk> https://media.discordapp.net/attachments/371759389889003532/1137485307307102308/Capture.PNG
20:40:35FromDiscord<.maverk> look
20:40:39FromDiscord<.maverk> i got an error
20:40:44FromDiscord<Elegantbeef> Yea look at the error
20:40:53FromDiscord<Elegantbeef> There is no `$` defined for a backwards index
20:40:56FromDiscord<.maverk> what should i do now ?
20:40:57FromDiscord<Phil> It errors because a backwards index can not be echo'd
20:41:16FromDiscord<.maverk> what should i do in this situation
20:41:26FromDiscord<.maverk> can you give me a working example
20:41:26FromDiscord<Phil> Just use it, no echo
20:41:27FromDiscord<.maverk> ?
20:41:39FromDiscord<Phil> sent a code paste, see https://play.nim-lang.org/#ix=4Cvf
20:42:41FromDiscord<Phil> Not every type or variable is stringifiable with `$` in nim↵Nim does have something called `repr` which always works, but is solely intended for debugging
20:42:44FromDiscord<.maverk> how did you get nim> ?
20:42:49*lfanew quit (Quit: Leaving.)
20:43:05*nils` joined #nim
20:43:07FromDiscord<Phil> I use inim which is a terminal application to execute nim lines of code as if it were a python shell
20:43:21FromDiscord<Phil> Basically that's called a REPL
20:43:35FromDiscord<.maverk> are using replit ?
20:43:44FromDiscord<.maverk> (edit) "using" => "u u sing"
20:43:51FromDiscord<.maverk> (edit) "u sing" => "using"
20:43:52FromDiscord<Phil> No, just inim, it's... a nimble package I think
20:44:06FromDiscord<jensl> In reply to @nasuray "you can disable folding": done, ty
20:44:14FromDiscord<.maverk> it doesn't work i ried typing inim
20:44:16FromDiscord<Phil> Unironically one incredibly useful piece of software for me
20:44:51FromDiscord<Phil> Of course not, inim is a package you need to install, not part of nim by default
20:45:05FromDiscord<.maverk> In reply to @isofruit "Of course not, inim": how to install it
20:45:07FromDiscord<.maverk> ?
20:46:40FromDiscord<Phil> In reply to @.maverk "how to install it": generally to look for nimble packages you can `nimble search <searchTerm>`↵To install a package such as inim, you can `nimble install <packageName>`
20:47:17FromDiscord<Phil> For further questions about features of nimble, here's the docs about it:↵https://github.com/nim-lang/nimble#readme
20:47:47FromDiscord<.maverk> now i understand the ^ operator
20:48:36FromDiscord<.maverk> instead of indexing from 0 it starts indexig from the last object in the list
20:49:29FromDiscord<Phil> Aye, it's pretty much identical in concept to python's "-1" index
20:50:25FromDiscord<Phil> sent a code paste, see https://play.nim-lang.org/#ix=4Cvm
20:50:38FromDiscord<Phil> (edit) "https://play.nim-lang.org/#ix=4Cvm" => "https://play.nim-lang.org/#ix=4Cvn"
20:51:48FromDiscord<.maverk> sent a code paste, see https://play.nim-lang.org/#ix=4Cvo
20:51:57FromDiscord<.maverk> but it doesn't work here 😅
20:52:08FromDiscord<.maverk> i should be getting ``d``
20:52:38FromDiscord<.maverk> or works only with arrays ?
20:52:42*om3ga quit (Read error: Connection reset by peer)
20:53:08FromDiscord<Phil> No, you just can't start backwards indexing with 0
20:53:55FromDiscord<Phil> See my earlier examples. I took the last elements of lists/seq's but the backwards index in both cases (python and nim) started with 1
20:53:59*om3ga joined #nim
20:54:17FromDiscord<Phil> So it works exactly as intended 😉
20:54:32FromDiscord<.maverk> i see i see now
20:54:42FromDiscord<.maverk> very nice brother
20:55:31FromDiscord<Phil> Just play around with your code more and try to troubleshoot a bit yourself
21:08:44FromDiscord<Phil> In reply to @Elegantbeef "https://play.nim-lang.org/#ix=4Cvb like phil this": Scrolling down is my flipping friend >_> <_>
21:08:49FromDiscord<Phil> (edit) ">_> <_>" => ">\_> <\_>"
21:09:34FromDiscord<Phil> Eh, still feel tempted to have a pragma just so the user has to think less about applying mapTo
21:09:54FromDiscord<Phil> And because new toy play around and so on
21:10:21FromDiscord<Phil> (edit) "In reply to @Elegantbeef "https://play.nim-lang.org/#ix=4Cvb like phil this": Scrolling down ... is" added "on play nim-lang"
21:10:56FromDiscord<.kanaxa> Eh just wondering if there's the utmost simplest tutorial for DSL/macros around to play with?
21:11:03FromDiscord<.kanaxa> Something to wet my beak with
21:11:25FromDiscord<.kanaxa> Doesn't have to be complex or do much, but at least a way to mess around with ASTs
21:13:28FromDiscord<Phil> sent a long message, see http://ix.io/4Cvx
21:14:16FromDiscord<.kanaxa> I read the entire chapter in Nim in Action, it started great, but halfway through it went into the Draw The Rest of the Owl mode, completely left me confounded
21:14:25FromDiscord<Phil> For me the starting point was none of those.↵It was the realization after having talked a bunch about them that every word, every sign, is a NimNode.↵And every syntax construct, is a very fixed pattern of NimNodes
21:14:44FromDiscord<.kanaxa> In reply to @isofruit "For me the starting": Hmmmm, that's really interesting
21:15:04FromDiscord<.kanaxa> So basically we're just reconstructing nodes
21:15:06FromDiscord<Phil> You can see a bunch of syntax constructs and what NimNode pattern they turn into in std/macros
21:15:37FromDiscord<.kanaxa> Alright work with me on this one, let's say we wanted to do something crazy
21:15:42FromDiscord<Phil> Basically the compiler already knows how to turn `proc x(y: int): string = $y` into a sequence pattern of nim-nodes that it can work with
21:15:49FromDiscord<.kanaxa> Let's just say: I wanted to write a fictional fantasy novel with Nim
21:16:02FromDiscord<.kanaxa> In a strict DSL fashion
21:16:08FromDiscord<.kanaxa> Would that be possible by rewriting the AST?
21:16:10FromDiscord<Phil> Via macros you can define how to transform some input A into that same sequence pattern of nimnodes and thus generate a proc
21:16:54FromDiscord<Phil> In reply to @.kanaxa "Would that be possible": I mean, yeah. You can turn anything into a DSL.↵As long as you can define the rules on how to turn any input X into the magical sequence of NimNodes for a given syntax construct, you can transform it
21:17:06FromDiscord<.kanaxa> sent a long message, see http://ix.io/4Cvy
21:17:14FromDiscord<.kanaxa> Would this be a possibly valid syntax in Nim?
21:17:23FromDiscord<.kanaxa> With the implementation details to be filled in later
21:17:41FromDiscord<.kanaxa> But could the above be used to generate say, novels, by trope-y variations, using DSLs?
21:18:07FromDiscord<Phil> sent a code paste, see https://play.nim-lang.org/#ix=4Cvz
21:18:15FromDiscord<.kanaxa> Absolutely fascinating
21:18:18FromDiscord<Phil> Note though that transforming stuff in that manner can be very, very tedious
21:18:23FromDiscord<.kanaxa> The only question then is --- why not use functions
21:18:40FromDiscord<.kanaxa> From what I understand: because functions can't rewrite grammar, you're still stuck to vanilla Nim
21:18:55FromDiscord<.kanaxa> With macros, Nim becomes a different language in itself thanks to the DSL change
21:18:56FromDiscord<.kanaxa> Am I right?
21:19:29FromDiscord<Elegantbeef> Functions have limited introspection capabilities and you cannot rewrite the AST to anything
21:19:29FromDiscord<Phil> Yees-ish with some limitations.↵Like you won't get rid of indentation for example.↵Or the fact that pragmas are necessary.↵Or the proc keyword.
21:19:40FromDiscord<.kanaxa> Fair enough
21:19:54FromDiscord<.kanaxa> but I'm excited about the possibilities
21:20:00FromDiscord<Phil> You can certainly make things very mutable, more mutable than a lot of other langs
21:20:30FromDiscord<Phil> Actually I'm not aware of any other languages this mutable... C maybe?
21:20:34FromDiscord<.kanaxa> Like I play music, what if I recreated DSL for writing music, so that I could compose music in a specific DSL that could then export to sheet music or tablatures
21:20:49FromDiscord<Elegantbeef> Rust has token macros
21:20:57FromDiscord<Elegantbeef> you can embed other languages into rust due to its macros
21:21:06FromDiscord<Phil> I stand corrected
21:21:24FromDiscord<Elegantbeef> Valid rust
21:21:27FromDiscord<Elegantbeef> sent a code paste, see https://paste.rs/VyBml
21:21:48FromDiscord<.kanaxa> sent a code paste, see https://play.nim-lang.org/#ix=4CvB
21:21:53FromDiscord<.kanaxa> The Rust code seems quite succinct
21:21:54FromDiscord<Elegantbeef> Nim doesnt have token macros
21:21:57FromDiscord<Phil> In reply to @.kanaxa "Like I play music,": Completely possible, however a "lang" for generating and playing the generated music already exists ^^
21:22:01FromDiscord<Elegantbeef> So you'd have to do the `parse` variation
21:23:01FromDiscord<Phil> (edit) "In reply to @.kanaxa "Like I play music,": Completely possible, however a "lang" for generating and playing the generated music already exists ... ^^" added "(Sonic Pi)"
21:24:08FromDiscord<.kanaxa> In reply to @isofruit "Completely possible, however a": Oh wow!
21:24:36FromDiscord<Elegantbeef> https://github.com/vitreo12/omni
21:28:46FromDiscord<jensl> https://media.discordapp.net/attachments/371759389889003532/1137497452652544110/image.png
21:28:54FromDiscord<jensl> how do I tell nvim what the root dir is?
21:33:07FromDiscord<nasuray> In reply to @jensl "": you switched to nim_langserver? also are you in a project that has a `<project>.nimble` the root directory isn't relevant if you are operating on a single file and not a library or package
21:33:52*Torr joined #nim
21:33:57FromDiscord<jensl> In reply to @nasuray "you switched to nim_langserver?": yea bc your config had nim_langserver and nimlsp didn't work even when it said it did
21:34:16FromDiscord<jensl> but do I have to add a `.nimble` folder to every project??
21:35:04FromDiscord<jensl> when I install using nimble rn everything goes to `C:\Users\ME\.nimble`
21:35:35FromDiscord<Phil> There should only be one .nimble dir, but every project should have a <project>.nimble file
21:35:59*PMunch joined #nim
21:36:20FromDiscord<jensl> wait is there a way to make a nim project just like `cargo new` ?
21:36:31FromDiscord<jensl> or do I have to manually make a file
21:36:42FromDiscord<Phil> nimble init
21:37:27FromDiscord<nasuray> In reply to @jensl "yea bc your config": Ah my nvim config might be out of sync then because I switched back to `nimlsp`
21:38:15FromDiscord<jensl> In reply to @isofruit "nimble init": https://media.discordapp.net/attachments/371759389889003532/1137499837189869659/image.png
21:38:24FromDiscord<jensl> Im just trynna write a script here 💀
21:38:58FromDiscord<Phil> In that case license doesn't matter, it in the end just copy pastes a txt file in and types it into the nimble file
21:39:08FromDiscord<jensl> okay well I did it
21:39:10FromDiscord<jensl> but
21:39:25FromDiscord<jensl> root dir not found
21:39:48FromDiscord<jensl> and I have a nim.nimble
21:39:55FromDiscord<jensl> src/nim.nim
21:40:09FromDiscord<Phil> I mean regarding root dir I can't help, I don't do nimlsp, Pmunch might.
21:40:32FromDiscord<Phil> I stated what I could about initializing nim projects ^^'
21:40:50FromDiscord<jensl> yes I didn't know that either ty :)
21:41:12FromDiscord<nasuray> I would pick a different name for your files lol and FWIW the language server doesn't need to have a root directory if you are only writing one file
21:42:10FromDiscord<jensl> I just quickly tried that nimble init
21:42:24FromDiscord<jensl> but if it doesn't need a root dir why doesn't the lang server work
21:42:35FromDiscord<jensl> it says this when I open a .nim file
21:42:37FromDiscord<jensl> https://media.discordapp.net/attachments/371759389889003532/1137500935900368936/image.png
21:43:10FromDiscord<jensl> In reply to @jensl "": and 0 clients are attached
21:43:53FromDiscord<nasuray> you'll need to check the lsp.log to find out why it specifically crashes
21:44:02FromDiscord<nasuray> what version of nim are you using?
21:44:13FromDiscord<jensl> 2.0.0
21:44:40*PMunch_ joined #nim
21:45:00FromDiscord<nasuray> It crashes often though it's seemed more stable with 2.0 for me
21:45:52FromDiscord<jensl> there's no way it's installed correctly, it hasnt worked a single time yet
21:46:09FromDiscord<jensl> In reply to @nasuray "you'll need to check": where is lsp.log? 😬
21:46:27FromDiscord<nasuray> not totally sure on windows
21:47:06*PMunch quit (Ping timeout: 246 seconds)
21:47:37FromDiscord<jensl> found it
21:48:23FromDiscord<jensl> idk if I should paste here
21:48:29FromDiscord<jensl> sent a long message, see http://ix.io/4CvG
21:50:48FromDiscord<nasuray> sent a code paste, see https://play.nim-lang.org/#ix=4CvH
21:52:07FromDiscord<jensl> maybe im just weird for using system33, idk
21:55:26FromDiscord<jensl> I fixed the root dir now and it makes no difference indeed
21:57:51FromDiscord<jensl> @nasuray what happens if you type `nimlangserver` in your terminal?
21:58:08FromDiscord<jensl> https://media.discordapp.net/attachments/371759389889003532/1137504842709991625/image.png
22:00:10*hohlerde joined #nim
22:04:05*PMunch_ quit (Read error: Connection reset by peer)
22:11:56FromDiscord<jensl> I tried reinstalling and it gave this error
22:11:58FromDiscord<jensl> https://media.discordapp.net/attachments/371759389889003532/1137508321042112653/image.png
22:12:12FromDiscord<jensl> (edit) "error" => "warning, might be the cause"
22:12:13FromDiscord<jensl> https://media.discordapp.net/attachments/371759389889003532/1137508385701498900/image.png
22:16:41*disso-peach quit (Quit: Leaving)
22:27:03FromDiscord<jensl> even after reinstalling nim :/
22:40:29*cedb quit (Ping timeout: 260 seconds)
22:42:29FromDiscord<Phil> Can you quote do something with a identifier from a variable?
22:43:13FromDiscord<Phil> sent a code paste, see https://play.nim-lang.org/#ix=4CvP
22:43:20*lucasta joined #nim
22:44:10*lucasta quit (Remote host closed the connection)
22:44:35*lucasta joined #nim
22:45:49FromDiscord<Phil> Actually what am I saying, I can just manipulate the nimnode I get out of the quote do
22:48:59*Torr quit (Quit: Torr)
22:53:47FromDiscord<voidwalker> sent a code paste, see https://play.nim-lang.org/#ix=4CvQ
22:55:48FromDiscord<Elegantbeef> You are mutating `x` and passing it as mutable
22:56:13FromDiscord<voidwalker> ok so this is an acceptable way to modify global vars with a func.. hmm
22:57:58FromDiscord<odexine> Well because you’re passing it in
22:58:02FromDiscord<bostonboston> It fits the definition of {.noSideEffect.} according to the manual
22:58:15FromDiscord<bostonboston> https://nim-lang.org/docs/manual.html#effect-system-side-effects
22:58:27FromDiscord<odexine> You’re explicitly telling Nim that you’re giving the function the ability to modify the parameter
22:58:52FromDiscord<odexine> At least IIRC that’s the justification given for it not being a side effect
22:59:21FromDiscord<odexine> And technically yes, it isn’t a side effect since it’s explicit
22:59:39FromDiscord<odexine> You can kinda equate it to a monad I guess
23:16:04*thomasross quit (Remote host closed the connection)
23:16:28*thomasross joined #nim