<< 28-05-2025 >>

00:01:15*Goodbye_Vincent1 joined #nim
00:05:45FromDiscord<litlighilit> I tested. Nope \:(↵(@Robyn [She/Her])
00:06:49FromDiscord<litlighilit> I tested. Nope. Definition is okey but it's not invoked. \:(
00:20:21*flynn joined #nim
00:20:30*flynn quit (Client Quit)
01:11:05FromDiscord<Robyn [She/Her]> In reply to @aintea "I mean instantiating a": wdym?
01:33:49FromDiscord<nasuray> In reply to @pmunch "What does "Scanning" mean": It's intercepting some of the subprocesses and showing scanning instead https://github.com/nim-lang/nimble/blob/b00ba90cdd852efd8d56765aaa35f9001a4ffc1b/src/nimblepkg/cli.nim#L149. I have a PR to submit tomorrow to remove the spinner for now since it introduced a couple of bugs with output handling (later I plan to try to clean up the logging by nimble for consistency and function and ad
01:49:42*xet7 quit (Remote host closed the connection)
02:20:01*rockcavera quit (Remote host closed the connection)
03:59:00*amadaluzia quit (Ping timeout: 252 seconds)
03:59:21*amadaluzia joined #nim
04:17:44*amadaluzia quit (Ping timeout: 260 seconds)
05:01:08*ntat joined #nim
05:09:20*amadaluzia joined #nim
05:50:50*amadaluzia quit (Remote host closed the connection)
06:07:10FromDiscord<aintea> sent a code paste, see https://play.nim-lang.org/#pasty=guppeqdh
06:18:56*andy-turner joined #nim
06:20:28*andy-turner quit (Remote host closed the connection)
06:20:47*andy-turner joined #nim
07:32:28FromDiscord<entropydev> I'm getting an issue where nimlangserver crashes because of one of my nim dependencies. I would like to tell it to ignore the import so that it will continue to work correctly on the rest of the project, is there a way to do this? For example in typescript you put a comment @ts-ignore that would tell the next line to be ignored.
07:34:13FromDiscord<lainlaylie> you can detect nimsuggest with defined(nimsuggest) or something
07:34:36FromDiscord<lainlaylie> but you should report that bug to the relevant project
07:35:41FromDiscord<entropydev> I will, but I'm 99% certain they won't fix it, so I definitely need a work around
07:42:17FromDiscord<entropydev> In reply to @lainlaylie "you can detect nimsuggest": How would I stop it from loading the dependency using this?
07:46:55FromDiscord<janakali> @entropydev nimscript has `patchfile` to redirect imported modules: https://nim-lang.org/docs/nimscript.html#patchFile%2Cstring%2Cstring%2Cstring
07:49:08FromDiscord<entropydev> So I would make a secondary stub file with the functions I am calling and then redirect it on compile to the real file?
07:49:14FromDiscord<janakali> I've never used it, but you can find many examples on github: https://github.com/search?q=lang%3Anim+patchFile&type=code
07:50:30FromDiscord<janakali> it's hard to understand what you're trying to achieve without more context
07:50:59FromDiscord<entropydev> just trying to get my editor to work
07:51:44FromDiscord<entropydev> basically if I import certain dependencies, the langserver crashes and I get no hints in my editor
08:08:58FromDiscord<janakali> sent a code paste, see https://play.nim-lang.org/#pasty=wvSfmDJi
08:20:53*xet7 joined #nim
08:22:43*xet7 quit (Remote host closed the connection)
08:39:38FromDiscord<dawidek.2137> there used to be a proc in system for making a seq have reference semantics, it seems not to exist anymore?
08:45:23*beholders_eye joined #nim
08:48:53FromDiscord<dawidek.2137> should I just use ref seq?
09:40:41FromDiscord<Robyn [She/Her]> sent a code paste, see https://play.nim-lang.org/#pasty=vVLFCMLY
09:41:11FromDiscord<aintea> Yes but when I say macros I also include templates in it
09:57:58*ntat quit (Quit: leaving)
10:02:48*ntat joined #nim
10:08:59*beholders_eye quit (Ping timeout: 265 seconds)
10:20:32*ntat quit (Quit: leaving)
10:27:34FromDiscord<entropydev> I have a library (different one, which seems to work fine) that has optional procedures it exports if -d arguments are added at compilation. How do I let nimsuggest know that these arguments will be called at compilation, and therefore to give suggestions for code completion?
10:37:58*ntat joined #nim
10:43:47FromDiscord<lainlaylie> https://nim-lang.org/docs/nimc.html#compiler-usage-configuration-files
10:48:52*amadaluzia joined #nim
11:27:27FromDiscord<aintea> sent a code paste, see https://play.nim-lang.org/#pasty=LZRRClYa
11:51:37*beholders_eye joined #nim
12:14:50FromDiscord<pmunch> Hmm, something has changed with templates access to outside symbols?
12:14:57FromDiscord<pmunch> I can't build the forums with 2.2.4
12:15:13FromDiscord<pmunch> Nor 2.2.2
12:16:11FromDiscord<pmunch> I had `experimental:openSym` running on my other machine, but I can't get it working here
12:25:59FromDiscord<lainlaylie> In reply to @aintea "Let's imagine I have": a macro that is declared as returning a Command actually needs to return a syntax tree that evaluates to a Command
14:48:18*beholders_eye quit (Ping timeout: 248 seconds)
14:59:37*amadaluzia quit (Ping timeout: 252 seconds)
16:09:14*xutaxkamay quit (Quit: ZNC 1.8.2+deb3.1+deb12u1 - https://znc.in)
16:09:56*xutaxkamay joined #nim
16:22:42FromDiscord<Laylie> that didn't go through
16:22:54FromDiscord<Laylie> was someone talking about self hosting this danged bridge
16:31:51*andy-turner quit (Quit: Leaving)
16:32:07*andy-turner joined #nim
16:32:23*ntat quit (Quit: leaving)
16:36:27*andy-turner quit (Client Quit)
16:36:43*andy-turner joined #nim
16:38:26*skippy8 joined #nim
16:39:32*andy-turner quit (Client Quit)
16:39:48*andy-turner joined #nim
16:43:16FromDiscord<laputian_bird> I've recently made the switch from windows to linux and apparently I'm having a hard time to install and configure nim - I've installed it using choosenim, added the necessary line to PATH, and I can successfully call nim and nimble from bash/terminal ↵however, if I try to call nimble from a bash script, I get a `command not found` error↵anybody knows what I'm doing wrong? I've tried to solve it by googling, to no avail
16:43:48FromDiscord<muddmaker> Are you setting the PATH in your batch script?
16:44:31FromDiscord<laputian_bird> nope, set in bashrc as per instructions - restarted the shell, commands are available
16:44:32FromDiscord<muddmaker> Or are you setting the PATH when calling your bash script?
16:45:55FromDiscord<laputian_bird> sent a code paste, see https://play.nim-lang.org/#pasty=eYDQobhm
16:46:29FromDiscord<laputian_bird> however if in the terminal I cd to the path and call the command manually, it does work
16:47:05FromDiscord<muddmaker> If you add `echo $PATH` to the script before the call to `nimble`, what does it tell you?
16:47:46FromDiscord<laputian_bird> ok, just a min, I was in the process of reinstalling choosenim too, just in case
16:52:41FromDiscord<laputian_bird> uh, from the script call, it is missing the nim directory - however it is present in the output from the terminal
16:53:20FromDiscord<laputian_bird> reboot? it used to be the universal solution on windows, but maybe it's still the case
16:53:34FromDiscord<muddmaker> Out of curiosity, as a sanity check, what terminal window are you running the script from?
16:53:46FromDiscord<muddmaker> Was it one that was opened before you added the path to bashrc?
16:53:59FromDiscord<laputian_bird> it's bash/konsole on KDE/Kubuntu
16:54:21FromDiscord<laputian_bird> In reply to @muddmaker "Was it one that": nope, made sure to reset everything, except a hard reboot
16:54:24FromDiscord<laputian_bird> brb
16:54:52*andy-turner quit (Quit: Leaving)
16:55:07*andy-turner joined #nim
16:55:29*andy-turner quit (Client Quit)
16:56:42FromDiscord<muddmaker> I think the bashrc file is only pre-loaded on the login shell, and I guess when you execute a bash script, it doesn't automatically carry over the environment
16:56:45FromDiscord<laputian_bird> well this is odd, $PATH prints two different outputs still
16:57:06FromDiscord<muddmaker> So you may have to source the bashrc from the start of the shell script
16:58:04FromDiscord<muddmaker> Which I _think_ is done with `. ~/.bashrc`
16:58:07FromDiscord<laputian_bird> I'm rather clueless when it comes to linux, but shouldn't a reboot solve that?
16:58:20FromDiscord<muddmaker> No
16:59:23FromDiscord<muddmaker> The "login shell" is what gets created when you launch a terminal (or when you login without a graphical shell e.g. over SSH)
17:00:10FromDiscord<muddmaker> Oh, try to adjust your `#!/bin/bash` at the top of the file to include ` -l` at the end and see what happens
17:01:56FromDiscord<muddmaker> Basically, when the shell is launched as if it is a login shell, it will perform some extra initialization steps
17:02:06FromDiscord<muddmaker> Such as reading the bashrc file
17:02:34FromDiscord<muddmaker> Without that, it will just execute the basic bash language without any extra initialization
17:03:04FromDiscord<muddmaker> This is so that you can customize your login shell environment, without risking your specific environment breaking shell scripts that handle their own initialization
17:03:55FromDiscord<muddmaker> I am still a little unsure as to why the PATH variable is getting reset at all, though
17:04:51FromDiscord<laputian_bird> uhm, I looked into the `.profile` too, which is the other location where it's suggested to add the path, and it seems to call bashrc in turn, but still apparently no change - going to try with the -l parameter
17:07:49FromDiscord<laputian_bird> -l seems to have done the trick, but let me make sure that's the one that fixed it - going to reset it all to remove other factors
17:19:43FromDiscord<laputian_bird> yeah, it looks like a `bash -l` is necessary to load the user paths
17:20:33FromDiscord<laputian_bird> it doesn't feel normal though, given that the choosenim installer would be giving misleading or incomplete info - I still think there's something wrong with my system
17:24:41FromDiscord<laputian_bird> @muddmakereither way, appreciate the assistance, it was getting very frustrating
17:32:08FromDiscord<heysokam> @laputian_bird anything to do with bash scripts tends to get frustrating very quickly↵thankfully you won't need them for long, specially considering you are learning nim
17:34:41FromDiscord<laputian_bird> heh, I wouldn't be that sure - those nim utilities that I need to compile are from a public git repo, I never wrote a line of nim myself - I mostly use python when I need some tool I can make myself
17:43:06FromDiscord<heysokam> 1month of nim and you wont need bash ever again, except for system wide config↵also, if you are a python user, I recommend `xonsh` a lot. its a bash replacement that uses python syntax instead. so handy
18:05:03FromDiscord<heysokam> sent a code paste, see https://play.nim-lang.org/#pasty=AaXgDNhH
18:05:07FromDiscord<laputian_bird> yes found that when I considered switching to a different shell
18:05:59FromDiscord<laputian_bird> https://media.discordapp.net/attachments/405329004124700685/1375481366174765126/GuKGK3p.png?ex=68386fd8&is=68371e58&hm=e9bbdeeefee570c9f6639e9f938dfe92604564951c27b40a3e4f120efeb393c6&=&format=webp&quality=lossless&width=681&height=1022
18:06:28FromDiscord<laputian_bird> https://media.discordapp.net/attachments/371759389889003532/1377347307694981291/GuKGK3p.png?ex=6838a224&is=683750a4&hm=91ccbcf5c43db0404d021a505f9ff7a8482ad3b3cf494f1b1e5cc90be741d396&
18:06:43FromDiscord<heysokam> 😄 so damn accurate, haha
18:07:03FromDiscord<leorize> powershell is weird but it's pretty good, actually
18:07:45FromDiscord<laputian_bird> however, I was advised against dropping bash, for the simple fact that in that 10% of cases that I can't replace it, not being used to it (for a recovery scenario for instance) I could regret it bitterly
18:08:39FromDiscord<heysokam> In reply to @laputian_bird "however, I was advised": yea, don't 100% replace it on the system. just call xonsh from it at boot and done
18:09:05FromDiscord<laputian_bird> powershell is infuriating - a shell that I cannot use the way it should be used, because scripts are blocked by default? please, learn to make a more robust OS, microsoft
18:09:29FromDiscord<heysokam> or set your terminal emulator to use xonsh too, that also works. the base terminal is best with bash for simplicity
18:10:01FromDiscord<laputian_bird> In reply to @heysokam "yea, don't 100% replace": yeah, I decided to stick to bash for now, and once I?m comfortable with it, consider a different shell for other uses
18:10:45FromDiscord<leorize> MS has a different security posture than \nix shells since it's so easy to just run things, there's no "execute" permission there
18:11:23FromDiscord<leorize> dev settings in windows would let you switch powershell to unrestricted always, though
18:11:31FromDiscord<entropydev> I want to make something akin to an event listener using chronos, so I am making a non-async proc that calls an async proc using a couple of objects as arguments, however it looks like the objects I am passing it are getting cleaned up before I'm finished using them in the callback function. What is the right way to prevent this if I don't want the non-async proc to not block?
18:12:14FromDiscord<entropydev> (edit) removed "don't"
18:14:15*ntat joined #nim
18:16:06FromDiscord<laputian_bird> In reply to @leorize "dev settings in windows": yes but it feels like you need to disable your AV because otherwise you can't browse the web - safety shouldn't exclude usability - one could do a lot of damage with cmd too, if run as admin
18:18:56FromDiscord<laputian_bird> btw, what's with all these "APP" tags on so many users?
18:22:25FromDiscord<leorize> windows has to cater to this one audience that knows nothing but likes clicking on random stuff, as admin↵(@laputian_bird)
18:22:54FromDiscord<leorize> I can see why they have to do that, but it does make their platform rather sad when used as a dev platform
18:23:05FromDiscord<leorize> though a lot of people seems to disagree
18:25:38FromDiscord<laputian_bird> I don't know, I guess I was just tired of the increasing restrictions - I remember when suddenly I had to gain ownership of registry entries even though I was the sole user and an admin of my own machine
18:26:38FromDiscord<leorize> yea, on Windows admin is pretty low on the pecking order
18:26:58FromDiscord<leorize> might be due to how they still default all users to admin and now too many things depend on that and they can't fix it
18:28:54FromDiscord<laputian_bird> hopefully I won't have to deal with the windows ecosystem anymore - I keep a secondary windows install, in case I need some program I cannot find a replacement for in linuxland, but haven't had the need for it yet
18:46:48FromDiscord<leorize> they are people from other chat platforms↵(@laputian_bird)
18:46:51FromDiscord<leorize> in my case would be matrix
18:51:52FromDiscord<heysokam> In reply to @laputian_bird "I don't know, I": this, and freedom of configurability, made me switch to linux
18:52:17FromDiscord<heysokam> same reason I don't like mac. its the same type of restricted environment, but with a different base
19:01:01FromDiscord<heysokam> sent a code paste, see https://play.nim-lang.org/#pasty=oLbTrsUP
19:01:35FromDiscord<heysokam> (edit) "https://play.nim-lang.org/#pasty=uoEApVmx" => "https://play.nim-lang.org/#pasty=YSNCaJde"
19:12:39FromDiscord<leorize> sounds like you'd have to write it yourself
19:27:25FromDiscord<Phil> In reply to @heysokam "Bumping this: Does someone": Does https://github.com/zero-functional/zero-functional?tab=readme-ov-file#index work?
19:29:01FromDiscord<aintea> sent a code paste, see https://play.nim-lang.org/#pasty=cIRGMYkj
19:29:15FromDiscord<aintea> if you're sure there exists at least one element and you want the first
19:29:21FromDiscord<Phil> sent a code paste, see https://play.nim-lang.org/#pasty=dbvnTPoi
19:29:30FromDiscord<aintea> I do this but with an option
19:30:26FromDiscord<Phil> Yeh, it's fine as long as you do the indexed access on the array after an if-check or a switch-case over the length
19:30:32FromDiscord<aintea> sent a code paste, see https://play.nim-lang.org/#pasty=cWqgoiMe
19:44:04FromDiscord<Elegantbeef> It takes a few seconds to make it without allocating
19:45:39FromDiscord<Elegantbeef> sent a code paste, see https://play.nim-lang.org/#pasty=GvIDyKdX
19:46:34FromDiscord<aintea> is there a reason why you `ref ValueError` instead of `ValueError.newException(msg)` ?
19:47:09FromDiscord<Elegantbeef> sent a code paste, see https://play.nim-lang.org/#pasty=kbVBmmqF
19:47:32FromDiscord<Elegantbeef> `(ref T)` lets you supply fields explicitly there is no need for `newException`
19:48:53FromDiscord<Elegantbeef> cond is needed cause it's named `find` and there is a system find that matches first, so uhh name it differently I guess
20:01:32FromDiscord<heysokam> In reply to @isofruit "Does https://github.com/zero-functional/zero-functi": no idea, don't understand the syntax. but its a lib, so I'd rather have a loop than add a dependency just for a filter function 🙂
20:01:59FromDiscord<heysokam> sent a code paste, see https://play.nim-lang.org/#pasty=KWwknGFD
20:45:43*beholders_eye joined #nim
20:47:10*ntat quit (Quit: leaving)
21:04:05*beholders_eye quit (Ping timeout: 252 seconds)
21:15:17*beholders_eye joined #nim
21:34:32*rockcavera joined #nim
22:33:34*rockcavera quit (Remote host closed the connection)
22:36:29*rockcavera joined #nim
22:41:40FromDiscord<heysokam> How do static libraries work in nim?↵Not meaning C static libraries consumed by nim, but rather creating a static library from nim itself↵How are they then used by other code?
22:42:36FromDiscord<griffith1deadly> In reply to @heysokam "How do static libraries": like any other static library?
22:44:02FromDiscord<heysokam> In reply to @griffith1deadly "like any other static": if it was that simple to grasp I wouldn't be asking, right?
22:44:47FromDiscord<heysokam> what do the symbols look like? are they C, or Nim, do they need binding, does the consumer need to run NimMain, how is the GC handled.... etc etc
22:45:31FromDiscord<heysokam> (edit) "what do" => "are" | "arethe ... symbols" added "contained" | removed "look like? are they" | "containedsymbolsC, or Nim, ... do" added "what do they look like,"
22:46:43FromDiscord<griffith1deadly> `exportc` symbols and they will be like in c and you can use that from c code, same as with dll's ↵↵i think consumer need calling NimMain, because in case of dll's need for gc and dynlib's↵and `importc` & `exportc` for using nim with nim like always
22:47:28FromDiscord<heysokam> kk, so the symbols are C and need `exportc` to not be mangled. ty
22:52:36FromDiscord<leorize> you can't link more than one, because each static lib contains the entire copy of stdlib used
22:52:36FromDiscord<leorize> though I'll note that nim staticlib is horrible
22:54:54FromDiscord<griffith1deadly> In reply to @leorize "you can't link more": isn't nimrtl helps?
22:55:00FromDiscord<griffith1deadly> or that only in dll's case
23:07:24FromDiscord<aintea> sent a code paste, see https://play.nim-lang.org/#pasty=tMrwEQAM
23:07:44FromDiscord<aintea> (edit) "https://play.nim-lang.org/#pasty=eamQfImt" => "https://play.nim-lang.org/#pasty=RkLYvncx"
23:07:52FromDiscord<aintea> I need the macro to be able to return a value
23:08:28FromDiscord<griffith1deadly> show repr of result
23:11:34FromDiscord<aintea> sent a code paste, see https://play.nim-lang.org/#pasty=edmTabTi
23:11:55FromDiscord<aintea> this is when I do `echo <number>` instead of `<number>`
23:12:00FromDiscord<aintea> because otherwise it just doesn't compile
23:14:01FromDiscord<griffith1deadly> remove echo and show output of `echo repr of_body`
23:14:21FromDiscord<griffith1deadly> you can disable return from macro to avoid compiletime error
23:16:05FromDiscord<aintea> sent a code paste, see https://play.nim-lang.org/#pasty=DnRierWt
23:16:28FromDiscord<aintea> which is exactly what I want, the body of the first `of_branch` should be 1
23:16:33FromDiscord<aintea> same for the second and last
23:17:10FromDiscord<griffith1deadly> so now show final repr of macro result
23:17:13FromDiscord<aintea> (edit) "https://play.nim-lang.org/#pasty=tTSqfZAI" => "https://play.nim-lang.org/#pasty=bIggSVFK"
23:18:16FromDiscord<aintea> sent a code paste, see https://play.nim-lang.org/#pasty=tMtIlHvm
23:19:02FromDiscord<aintea> looks a bit off, the conditions should be something like `(args@list).registered` for priority purposes
23:19:19FromDiscord<aintea> I don't remember the priority of the dot operator
23:20:02FromDiscord<griffith1deadly> sent a code paste, see https://play.nim-lang.org/#pasty=saudXXmC
23:20:03FromDiscord<aintea> `.` is higher priority so I will add a parenthesis just after
23:20:33FromDiscord<aintea> In reply to @griffith1deadly "so it's not a": no, but since I do `let choice = <the_macro_here>` it should all expand into what you wrote
23:21:04FromDiscord<griffith1deadly> In reply to @griffith1deadly "so it's not a": is that variant compiles fine? if so, your macro wrong somewhere
23:22:07FromDiscord<aintea> doesn't work
23:22:17FromDiscord<aintea> I get the `1 is int literal and has to be used or discarded`
23:22:59FromDiscord<griffith1deadly> sent a code paste, see https://play.nim-lang.org/#pasty=asbIKHKM
23:23:00FromDiscord<aintea> it does work if I surround the `if` expression with parenthesis
23:23:08FromDiscord<aintea> I just figured out yeah
23:23:10FromDiscord<griffith1deadly> it need to be `else` in that case
23:23:17FromDiscord<aintea> time to rewrite the macro
23:23:20FromDiscord<aintea> thanks for the help
23:42:45FromDiscord<aintea> the macro now works perfectly
23:42:56FromDiscord<aintea> I take back all of my take backs on macros
23:42:58FromDiscord<aintea> I love macros
23:43:27*skippy8 quit (Quit: WeeChat 4.5.2)
23:47:32*lucerne quit (Ping timeout: 272 seconds)
23:48:47*lucerne joined #nim
23:56:24*mahlon quit (Ping timeout: 272 seconds)
23:57:15*mahlon joined #nim