<< 07-07-2023 >>

00:05:31FromDiscord<arathanis> is there something I can check with `when defined(...)` for seeing if im in debug or release mode?
00:06:09FromDiscord<spotlightkid> `when (not) defined(release)`
00:06:28FromDiscord<arathanis> see i thought that too, but it doesnt work
00:06:43*sagax joined #nim
00:07:04FromDiscord<spotlightkid> see also `nim dump`
00:09:48FromDiscord<Elegantbeef> `when not defined(release)` certainly will work
00:10:00FromDiscord<Elegantbeef> `when not defined(debug)` does not though, might be a bug
00:10:11FromDiscord<arathanis> its not working for me, it always resolves to true regardless of being in release mode or otherwise
00:10:33FromDiscord<arathanis> `defined(release)` always resolves to trye
00:10:35FromDiscord<arathanis> (edit) "trye" => "true"
00:10:46*arkanoid joined #nim
00:10:47FromDiscord<Elegantbeef> You sure you dont have a config overriding what you're specifying?
00:11:01FromDiscord<arathanis> yes i made sure to check config.nims
00:11:04FromDiscord<spotlightkid> it doesn't work with `nim run`
00:11:11FromDiscord<arathanis> im not using nim run
00:11:30FromDiscord<Elegantbeef> Did you check all configs the compiler mentions?
00:11:38FromDiscord<arathanis> im reading over them now
00:11:49FromDiscord<Elegantbeef> How are you compiling?
00:12:19FromDiscord<arathanis> `nim c --app:gui -d:someStrDefines:someValues src.nim`
00:12:26FromDiscord<arathanis> with or w/o `-d:release`
00:14:27FromDiscord<arathanis> figured it out, im an idiot 👍
00:14:56FromDiscord<arathanis> and/or precedence bites me in the ass once again
00:57:27*rockcavera quit (Remote host closed the connection)
01:08:21*jmdaemon quit (Ping timeout: 245 seconds)
01:11:17FromDiscord<arathanis> does nim have an equivalent to `file` in python?
01:11:56FromDiscord<Elegantbeef> `currentSourcePath()`?
01:13:30FromDiscord<arathanis> does that work in config.nims?
01:13:40FromDiscord<Elegantbeef> No clue
01:14:07FromDiscord<arathanis> it does 👍
01:14:08FromDiscord<arathanis> thanks
01:18:38FromDiscord<arathanis> sent a code paste, see https://play.nim-lang.org/#ix=4zVI
01:19:03FromDiscord<Elegantbeef> No and that's cursed
01:19:22FromDiscord<arathanis> normally I would agree but in this particular case it isn't :/
01:19:28FromDiscord<arathanis> it's cursed until it isn't
02:24:35FromDiscord<michaelb.eth> In reply to @arathanis "normally I would agree": is it possibly something that you could check at compile-time with `compiles(...)`?
02:27:54FromDiscord<ringabout> What's with this error?
02:27:59FromDiscord<ringabout> https://media.discordapp.net/attachments/371759389889003532/1126701114499272754/image.png
02:30:06FromDiscord<arathanis> In reply to @michaelb.eth "is it possibly something": its iterating over a bunch of windows registry subkeys and loading 2 specific values from each one for a comparison. if the keys dont exist (and they wont for some of the subkeys) then an OSError is thrown.↵↵Now I could painstakingly iterate over the values, ensuring the two I need exist using HashSets for example (or simply find w/ seq) or I could just load the values and if o
02:30:52FromDiscord<michaelb.eth> I see
02:31:06FromDiscord<ringabout> In reply to @ringabout "What's with this error?": Seems that my local packages.json is outdated.,
03:06:32nisstyredoes there exist a macro or something like (apply f xs) in scheme for Nim? takes a function that takes some arguments and calls it with the values of xs as the args
03:06:36nisstyrefeel like I need this
03:06:45nisstyreI suppose it's easy to do with a macro or template
03:07:06FromDiscord<Elegantbeef> Yea it's easy to do with a macro
03:07:12FromDiscord<Elegantbeef> There is nothing presently
03:07:16nisstyreok just wanted to check if it exists in some lib
03:07:20nisstyrecool
03:07:25nisstyreI'll try to make one
03:07:35FromDiscord<Elegantbeef> Actually i guess maybe `macros.unpackVarargs` might depending what you're meaning
03:07:43nisstyreI'll take a look thanks
03:08:27nisstyrehmm maybe
03:08:36nisstyrebut I'm not sure what varargs does
03:09:02FromDiscord<michaelb.eth> https://nim-lang.org/docs/manual.html#types-varargs
03:09:17FromDiscord<Elegantbeef> Inside a macro/template `varargs[typed]` or `varargs[untyped]` allows you to take a list of different typed arguments
03:09:37nisstyreok this might work, thanks
03:09:37FromDiscord<Elegantbeef> it converts it into a `nnkBracket` internally so `[a, b, c]` but you can write `apply(fn, a, b,c, d, e, ef)`
03:09:47nisstyreyeah
05:09:00*azimut_ joined #nim
05:10:38*azimut quit (Ping timeout: 240 seconds)
06:47:55FromDiscord<demotomohiro> Is it possible to run code after compilation in `config.nims` in same directory as .nim file?
07:58:28*ltriant quit (Ping timeout: 240 seconds)
08:12:12FromDiscord<4zv4l> will asyncnet eventually start a new thread if there are too many clients connected to an async socket or async tasks ?↵a bit like tokio in rust ?
08:12:31FromDiscord<Elegantbeef> Nope
08:13:15FromDiscord<4zv4l> is there a library to do this ?
08:13:30FromDiscord<4zv4l> because that would allow to very easily scale the program
08:14:09FromDiscord<Elegantbeef> Not that I know of, moving futures across threads is not a simple task afaik
08:14:25FromDiscord<Elegantbeef> But i dont thread or use async
08:55:55*ntat joined #nim
09:11:10*jmdaemon joined #nim
09:29:48FromDiscord<mratsim> In reply to @Elegantbeef "Not that I know": They use ref, so it's a no-go unless you pass --mm:atomicRef and even then I'm not too sure
09:30:07FromDiscord<mratsim> (edit) "In reply to @Elegantbeef "Not that I know": They use ref, so it's a no-go unless you pass --mm:atomicRef and even then I'm not too sure ... " added "how to change asyncdispatch to use a threadpool."
09:32:58*azimut_ quit (Ping timeout: 240 seconds)
09:45:50*jmdaemon quit (Ping timeout: 260 seconds)
09:55:04*ltriant joined #nim
09:59:50*ltriant quit (Ping timeout: 260 seconds)
11:04:02*arkanoid quit (Ping timeout: 246 seconds)
11:13:38*arkanoid joined #nim
11:17:56*arkanoid quit (Ping timeout: 245 seconds)
11:26:37*arkanoid joined #nim
11:31:55*arkanoid quit (Ping timeout: 250 seconds)
11:32:55*arkanoid joined #nim
11:40:26*arkanoid quit (Ping timeout: 245 seconds)
11:47:34ntatIs it possible to make array with objects? Somthing like this: var persons: array[5, object]
11:47:47ntator this: var persons: array[5, object(string, string, int)]
11:50:30FromDiscord<odexine> Needs to be defined as a type of
11:50:37FromDiscord<odexine> Nim has no anonymous objects
11:50:46FromDiscord<odexine> Tuples can emulate it but it isn’t the same
11:51:00ntatOK, thanks :)
11:52:17FromDiscord<odexine> In reply to @odexine "Needs to be defined": remove the last word here I don’t know where it came from
11:58:52FromDiscord<spotlightkid> sent a code paste, see https://play.nim-lang.org/#ix=4zXW
11:59:34FromDiscord<odexine> ? Yes that works, do you have a question?
12:00:20FromDiscord<spotlightkid> No, I was just giving an example. I had already typed it before your answer, so I though I might as well post it.
12:00:40FromDiscord<odexine> Ah I see, I thought something was wrong
12:01:46ntatodexine, I make type for Person and now I want to collect objects in Persons array. Should my code look like this? Sorry for ideone, but playground shut down. https://ideone.com/Eh1w2A
12:02:05FromDiscord<odexine> It’s fine, I’ll look in a moment
12:02:22FromDiscord<odexine> PMunch: playground down again it seems?
12:03:08FromDiscord<odexine> In reply to @ntat "<@259277943275126785>, I make type": Do you know the amount of people you want to put into the array on compile time? AKA, before compiling the code?
12:04:11ntatodexine, now I know - my program generate 5 persons :)
12:07:29*disso-peach joined #nim
12:09:09FromDiscord<odexine> In reply to @ntat "<@259277943275126785>, now I know": Always? Then the annotation should look like this array[5, Person]
12:12:15ntatodexin, right, it works, thanks :)
12:18:12*arkanoid joined #nim
12:23:21*arkanoid quit (Ping timeout: 245 seconds)
12:44:39NimEventerNew Nimble package! beautifulparser - Simple parser for HTML, see https://github.com/TelegramXPlus/beautifulparser
13:37:05*ltriant joined #nim
13:41:41*ltriant quit (Ping timeout: 245 seconds)
14:11:26*ltriant joined #nim
14:16:12*ltriant quit (Ping timeout: 252 seconds)
14:46:59*ltriant joined #nim
14:51:53*ltriant quit (Ping timeout: 246 seconds)
14:56:00*ntat_ joined #nim
14:57:38*ntat quit (Ping timeout: 252 seconds)
14:57:43*ntat_ is now known as ntat
15:21:49*ltriant joined #nim
15:26:41*ltriant quit (Ping timeout: 245 seconds)
15:43:49*ovenpasta joined #nim
15:53:45*ltriant joined #nim
15:58:21*ltriant quit (Ping timeout: 245 seconds)
16:28:02*ltriant joined #nim
16:32:54*ltriant quit (Ping timeout: 246 seconds)
16:34:54*oldpcuser joined #nim
16:39:30*rockcavera joined #nim
16:55:09*ltriant joined #nim
16:55:25FromDiscord<ac1original> Which IDE do you all use? I tried using Visual Studio Code, but I'm not a fan because the tab completion, or whatever it's called, isn't good. Can anyone recommend something good to me?
16:55:28FromDiscord<ac1original> thx :)
17:00:18*ltriant quit (Ping timeout: 260 seconds)
17:02:25*azimut joined #nim
17:07:07*jmdaemon joined #nim
17:08:48*rockcavera quit (Remote host closed the connection)
17:12:08FromDiscord<rakgew> @ac1original as cli editor I use micro, as gui ide I use pycharm with nim plugin. I am quite happy with either of them, but of course ymmv.
17:13:47FromDiscord<bottle6090> I was using VSCode for a long time. I just actually got Neovim set up (NVChad framework) so if I like it I’ll be moving to that
17:14:01FromDiscord<nervecenter> Sublime with Nimlime and Terminus, not as feature-rich as VSC but Sublime's build-in features can do a lot of heavy lifting. On Linux, the LSP doesn't seem to work. :S
17:14:10FromDiscord<nervecenter> (edit) "build-in" => "built-in"
17:16:10FromDiscord<bottle6090> In reply to @bottle6090 "I was using VSCode": Though I haven’t tried it with Nim as of yet
17:28:26*ltriant joined #nim
17:33:06*ltriant quit (Ping timeout: 246 seconds)
17:40:32FromDiscord<patitotective> In reply to @nervecenter "Sublime with Nimlime and": there's a new nim package for sublime, it's called nimplus and for me the lsp works
17:44:30FromDiscord<patitotective> sent a code paste, see https://play.nim-lang.org/#ix=4zZX
18:03:08*ltriant joined #nim
18:07:53*ltriant quit (Ping timeout: 246 seconds)
18:40:12*ltriant joined #nim
18:45:15*ltriant quit (Ping timeout: 250 seconds)
18:47:25*ntat quit (Quit: Leaving)
18:47:52FromDiscord<Andreas> In reply to @rakgew "<@872921450691067924> as cli editor": PyCharm is nice and SublimeText has good Nim-support, too.
18:54:30*ntat joined #nim
19:13:31FromDiscord<bostonboston> I use intellij with the plugin, I have a lot of hopes for it
19:16:50*ltriant joined #nim
19:21:41*ltriant quit (Ping timeout: 245 seconds)
19:24:59FromDiscord<michaelb.eth> In reply to @ac1original "Which IDE do you": Emacs with nim-mode and lsp-mode, the latter making use of nimlangserver installed via nimble
19:29:20FromDiscord<michaelb.eth> I prefer to run Emacs in a terminal rather than use its native window graphics, so I run it in Kitty: https://sw.kovidgoyal.net/kitty/
19:33:11FromDiscord<Andreas> In reply to @michaelb.eth "Emacs with nim-mode and": its not yet open-sourced, so nobody can help out..
19:33:35FromDiscord<michaelb.eth> What is not open sourced yet?
19:33:47FromDiscord<Andreas> The PyCharm - its not yet open-sourced, so nobody can help out..
19:34:16FromDiscord<Andreas> (edit) "The PyCharm ... -" added "plugin"
19:34:30FromDiscord<michaelb.eth> Oh, well someone else mentioned pycharm, not me, but I get your point
19:36:26FromDiscord<Andreas> In reply to @michaelb.eth "Oh, well someone else": i answered the wrong msg - i'd like to improve SublimeText with a proper Outline-mode. There is one, but i'd like Nim-types and type-bound procs/funcs in that outline - plus Enums.
19:38:06FromDiscord<Andreas> therefore i need to either write a parser or use nim/compiler as a library - and smth. changed here recently - i'm on devel and when i import the parser-stuff i think it uses the stable-sources ?
19:38:27FromDiscord<Andreas> (edit) "stable-sources" => "stable-modules"
19:39:12FromDiscord<Andreas> (edit) "therefore i need to either write a parser or use nim/compiler as a library - and smth. changed here recently - i'm on devel and when i import the parser-stuff i think it uses the stable-modules ? ... " added "@beef"
19:51:11*ltriant joined #nim
19:52:11FromDiscord<Elegantbeef> @Andreas\: what?
19:55:53*ltriant quit (Ping timeout: 250 seconds)
19:56:13FromDiscord<Andreas> In reply to @Elegantbeef "<@754284517316886598>\: what?": i'f like to add some editor-support to SublimeText - i nned to parse nim-code and would like to use nim/compiler as a library. I'm on devel and i found `parser.parseString` - which might be all i need. But i'm not sure if it uses the devel `compiler-modules` and i don't know if or how i can use the `macros`-modul to extract symbols/signatures form the `PNode` that the parser retu
19:56:24FromDiscord<Andreas> (edit) "nned" => "need"
19:56:57FromDiscord<Andreas> (edit) "i'f" => "i'd"
19:57:24*ntat quit (Quit: Leaving)
19:57:41FromDiscord<Elegantbeef> Yea no clue
19:58:10FromDiscord<Andreas> In reply to @Elegantbeef "Yea no clue": you're lying in the public - sham,e on you 🙂
19:58:23FromDiscord<Andreas> (edit) "sham,e" => "shame"
19:58:42FromDiscord<Elegantbeef> Why not just setup the nimlsp?
19:59:31FromDiscord<Andreas> In reply to @Elegantbeef "Why not just setup": 'cos i want to improve the outline-view with a sorted list of types and type-bound-procs/funcs...
20:00:29FromDiscord<Andreas> (edit) "In reply to @Elegantbeef "Why not just setup": 'cos i want to improve the outline-view with a sorted list of types and type-bound-procs/funcs... ... " added "which even PyCharm does not."
20:25:16*ltriant joined #nim
20:30:01*ltriant quit (Ping timeout: 245 seconds)
21:00:20*ltriant joined #nim
21:05:01*ltriant quit (Ping timeout: 245 seconds)
21:24:47FromDiscord<.bobbbob> im looking at parsexml in std, I can open xml files, but how can I write the XmlParser back to a file?
21:32:43*ltriant joined #nim
21:37:24*ltriant quit (Ping timeout: 246 seconds)
22:07:13*ltriant joined #nim
22:09:50*sagax quit (Read error: Connection reset by peer)
22:12:06*ltriant quit (Ping timeout: 245 seconds)
22:44:17*ltriant joined #nim
22:49:09*ltriant quit (Ping timeout: 246 seconds)
23:01:28*ovenpasta quit (Ping timeout: 240 seconds)
23:17:49*ltriant joined #nim
23:22:32*ltriant quit (Ping timeout: 246 seconds)
23:43:53*sagax joined #nim
23:44:44FromDiscord<treeform> @.bobbbob you would probably use https://nim-lang.org/docs/xmltree.html#%24%2CXmlNode
23:56:57*ltriant joined #nim