<< 31-01-2022 >>

00:05:36*tk quit (Quit: Well, this is unexpected.)
00:06:00*tk joined #nim
00:25:38FromDiscord<geekrelief> In reply to @ynfle "Why is the signature": If the signature for echo was `varargs[string, ``$``]` then it would only accept strings as parameters. But `varargs[typed]` means it'll match any type.
00:27:39FromDiscord<ynfle> In reply to @geekrelief "If the signature for": No. `$` converts to string
00:28:17FromDiscord<geekrelief> This is weird. I'm passing `nil` to a macro taking `varargs[untyped]` and testing it with `.isNil` returns true. https://play.nim-lang.org/#ix=3O5h But if I set the arg type to `untyped`, `.isNil` is false.
00:28:29FromDiscord<geekrelief> In reply to @ynfle "No. `$` converts to": right
00:29:01FromDiscord<geekrelief> If the type is not a string it gets converted with `$`
00:37:20FromDiscord<geekrelief> nvm, I guess I'm mistaken seems like `echo` takes `varargs[typed, ``$``]` as a special case. https://nim-lang.github.io/Nim/manual.html#types-varargs `varargs[typed] is treated specially: It matches a variable list of arguments of arbitrary type but always constructs an implicit array. This is required so that the builtin echo proc does what is expected:`
00:38:06FromDiscord<geekrelief> sent a code paste, see https://play.nim-lang.org/#ix=3O5n
00:40:48FromDiscord<ynfle> In reply to @geekrelief "If the type is": Ya
00:41:04FromDiscord<ynfle> Right
00:59:06*vicecea quit (Remote host closed the connection)
00:59:36*vicecea joined #nim
01:04:59*Mister_Magister quit (Quit: bye)
01:06:42*Mister_Magister joined #nim
01:18:06FromDiscord<ajusa> My Nim compile times are getting kind of slow (5-10 seconds), any ideas as to what I can do to speed it up? tcc doesn't compile this code in my case
01:18:56FromDiscord<Elegantbeef> Fewer macros
01:19:02FromDiscord<Elegantbeef> Got the code hosted somewhere?
01:19:28FromDiscord<Patitotective> In reply to @Elegantbeef "Fewer macros": But macros do not affect compiled binary speed, right?
01:19:41FromDiscord<Elegantbeef> They are compile time only so of course not
01:19:59FromDiscord<Elegantbeef> They can actually increase runtime as they can do things more optimized than one would want to write by hand
01:20:19FromDiscord<Elegantbeef> But the macro would have to emit the optimized logic of course 😛
01:20:45FromDiscord<ajusa> In reply to @Elegantbeef "Got the code hosted": Nope, it's just a small Jester app. I'll assume the Jester macros are the cause lol, I've seen others complain
01:20:48FromDiscord<evoalg> so increase the runtime speed (or reduce runtime time) right?
01:21:28FromDiscord<evoalg> "They can actually increase runtime"
01:21:32FromDiscord<Elegantbeef> Well you can make macros that allow you to abstract low level optimizations to appear like you'd normally write
01:21:39FromDiscord<Elegantbeef> increase runtime speed\
01:21:51FromDiscord<ajusa> guess I'll wait for incremental compilation. I think the status guys have it worse, they've got builds that take minutes
01:21:54FromDiscord<Elegantbeef> An example of that is https://github.com/liquidev/datarray
01:22:30FromDiscord<Elegantbeef> Well a 10% compile speedup can be found by commenting out two checks in Nim if you want a bit faster
01:22:58FromDiscord<Elegantbeef> Also you can build a danger compiler with lto
01:23:05FromDiscord<Elegantbeef> You can get a bit faster than stock Nim
01:23:45FromDiscord<ajusa> Apparently gc orc compiler is faster too, but it didn't work last I checjed
01:23:50FromDiscord<ajusa> (edit) "checjed" => "checked"
01:24:02FromDiscord<Elegantbeef> Build a compiler with danger LTO and comment out https://github.com/nim-lang/Nim/blob/devel/compiler/vmgen.nim#L2057-L2062
01:24:06FromDiscord<Elegantbeef> You can get a few seconds chopped off
01:24:27FromDiscord<Elegantbeef> I know with CPS tests with just commenting out those two string checks i got a 10% speed boost
01:24:37FromDiscord<Elegantbeef> In the case of macro heavy code that'll make you go faster
01:24:58FromDiscord<Elegantbeef> Yes your compiler wont be able to use marshal at compile time, but find me a person that uses marshal and i'll show you a madman
01:25:27FromDiscord<Elegantbeef> That 10% speed boost was from like 11 seconds down to 9 seconds
01:25:41FromDiscord<ajusa> Fair enough lol. I'm also using includes and templates pretty heavily, would that add a ton to compile time?
01:25:57FromDiscord<Elegantbeef> Templates are cheap, includes will add
01:26:08FromDiscord<Elegantbeef> templates are not VM based, they're just replace AST
01:26:50FromDiscord<ajusa> It's probably the includes then, Jester's extend macro just copies the code so the imports it has in a different file aren't copied over. I replaced my imports with includes to get around that but now I have slow compiles
01:27:33FromDiscord<Elegantbeef> Includes causes resemming of all the included code
01:27:46FromDiscord<Elegantbeef> Atleast i think it does
01:28:03FromDiscord<Elegantbeef> `export` exists
01:28:17FromDiscord<ajusa> In reply to @Elegantbeef "`export` exists": Well uh
01:28:23FromDiscord<ajusa> I forgot
01:28:41FromDiscord<Elegantbeef> If you're including imports it's not too bad
01:28:50FromDiscord<Elegantbeef> But using include a lot is just ugly
01:28:59FromDiscord<ajusa> Nah I'm including entire files filled with macros
01:29:06FromDiscord<ajusa> (edit) "Nah I'm including entire files filled with ... macros" added "Jester"
01:29:10FromDiscord<Elegantbeef> Then yea knock it off
01:29:48FromDiscord<ajusa> In my defense I thought includes were cheap and templates were expensive. I learned something new today, thanks mr beef
01:37:19FromDiscord<exelotl> In reply to @Elegantbeef "Build a compiler with": ooh I'll have to try this
01:37:57FromDiscord<exelotl> (do replies show in matrix?)
01:42:27FromDiscord<Rika> Kinda afaik
01:44:06FromDiscord<huantian> this is what it looks like on element https://media.discordapp.net/attachments/371759389889003532/937523601270259782/unknown.png
01:51:24FromDiscord<Elegantbeef> Depending on what you're doing you might not get much speed increase from commenting out the marshal stuff↵(@exelotl)
02:00:50*vicfred joined #nim
02:18:34*neurocyte0917090 quit (Ping timeout: 260 seconds)
02:36:10*cyraxjoe quit (Quit: I'm out!)
02:36:18*noeontheend joined #nim
02:36:24*rienske quit (Ping timeout: 256 seconds)
02:38:03*cyraxjoe joined #nim
02:39:43*rienske joined #nim
02:41:51*noeontheend quit (Ping timeout: 256 seconds)
03:06:33*arkurious quit (Quit: Leaving)
03:48:58FromDiscord<ynfle> How do I run testament for one file? `./koch tests filepath` doesn't work
03:50:24FromDiscord<ynfle> If the current devel is failing the CI, how am I supposed to know if I broke anything?
03:50:35FromDiscord<ynfle> In reply to @ynfle "How do I run": Beef, do you know?
03:53:40FromDiscord<Elegantbeef> Comically i do not
03:57:02FromDiscord<ynfle> It's `./koch tests run filepath`
03:58:44*Gustavo6046 joined #nim
04:15:55*cyraxjoe quit (Quit: I'm out!)
04:17:55*cyraxjoe joined #nim
04:23:26FromDiscord<ynfle> It's frustrating when the CI is failing
04:23:47FromDiscord<ynfle> (edit) "It's frustrating when the CI is failing ... " added "before a PR. It's hard to know if the PR breaks anything"
04:23:54*cyraxjoe quit (Ping timeout: 250 seconds)
04:24:35*cyraxjoe joined #nim
04:25:14FromDiscord<Elegantbeef> You generally can look at the logs to see
04:25:34FromDiscord<Elegantbeef> this could be caused by your changes
04:26:40FromDiscord<ynfle> Seems similar logs to the previous commit
04:26:48FromDiscord<ynfle> Anyway
04:26:49FromDiscord<ynfle> GN
04:26:55FromDiscord<Elegantbeef> Then possibly just CI issue
05:07:09*vicfred quit (Quit: Leaving)
05:42:05*jkl1337 quit (Quit: Gone.)
05:43:28*jkl joined #nim
06:27:50*Lord_Nightmare quit (Ping timeout: 250 seconds)
06:47:52*PMunch joined #nim
06:48:54*Mister_Magister quit (Read error: Connection reset by peer)
06:50:37*Mister_Magister joined #nim
06:50:59*jjido joined #nim
07:25:49*Mister_Magister quit (Quit: bye)
07:27:46*Mister_Magister joined #nim
07:37:26*Mister_Magister quit (Quit: bye)
07:40:17*Mister_Magister joined #nim
07:42:39FromDiscord<Bung> why this does
07:43:02FromDiscord<Bung> not have japanese channel, I see a lot japanese developers use nim
08:10:56PMunchLike a japanese chat room?
08:16:11*Mister_Magister quit (Ping timeout: 256 seconds)
08:16:57*Mister_Magister joined #nim
08:25:49FromDiscord<Rika> They have their own discord
08:25:55FromDiscord<Rika> Server I mean
08:28:42FromDiscord<Bung> in Language-specific
08:29:45FromDiscord<Rika> Yes I know what you mean
08:34:13*mjsir911 quit (Ping timeout: 268 seconds)
08:34:13*oddish quit (Ping timeout: 268 seconds)
08:34:43*mjsir911 joined #nim
08:35:27*nixfreaknim[m] quit (Ping timeout: 268 seconds)
08:35:27*happycorsair[m] quit (Ping timeout: 268 seconds)
08:35:28*emery quit (Ping timeout: 268 seconds)
08:35:28*Yardanico quit (Ping timeout: 268 seconds)
08:35:34*Yardanico joined #nim
08:36:04*crem1 quit (Ping timeout: 268 seconds)
08:36:20*ehmry joined #nim
08:37:38*crem1 joined #nim
08:39:22*happycorsair[m] joined #nim
08:46:53*tk quit (Quit: Well, this is unexpected.)
08:47:20*nixfreaknim[m] joined #nim
08:57:25*tk joined #nim
09:07:05FromDiscord<Bung> does github has bug ? diff in pr , I see base master is not new version master
09:19:56*Gustavo6046 quit (Quit: Leaving)
09:25:23FromDiscord<Goel> Does Nim have any implementation of a Vector2-SIMD in any of the official Modules?
09:32:31PMunchYou can look into nimsimd, or arraymancer. I don't think there's any such modules in the standard library
09:33:10FromDiscord<Elegantbeef> Thre isnt anything simd in the stdlib
09:34:10FromDiscord<Elegantbeef> https://github.com/GaryM-exkage/slam if you just want vectors
09:39:59*notchris quit (Ping timeout: 250 seconds)
09:41:17FromDiscord<Rika> Is this the one we helped name I forget
09:41:55FromDiscord<Elegantbeef> Yea
09:44:06*notchris joined #nim
09:47:25PMunchHmm, all webcams are so crap, I'm seriously considering to start using my old (or new) phone instead..
09:47:39FromDiscord<Rika> Well that’s one option
09:47:46FromDiscord<Rika> Getting the output reliably is difficult
09:47:58PMunchEh, DroidCam works fine
09:48:01FromDiscord<Elegantbeef> droidcam is easy
09:48:12FromDiscord<Rika> I’m not an Android user so I don’t relate xd
09:48:50FromDiscord<Rika> Well I mean I am
09:48:55FromDiscord<Rika> But I don’t daily drive it anymore
09:49:10FromDiscord<Elegantbeef> Pmunch do you know if the kate text editor supports errors over LSP?
09:49:22FromDiscord<Elegantbeef> I'm still waiting for a response from the KDE matrix apparently no one knows
09:49:38PMunchI have no idea
09:50:28FromDiscord<Rika> Do you use Kate?
09:50:34FromDiscord<Elegantbeef> Trying it out now
09:50:44*jjido quit (Quit: My MacBook Air has gone to sleep. ZZZzzz…)
09:50:48FromDiscord<Rika> It’s okay
09:50:54PMunchWhat kind of errors are you thinking of?
09:52:10FromDiscord<Elegantbeef> Error reporting of any variety
09:53:12FromDiscord<Elegantbeef> With LSP and the new update it's surprisngly good
09:53:34PMunchThe new update?
09:53:35FromDiscord<Elegantbeef> But minor issues like tab being accept suggestion and not having any idea if what i'm writing is going to compiler
09:53:50FromDiscord<Rika> > tab being accept ↵Cursed
09:53:53FromDiscord<Elegantbeef> Yea kate got some major updates recently
09:54:05FromDiscord<Elegantbeef> Tell me about it go to indent and it just accepts
09:54:09FromDiscord<Elegantbeef> I've never liked it
09:54:49FromDiscord<Elegantbeef> Dont know if i missed a setting but can disable that either
09:54:54FromDiscord<creikey> In reply to @Elegantbeef "Yea kate got some": vscode lagging makes me sad if kate can do what it can that would be great
09:55:05FromDiscord<Elegantbeef> So some finicky things but otherwise a good experience
09:55:17FromDiscord<Elegantbeef> Well try out kate
09:55:32FromDiscord<creikey> I'm assuming the nim support is over lsp
09:55:39FromDiscord<Elegantbeef> Yeaa
09:55:48FromDiscord<creikey> I just need ctrl + click to go to something and then renaming symbols is useful
09:56:00FromDiscord<Elegantbeef> No clue about the renaming symbols
09:56:06FromDiscord<Elegantbeef> Dont know if the LSP supports that
09:56:09FromDiscord<creikey> aw dang
09:56:16FromDiscord<creikey> I could honestly probably just use a riced out neovim
09:56:20FromDiscord<Elegantbeef> I know kate does but dont know about nimlsp
09:56:31FromDiscord<creikey> so annoying to maintain those configs though
09:57:11FromDiscord<creikey> I guess there's also sublime text editor
09:57:14FromDiscord<Waldecir Santos> How do you guys run tests within vscode, do we have any test explorer integration ?
09:57:22FromDiscord<Elegantbeef> `nimble test`
09:58:25FromDiscord<creikey> if only clion had nim support
09:58:43FromDiscord<Elegantbeef> Jetbrains has a nim addon
09:59:13FromDiscord<creikey> oh wow
09:59:32FromDiscord<creikey> it feels like nim is very unpopular but then stuff like this exists
10:00:17FromDiscord<Rika> It is not very good, the add on
10:00:27FromDiscord<Waldecir Santos> In reply to @Elegantbeef "`nimble test`": But no vscode integration right ? also I'm studying with https://exercism.org so they don't have nimble, any advice ?
10:00:33FromDiscord<Elegantbeef> Yea they're not using nimsuggest or the lsp an doing it all from start
10:00:50FromDiscord<creikey> Oh there is that other text editor that replicates the vscode api
10:00:51FromDiscord<Elegantbeef> i dont get why tests need intergration with an editor
10:00:56FromDiscord<creikey> really why is vscode lagging for me
10:01:01FromDiscord<Elegantbeef> Just run the code and ensure you get expcted values
10:01:04FromDiscord<creikey> like half the time when I type it lags by 1-2 seconds
10:01:04FromDiscord<Bung> rename is defined in lsp
10:01:15FromDiscord<Elegantbeef> Well it doesnt work with kate
10:01:34FromDiscord<Phil> Huh, my main gripe with vscode is that sometimes the intellisense just randomly takes >10 seconds to throw suggestions out
10:01:44FromDiscord<Rika> In reply to @creikey "Oh there is that": Which, onivim?
10:01:55FromDiscord<creikey> In reply to @Rika "Which, onivim?": yeah I think that's what I'm thinking of
10:01:55FromDiscord<Phil> (edit) "out" => "out↵That sometimes being 75% of the time"
10:01:57FromDiscord<Elegantbeef> Onivim2 is the one i know of
10:02:04FromDiscord<creikey> I looked into that project it seems very strange
10:02:09FromDiscord<creikey> weird programming language
10:02:13FromDiscord<creikey> all new ui etc
10:02:14FromDiscord<Waldecir Santos> In reply to @Elegantbeef "i dont get why": It dosen't it's just to make it "easier", that's all.
10:02:18FromDiscord<Rika> Really would have liked it more if it based off of neovim than vim
10:02:23FromDiscord<creikey> when I tried to compile their languages compiler it took 10 minutes on my machine then failed
10:02:31FromDiscord<Elegantbeef> Hit f6 waldecir
10:02:37FromDiscord<Elegantbeef> Or is it f5 to run current filee
10:02:40FromDiscord<Elegantbeef> Dont recall atm
10:02:47FromDiscord<Bung> the lsp slow because it need compile whole module and its dependencies to graph I think
10:02:57FromDiscord<creikey> In reply to @Bung "the lsp slow because": I was talking about onivim 2
10:03:06FromDiscord<Waldecir Santos> In reply to @Elegantbeef "Hit f6 waldecir": F6 is the key, but it dosen't run the tests just the file
10:03:21FromDiscord<creikey> well really like
10:03:23FromDiscord<Elegantbeef> Wait what are you testing?
10:03:24FromDiscord<creikey> how hard would it be
10:03:26FromDiscord<creikey> to make a really awesome nim ide
10:03:28FromDiscord<Waldecir Santos> But I can probably create a task for that
10:03:29FromDiscord<creikey> in nim
10:03:48FromDiscord<Waldecir Santos> In reply to @Elegantbeef "Wait what are you": I'm studying nim at the moment, so this
10:03:50FromDiscord<Waldecir Santos> https://media.discordapp.net/attachments/371759389889003532/937649363633713202/unknown.png
10:04:11FromDiscord<Bung> I dont know how the IC progress is going
10:04:25FromDiscord<creikey> In reply to @Waldecir Santos "I'm studying nim at": for vscode I just have ctrl+shift+b run `build.bat` in the project root then put whatever I want to do in ther
10:04:27FromDiscord<creikey> (edit) "ther" => "there"
10:04:30FromDiscord<creikey> nice no brain configuration
10:04:42FromDiscord<Elegantbeef> I mean running the file on the right will test it
10:05:31FromDiscord<Elegantbeef> Eh i'm weird generally so disregard me
10:05:38FromDiscord<Waldecir Santos> true but I'll need to switch to that file, but I can probably use @creikey solution or just create a new keybind
10:06:19FromDiscord<creikey> sent a code paste, see https://play.nim-lang.org/#ix=3O7a
10:07:17*jmdaemon quit (Ping timeout: 250 seconds)
10:07:55FromDiscord<Waldecir Santos> Thank you @creikey I'll try that.
10:16:14FromDiscord<tandy> im iterating over a `Table[string, object]` using `pairs`, how can i do something different for the last iteration?
10:17:05FromDiscord<Elegantbeef> store the key then do something at the last iteration
10:17:10FromDiscord<Elegantbeef> after the last\
10:17:18FromDiscord<tandy> truu
10:18:15FromDiscord<tandy> but how will i know when ive reached the last iteration
10:18:45FromDiscord<Rika> I suddenly have a compulsion to write a Nim formatter that doesn’t use Nim pretty itself
10:18:56FromDiscord<Elegantbeef> You just always store the key
10:19:05FromDiscord<Elegantbeef> Then after the iterating you do custom logic
10:19:24FromDiscord<Elegantbeef> Alternatively you do `keys.toSeq` then iterate over that and
10:19:36FromDiscord<Michal Maršálek> typedesc arguments in macros are converted to NimNodes, right? Is there a way to acess the type itself? Something like static typedesc?
10:19:56FromDiscord<Elegantbeef> `myTypeDesc[^1]`.getType\`
10:19:59FromDiscord<tandy> oh you mean for every item?
10:20:05FromDiscord<Elegantbeef> Yes
10:20:33FromDiscord<Elegantbeef> you can also use `len`
10:21:21FromDiscord<Elegantbeef> sent a code paste, see https://play.nim-lang.org/#ix=3O7f
10:21:33FromDiscord<tandy> i think this will probably be the best way
10:21:42FromDiscord<Elegantbeef> I think you can also use \`std/enumerate
10:22:11FromDiscord<Elegantbeef> sent a code paste, see https://play.nim-lang.org/#ix=3O7g
10:22:27FromDiscord<Elegantbeef> Dont recall if it works for mutable variables
10:22:44FromDiscord<Elegantbeef> Actually it's not mutable what am i on about
10:23:50FromDiscord<tandy> this is nice
10:24:01FromDiscord<tandy> thanks beefboss
10:24:15FromDiscord<tandy> join nimskull chat \:)↵(@Rika)
10:35:36Amun-Rabtw, I didn't know you can reuse argument variable name in function, as in: proc doo(bar: int): var bar = bar
10:35:50FromDiscord<Elegantbeef> Ah shadowing is lovely
10:36:42FromDiscord<Michal Maršálek> In reply to @Elegantbeef "`myTypeDesc[^1]`.getType\`": I don't understand. Seems like gettype returns a NimNode?
10:37:26FromDiscord<Elegantbeef> It does
10:37:36FromDiscord<Rika> In reply to @tandy "join nimskull chat \:)": I’ve been meaning to
10:37:55FromDiscord<Elegantbeef> You want the type passed into a macro statically?
10:37:59FromDiscord<Rika> I’ll join in a bit perhaps
10:38:00*jjido joined #nim
10:39:24FromDiscord<Elegantbeef> Depending on waht you're doing but yes
10:39:24FromDiscord<evoalg> I read somewhere that this is idiomatic for Nim↵(<@709044657232936960_=41mun-=52a=5b=49=52=43=5d>)
10:39:39FromDiscord<Elegantbeef> Though i think it should emit a hint
10:41:49FromDiscord<Michal Maršálek> In reply to @Elegantbeef "You want the type": yes
10:42:40FromDiscord<Elegantbeef> I dont think you can do that without a template that emits the macro in that way
10:44:07FromDiscord<Michal Maršálek> What does that mean?
10:46:46FromDiscord<tandy> worth reading this i think↵https://github.com/nim-works/nimskull/discussions/113↵(@Rika)
10:46:57FromDiscord<Elegantbeef> sent a code paste, see https://play.nim-lang.org/#ix=3O7o
10:47:08FromDiscord<Michal Maršálek> I thought I could shift the type into a generic param but ig macros cant be generic?
10:47:48FromDiscord<Elegantbeef> Indeed doesnt make sense
10:49:30FromDiscord<Michal Maršálek> sent a code paste, see https://play.nim-lang.org/#ix=3O7p
10:50:58FromDiscord<evoalg> gosh even `for i, x, y in enumerate mytable:` works
10:58:38FromDiscord<Michal Maršálek> sent a code paste, see https://play.nim-lang.org/#ix=3O7u
10:59:42FromDiscord<Rika> In reply to @tandy "worth reading this i": That’s a lot already done
11:08:53FromDiscord<haxscramper> to be more specific it requires https://github.com/nim-works/nimskull/discussions/139, but that is blocked by the VM using AST for it's operation, so the code is really messy all over the place
11:10:00FromDiscord<haxscramper> right now there is simply not enough information to make formatter useful
11:10:29FromDiscord<bestman 8> would nim be a good option for deploying ml models for desktop apps
11:11:29PMunch@bestman_8, I'd say so. It's a systems programming language with great performance so should work well for that
11:11:37PMunchWhat kind of deployment are you thinking?
11:12:36FromDiscord<bestman 8> mostly just making a model with python and importing and running it in nim (the other option is rust and i dont really like rust)
11:13:58PMunchAre you making it in Python for the library support?
11:14:01FromDiscord<bestman 8> i just want to know what would be a good way to deploy ml models for desktop
11:14:30FromDiscord<bestman 8> In reply to @PMunch "Are you making it": yes but it will be converted to .onnx (that is a standard and seems to be the only option for desktop)
11:16:31PMunchThat should work fine then
11:17:04PMunchYou could probably use this to load ONNX and run it in Nim: https://github.com/YesDrX/onnxruntime-nim
11:19:47FromDiscord<bestman 8> will that also have cuda support
11:20:00PMunchThat seems to be a pretty low-level wrapper for the Onnxruntime written in C++, so not the prettiest Nim code to use it. But it should be easy enough to make it a bit prettier with some Nim templates
11:20:57PMunchShould do, yes, it is based on this: https://github.com/microsoft/onnxruntime
11:21:28PMunchAnd when I say based on I mean that it is literally running that for the actual ONNX stuff
11:21:48FromDiscord<bestman 8> that is pretty nice it seems like a great option
11:22:38FromDiscord<bestman 8> i wont have to write c or rust code and dont have to include python so it would be a good option (only issue is amd gpu's but webgl should work for that)
11:23:48FromDiscord<Phil> Is there a way to log messages in a package and have that respect the log level of the application its compiled into?
11:24:24PMunch@Phil, depends on how the log level is specified, and how messages are logged
11:24:32FromDiscord<Phil> E.g. I have my connection pooling package. I want to have it log how many connections are in the pool at various times on the debug log level. I do not care to see those when running normally
11:25:01FromDiscord<Phil> In reply to @PMunch "<@180601887916163073>, depends on how": Log level is specified in the logger call:↵`logger.log(lvlDebug, "AFTER RECYCLE - Number of connections in pool: " & $pool.connections.len() )`
11:25:03PMunchI mean the bare-minimum thing is to do "when defined(debug)"
11:25:21PMunchOh right, so you use the logging library?
11:25:30FromDiscord<Phil> Yeah, I thought that was the standard
11:25:35PMunchThis thing? https://nim-lang.org/docs/logging.html
11:25:41FromDiscord<Phil> Yep
11:25:47PMunchWell, it's in the standard library
11:25:50FromDiscord<Phil> the logger you see in there is a global logger
11:26:01FromDiscord<deeuu> Hey,↵Is it correct that `channels` should not be used when spawning tasks using `std/threadpool`? From [the docs](https://nim-lang.org/docs/channels_builtin.html#Channel) ↵> Note: Channels are designed for the Thread type. They are unstable when used with spawn↵I'm confused because NimInAction (p.178) shows an example of this, and I've seen channels and threadpool used together elsewhere, e.g. [morelogging](https://github.com/Federico
11:26:02FromDiscord<Phil> `var logger = newConsoleLogger()`↵I call that at the start of the module
11:26:03PMunchHonestly most people seem to just echo out messages
11:26:31PMunchI mean the obvious way is to take in a logger object on initialisation
11:26:35FromDiscord<Phil> ~~I refuse! I want to do my logging cleanly!~~
11:26:53FromDiscord<Phil> Hmmm
11:26:54PMunchHaha, I mean it's a good idea to use a logger :)
11:27:07PMunchI think status has their own logger as well, which is really nice
11:27:13FromDiscord<Phil> I don't want to bother users of my library though
11:27:33PMunchhttps://github.com/status-im/nim-chronicles
11:28:09PMunchAh right, so you add global handlers
11:28:31NimEventerNew thread by Drkameleon: Variable compile-time import paths, see https://forum.nim-lang.org/t/8856
11:29:10FromDiscord<Phil> In reply to @PMunch "Ah right, so you": I'm not sure I follow on that one
11:29:16PMunchSo I guess replace all the `logger.log` statements with just `log` and add a `when isMainModule: addHandler(newConsoleLogger())`
11:29:19PMunchOr something like that
11:30:27PMunchSo if you're not the main module, assume that a logger was added as a handler by the main module and use that
11:30:49FromDiscord<Phil> Ohhhh that's what that does? Look in the main module for a logger object of some sorts?
11:31:39FromDiscord<Phil> I think I need to read up a bit on what handlers mean in nim
11:32:22FromDiscord<Phil> Ohhhhh
11:32:28FromDiscord<Phil> addHandler builds something like a global logger context
11:32:37FromDiscord<Phil> And if you call log it just calls all the loggers that you added via "addHandler"
11:34:22PMunchYu
11:34:26PMunchYup*
11:35:22FromDiscord<Phil> Yeeeee that's the way I should've done it in the beginning. I just wrapped up a month-long log4j upgrade and that got my brain all primed that it worked similarly in nim
11:35:51FromDiscord<Phil> I know more about logging than I ever wanted to know
11:36:01PMunchHandlers aren't a Nim concept, it's just what the logging module calls them. The logger module just have a global variable with log handlers
11:36:01FromDiscord<Phil> (edit) "I know more about logging ... than" added "now"
11:36:30PMunchOh yikes, sorry to hear you got hit by the log4j train :P
11:37:04PMunchCuriously the global variable is thread-local, so you can configure different threads to have different loggers
11:37:23PMunchProbably just from the pre-ARC days though
11:37:46FromDiscord<Phil> is "mapped diagnostic context" something that is a general logging context?
11:37:50FromDiscord<Phil> (edit) "context?" => "concept?"
11:37:57FromDiscord<tandy> this sounds cool, what are you going to make?
11:37:58FromDiscord<tandy> this sounds cool, what are you going to make↵(@bestman 8)
11:38:10FromDiscord<Phil> The idea that you give every thread a custom hashmap solely for logging that you fill with thread-specific data
11:38:17FromDiscord<Phil> (edit) "The idea that you give every thread a custom hashmap solely for logging that you fill with thread-specific data ... " added "and can access in log-calls"
11:39:00PMunch@deeuu, I'm not 100% sure to be honest. I think it might confuse the parallel statement since it does rewriting, but just straight spawn calls should be safe (I think)
11:39:32FromDiscord<bestman 8> In reply to @tandy "this sounds cool, what": i just want to know how to deploy for desktop and at the end i would like something that could run the ml models on images
11:39:43PMunchNot 100% sure, but it's probably fine. This is getting a rewrite for ARC/ORC anyways, so everything is a bit muddy at the moment
11:39:50*jjido quit (Quit: My MacBook Air has gone to sleep. ZZZzzz…)
11:40:20PMunch@Phil, "mapped diagnostic context"?
11:41:01FromDiscord<bestman 8> the current ways to deploy ml models on desktop would be to rewrite most of the model in a lower level language or to use the .onnx model with c or rust
11:41:09FromDiscord<Phil> It's what log4j calls its custom hashmaps that they associate with every thread. You put stuff in there like a thread's name, what task it was currently on (you have to remember to update that if you make use of this) etc. etc.
11:41:48FromDiscord<bestman 8> (edit) "rust" => "rust↵not that people actually deploy to desktop and when they do they use js"
11:41:49FromDiscord<Phil> It's... a weird concept. I don't think I've yet seen a proper usecase where that actually helped, you're message just made me wonder whether nims logging has sth like that
11:41:58FromDiscord<Phil> (edit) "you're" => "your"
11:42:07PMunchAha, yes I've seen similar things
11:42:29FromDiscord<Phil> So far I've only seen it abused
11:42:41PMunchChronicles has something similar, and C# also does something similar
11:42:46PMunchOr .NET I guess
11:43:06FromDiscord<Phil> Like putting the name of the server you're currently on in a THREAD SPECIFIC hashmap instead of, yknow, putting that into a layout for log messages or sth
11:43:48FromDiscord<Tanguy> You can probably do something like that with this https://github.com/status-im/nim-chronicles#publiclogscope
11:44:20FromDiscord<Tanguy> With getServerId being something that returns your thread specific variables
11:45:58FromDiscord<tandy> cool, i was more wondering what your desktop app is going to do↵(@bestman 8)
11:47:36FromDiscord<bestman 8> In reply to @tandy "cool, i was more": probably simple things for images like style gan things, image segmentation for selection and upscaling
11:48:31FromDiscord<bestman 8> i'm planning on only using models that are pretty memory efficient so my poor gpu can train them
11:51:44FromDiscord<Phil> Ohhh what log4j calls appenders, nim std logging calls ConsoleLogger/FileLogger etc.
11:52:38FromDiscord<tandy> sounds cool, send me the repo when you have it going↵(@bestman 8)
11:53:01FromDiscord<tandy> i wanna have a spleeter impl in nim
11:54:39FromDiscord<bestman 8> In reply to @tandy "sounds cool, send me": if it ever happens
11:54:49FromDiscord<bestman 8> (edit) "In reply to @tandy "sounds cool, send me": if it ever happens ... " added "and i still remember this"
11:56:38FromDiscord<tandy> lol
11:57:16FromDiscord<Phil> In reply to @Tanguy "You can probably do": Hmmm this does tempt me, I might include nim-chronicles in my main project. I'd not want to include it in a super tiny package of merely 200 lines of code though, does it somewhat integrate with the std logging lib?
11:57:37FromDiscord<Phil> (edit) "though," => "though (my tinypool package for sqlite connection pooling),"
11:58:00FromDiscord<Phil> I'm mostly contemplating on how it'd interact if I had the package use stdlib and my main project (which makes use of the package) use nim-chronicles
12:03:26FromDiscord<Phil> ... okay, dumb question, but I would like to update my package
12:03:34FromDiscord<Phil> Do I just do nimble publish again?
12:05:22FromDiscord<Rika> no
12:05:44FromDiscord<Rika> you commit a version bump on the .nimble file then tag that commit with a version number
12:06:42FromDiscord<dom96> Or just commit. You don’t need to tag after every commit 🙂
12:07:06FromDiscord<dom96> Although Nimble will always install the latest tagged version implicitly
12:08:53PMunch@Phil, I guess you could implement a log handler which logged the message via chronicles if you wanted. But I'm not sure if anything like that is officially supported in chronicles
12:20:17FromDiscord<Phil> In reply to @Rika "you commit a version": Thanks (to you as well @dom96 )!↵Finally made the package's log messages respect the global log level
12:23:52*jjido joined #nim
12:59:38FromDiscord<Goel> Is there any difference between `type()` and `typeof()`? Is one deprecated and one not or something similar?
13:00:30FromDiscord<Rika> yes
13:00:36FromDiscord<Rika> type is deprecated afaik
13:43:45FromDiscord<demotomohiro> IIRC, type was deprecated because "type" is harder to google than "typeof".
13:44:54FromDiscord<Rika> also got confusing when type != type != type; typeof/typedesc/type
13:46:12FromDiscord<Phil> type is deprecated? huh
13:53:21PMunch@Phil, for getting the type of a variable
13:53:42PMunchYou should still use types :P
13:54:42FromDiscord<demotomohiro> !eval echo 1.typeof
13:54:44NimBotint
13:57:09FromDiscord<Rika> hm i do actually wonder why int isnt an alias determined by when statements
14:00:57PMunchInstead of being a magic?
14:03:24FromDiscord<Phil> In reply to @PMunch "You should still use": Watch me make an entire medium sized web application without any types whatsoever!
14:03:52FromDiscord<Phil> (edit) "whatsoever!" => "whatsoever outside of Hashmaps!"
14:04:04PMunch*shudders*
14:04:28FromDiscord<Rika> watch me make a program with nothing other than strings and pointers
14:04:36FromDiscord<Rika> and strings as pointers
14:05:59FromDiscord<Phil> So TIL Rika is very competitive
14:07:27FromDiscord<Rika> oh watch me make a program with nothing but pointers
14:07:40FromDiscord<Phil> Easy there Satan
14:12:25FromDiscord<ynfle> PMunch, can you look at this run? `nimlsp` is failing the CI https://github.com/ynfle/Nim-1/runs/5005825672?check_suite_focus=true. Is it a nimlsp issue?
14:13:43*jjido quit (Quit: My MacBook Air has gone to sleep. ZZZzzz…)
14:14:17*rockcavera joined #nim
14:14:17*rockcavera quit (Changing host)
14:14:17*rockcavera joined #nim
14:16:26PMunchAh yes, that is a nimlsp issue
14:16:31PMunchThat test is outdated
14:20:10FromDiscord<yumi> how can I improve https://github.com/redplane?
14:20:22FromDiscord<yumi> (edit) "https://github.com/redplane?" => "https://github.com/egor4ka/redplane?"
14:20:38FromDiscord<yumi> (edit) "https://github.com/egor4ka/redplane?" => "https://github.com/egor4ka/redplane ?"
14:22:13PMunch@yumi, replace it with Pakku?
14:22:23FromDiscord<yumi> uh
14:22:29FromDiscord<yumi> thats my own project
14:22:34FromDiscord<yumi> i made it for fun
14:22:36PMunchOh, sorry
14:22:45FromDiscord<yumi> yeah pakku is nice
14:22:50FromDiscord<mratsim> Pakku is unmaintained
14:22:55PMunchNo it's not
14:23:00FromDiscord<mratsim> I switched to paru/Rust ¯\_(ツ)_/¯
14:23:09FromDiscord<yumi> i use yay
14:23:13PMunchIt got forked and is actively maintained here: https://github.com/zqqw/pakku
14:23:21PMunchLast commit 4 days ago
14:23:26FromDiscord<yumi> because pakku wouldn't compile on my arch arm chroot
14:23:37FromDiscord<mratsim> oh
14:23:43FromDiscord<yumi> but yeah how can I improve my project?
14:23:46FromDiscord<xx_ns> fyi, the lead yay developer created and moved on to paru
14:24:06FromDiscord<ynfle> In reply to @PMunch "That test is outdated": Does something need to be changed in the nim CI?
14:24:09FromDiscord<yumi> paru doesn't let me get further than reading the pkgbuild
14:24:12PMunch@yumi, do you mean improve the code, or improve the project?
14:24:20FromDiscord<yumi> improve the code
14:24:28FromDiscord<yumi> im quite new to nim
14:24:29FromDiscord<xx_ns> In reply to @yumi "paru doesn't let me": what do you mean?
14:24:41FromDiscord<xx_ns> you know you have to quit the pager, right? `less` does that with the key `q`
14:24:41PMunch@ynfle, probably not, that test just got broken by https://github.com/PMunch/nimlsp/pull/109, I've asked @Bung to fix it
14:24:45FromDiscord<mratsim> you need to say "yes" in paru
14:25:04FromDiscord<yumi> In reply to @xx_ns "you know you have": tried it, it just exits
14:25:08FromDiscord<yumi> i just use yay
14:25:19PMunchOne thing the CI could do is only pull in the latest tagged version of packages, so you get the same behaviour of a Nimble install and not a bunch of development branches
14:26:20FromDiscord<yumi> but still, how can I improve my project?
14:26:31PMunch@yumi, you don't have to initialise your variables like that
14:26:36PMunchYou can just define their type
14:26:49FromDiscord<yumi> like var1: string?
14:26:52PMunchYup
14:26:57FromDiscord<yumi> ill do that ig
14:27:01PMunchAnd allPkgs: seq[string]
14:27:11PMunchI mean it's mostly just a preference thing
14:27:11FromDiscord<yumi> not newseq?
14:27:43PMunchnewSeq is typically used to initialise a sequence to a given length
14:27:47FromDiscord<yumi> oh
14:27:48FromDiscord<yumi> okay
14:27:57FromDiscord<yumi> lemme do that real quick...
14:28:05PMunchYou should also add newlines between your procs
14:28:13PMunchAnd why do they all return 0?
14:28:29FromDiscord<Goel> sent a code paste, see https://play.nim-lang.org/#ix=3O8D
14:28:38PMunch0 is the default, so you don't really need to return it explicitly, but why do they even have a return type if they always just return 0?
14:29:00PMunchThat way you wouldn't have to discard all those zeros either
14:29:31FromDiscord<yumi> how do i make a proc without a return type?
14:29:40PMunch@Goel, {.error.} is a compile-time thing
14:29:58FromDiscord<yumi> In reply to @PMunch "You should also add": okay
14:29:58PMunchIf it exists in code that will be compiled it throws a compilation error
14:30:17PMunch@Goel, what you want to do is throw an exception
14:31:10FromDiscord<yumi> In reply to @yumi "how do i make": nim basics never said anything about that lol
14:31:24FromDiscord<Goel> Yeah i suppose i was doing it the wrong way, i'll for "Thow an exception". Or even better if there is a single keyword that i can use in that case.↵(In Zig that would be `else: unreacheable;` to trigger the compiler warning only IN CASE it evaluates that line)
14:31:33PMunch{.error.} is used to do things like `when not defined(linux): {.error: "This module only supports linux".}`
14:31:58PMunch@yumi, you just omit the `: int` part of the signature
14:32:02FromDiscord<yumi> oh
14:32:11FromDiscord<yumi> and i wont have to return?
14:32:16PMunchCorrect
14:32:17FromDiscord<yumi> ok thnks
14:32:24PMunchYou technically never _have_ to return in Nim
14:32:29FromDiscord<yumi> oh
14:32:29FromDiscord<yumi> ok
14:32:34FromDiscord<yumi> thanks a lot
14:32:48PMunchBecause by default a procedure will return the default value of a type at the end
14:33:01FromDiscord<yumi> also how do i make readline(stdin) not start on a newline?
14:33:12PMunchSo `proc test(): int = discard` will return 0 and `proc test(): string = discard` will return an empty string
14:33:29FromDiscord<yumi> oh ok
14:33:58PMunch@Goel, I mean you could create a template called `unreachable`..
14:34:12PMunchBut if it is truly unreachable you can just put a discard in there
14:34:19PMunchOr a `quit 1`
14:34:37FromDiscord<ynfle> In reply to @Goel "Yeah i suppose i": You can do `error("Some error message")`
14:34:59FromDiscord<ynfle> The `{.error.}` means if this part compiles throw an error
14:35:00PMunch@yumi, do you mean like `readChar`?
14:35:14FromDiscord<yumi> yeah
14:35:23FromDiscord<yumi> for the y/n thing
14:35:38PMunch@yumi, yeah you can use https://nim-lang.org/docs/io.html#readChar%2CFile
14:35:46FromDiscord<yumi> ok thanks
14:37:04PMunchAnd by the way, in `pacmanInstall` you return 1 when it succeeds, or 0 (as the default value), when it doesn't
14:37:25PMunchThis is really just a bool, so you could change the return type to bool and `return true` instead.
14:38:44PMunch@yumi, instead of `commandLineParams().len` you can use `paramCount()`
14:39:05FromDiscord<yumi> oh wait yeah
14:39:07FromDiscord<yumi> thanks
14:39:27FromDiscord<yumi> damn you guys really are helpful
14:39:31PMunchThis is a syntax error (missing paren) not sure how that would even compile: https://github.com/egor4ka/redplane/blob/main/redplane.nim#L60
14:39:52PMunchI mean things like `yesToAll` could also be a boolean
14:39:54FromDiscord<Goel> @ynfle But that won't tell me which line code triggered it
14:40:15FromDiscord<yumi> In reply to @PMunch "This is a syntax": didnt even compile
14:40:24FromDiscord<yumi> im editing it currently
14:40:33PMunchAnd then you could just do `if yesToAll:` instead of comparing it to `"yes"` or `true`
14:41:07FromDiscord<yumi> yeah
14:41:09FromDiscord<yumi> thanks
14:41:55PMunchApart from that it looks pretty good code-wise
14:43:01PMunch@narimiran, maybe mention that procs don't need to have a return type in Nim basics? ^
14:43:43FromDiscord<narimiran> In reply to @PMunch "<@719992187890434069>, maybe mention that": as in: when they return void?
14:45:06FromDiscord<narimiran> In reply to @yumi "nim basics never said": oh, now i see what is the mention about 🙂 @yumi, please open an issue in nimbasics repo if you want; i can add this in some future version of the book
14:45:07FromDiscord<ynfle> In reply to @Goel "<@!767093711112241162> But that won't": It should. Does it not?
14:45:26PMunchIt seems like @yumi followed Nim basics and ended up writing code like this: https://github.com/egor4ka/redplane/blob/main/redplane.nim because they didn't understand that you didn't have to return something
14:45:26FromDiscord<ynfle> PMunch, tests fixed https://github.com/PMunch/nimlsp/pull/116
14:46:03FromDiscord<yumi> dont mind the broken commit i was editing it on github and wanted to save it to download and continue editing
14:47:03FromDiscord<narimiran> wait, we have the example without a return type!! 😄
14:47:28FromDiscord<narimiran> look at the second and third example here: https://narimiran.github.io/nim-basics/#_declaring_a_procedure
14:47:34FromDiscord<yumi> oh
14:47:38FromDiscord<yumi> i didnt notice that
14:47:43FromDiscord<narimiran> "The echoLanguageRating procedure just echoes the given name, it doesn’t return anything, so the return type is not declared"
14:47:57FromDiscord<yumi> very nice guide though
14:48:01FromDiscord<yumi> nim is my first lang
14:48:14FromDiscord<narimiran> In reply to @yumi "very nice guide though": thanks! i'm really glad to hear that 🙂
14:48:38FromDiscord<yumi> don't know what i would do without it
14:49:02FromDiscord<yumi> can't get away from nim now 😄
14:49:24FromDiscord<narimiran> In reply to @yumi "nim is my first": then you are exactly who is this guide aimed for 🙂 if you have any complaints and/or ideas how to improve it to make it easier for first-timers, please let me know
14:49:37FromDiscord<yumi> okay
14:50:06FromDiscord<yumi> how about a little section on how to parse command line parameters?
14:50:55FromDiscord<yumi> i was using commandLineParams().contains because the first result for flag parsing was a stackoverflow question
14:51:14FromDiscord<yumi> but then it turned out parseOpt existed
14:51:46PMunch@ynfle, thanks a lot for the PR :)
14:52:57FromDiscord<narimiran> In reply to @yumi "how about a little": i've added an issue (https://github.com/narimiran/nim-basics/issues/21) so i don't forget about it, but i can't promise you when it will be published
14:53:05FromDiscord<yumi> okay
14:53:06FromDiscord<yumi> thanks
14:54:45FromDiscord<ynfle> In reply to @PMunch "<@757977788056600719>, thanks a lot": Pleasure. Copied most of the code from the Original PR and osproc. Never used async, especially with streams. Happy To help.
14:55:03FromDiscord<ynfle> I hate failing CIs. I'm 1/2 OCD about them
14:57:55FromDiscord<ynfle> I was suprised when `zippy` wasn't made by @treeform
14:58:39PMunchHuh, I just assumed it was :P
14:59:23FromDiscord<ynfle> In reply to @PMunch "Huh, I just assumed": Lol. it's made by guzba
14:59:35FromDiscord<ynfle> Off to fix the other failing CI
15:01:29FromDiscord<yumi> btw is it fine to space out the of statements in case?
15:03:42FromDiscord<demotomohiro> https://nim-lang.org/docs/manual.html#statements-and-expressions-case-statement
15:04:30FromDiscord<demotomohiro> There is example code that indent of branch.
15:07:18PMunch@yumi, space out?
15:07:30FromDiscord<yumi> yeah
15:07:42PMunchWhat do you mean by space out?
15:08:10FromDiscord<yumi> sent a code paste, see https://play.nim-lang.org/#ix=3O96
15:08:16FromDiscord<yumi> like this
15:08:17FromDiscord<yumi> (edit) "https://play.nim-lang.org/#ix=3O96" => "https://paste.rs/JLy"
15:08:38*arkurious joined #nim
15:10:19FromDiscord<demotomohiro> You dont want to put space between `of` and the expression?
15:10:25FromDiscord<yumi> no
15:10:38FromDiscord<yumi> look at the gap between the first of and second of
15:10:42FromDiscord<yumi> like this
15:10:48FromDiscord<yumi> just wondering
15:11:44FromDiscord<Rika> its ok
15:11:47FromDiscord<Rika> it will work
15:11:50FromDiscord<yumi> ok
15:11:52FromDiscord<yumi> cool
15:12:00FromDiscord<yumi> just wondering, not actually gonna do it
15:17:27*jjido joined #nim
15:42:13*noeontheend joined #nim
15:44:11FromDiscord<Michal Maršálek> Can my proc pretend it's free of side effects similar to how debugEcho does it?
15:47:46PMunchYes
15:48:15PMunch{.cast(gcsafe).}
15:48:31PMunchThat will make the compiler think your code is gc safe
15:50:16FromDiscord<yumi> what is gc?
15:50:46FromDiscord<yumi> nevermind
15:50:55FromDiscord<yumi> garbage collection
15:56:17FromDiscord<konsumlamm> that's for `gcsafe`, for side effects there is `{.cast(noSideEffect).}`
15:57:53FromDiscord<Michal Maršálek> Error: 'cast' pragma only allowed in a statement context
15:57:57FromDiscord<Michal Maršálek> where do i put it?
15:58:25FromDiscord<Rika> {.cast(...).}
15:58:26FromDiscord<Rika> ?
15:58:28FromDiscord<konsumlamm> you use it like `block`, i.e. by putting `:` after it and indenting the rest
15:58:42FromDiscord<Rika> oh i didnt read enough
15:58:42FromDiscord<Rika> xd
15:58:52FromDiscord<Michal Maršálek> ah
16:02:32FromDiscord<Michal Maršálek> I must be stupid but it doesn't seem to change anything
16:05:10FromDiscord<Michal Maršálek> ok, i got It
16:05:25FromDiscord<Michal Maršálek> one must put it inside the procedure not outside
16:05:35FromDiscord<Michal Maršálek> thanks
16:44:36FromDiscord<apahl> sent a long message, see https://paste.rs/7pT
16:47:24PMunch@apahl, values is declared in the global scope, so it's a global variable and probably will be treated differently
16:47:54PMunchhttps://play.nim-lang.org/#ix=3Oap
16:48:06PMunchSimply wrapping it in a main procedure makes the hint disappear
16:49:02FromDiscord<apahl> Nice!! Thanks a lot, that's it.
16:58:05*noeontheend quit (Ping timeout: 256 seconds)
17:09:45*noeontheend joined #nim
17:14:22*neurocyte0917090 joined #nim
17:27:49*sagax joined #nim
17:39:17*PMunch quit (Quit: leaving)
17:49:35*jmdaemon joined #nim
17:54:07*krux02 joined #nim
17:54:11*noeontheend quit (Ping timeout: 256 seconds)
17:55:36*jjido quit (Quit: My MacBook Air has gone to sleep. ZZZzzz…)
17:59:26*jjido joined #nim
18:20:49*jmdaemon quit (Ping timeout: 256 seconds)
18:40:33FromDiscord<ajusa> Has anyone used jnim here? Any examples of interop other than the provided tests?
18:40:59*jmdaemon joined #nim
18:51:22FromDiscord<Shiba> so how can i get the clock ticks thing in a nim program
18:51:27FromDiscord<Shiba> (edit) "program" => "program?"
18:59:26FromDiscord<krisppurg> sent a code paste, see https://play.nim-lang.org/#ix=3ObE
18:59:46FromDiscord<krisppurg> Any reasons to why this is happening despite linking it to the correct path
18:59:56FromDiscord<krisppurg> (edit) "path" => "path?"
19:43:43Amun-Rakrisppurg: --passC:path → --passC:-Ipath
19:44:56FromDiscord<Phil> Wait a minute, you can use `db.exec(sql"BEGIN")` to effectively get a write-lock to the database up until the point you execute `db.exec(sql"COMMIT")`?
19:45:04FromDiscord<Phil> Fuck yeah
19:45:28Amun-Rawelcome to the world of transactions
19:45:42FromDiscord<Phil> I was desperately looking for some kind of "beginTransaction" proc
19:45:54Amun-Raah
19:46:30FromDiscord<Phil> My heart went to my trousers when I didn't find it and realized I really need some kind of write lock for when I add search data to an fts5 table after I add an entry to a table
19:46:58FromDiscord<Phil> (edit) "My heart went to my trousers when I didn't find it and realized I really need some kind of write lock for when I add search data to an fts5 table after I add an entry to a ... table" added "normal"
19:47:01Amun-RaI've never used nim and db together - sometimes db engines have autocommit set to true
19:47:38Amun-Raand that can be surprising
19:47:44FromDiscord<Phil> sent a code paste, see https://play.nim-lang.org/#ix=3Oc5
19:48:05FromDiscord<Phil> My comment was me letting out a sigh of relief at having found a way to do this
19:48:12Amun-Ramhm
19:48:18FromDiscord<Phil> And now on to making myself a template `withTransaction`
19:48:45FromDiscord<Phil> Actually
19:48:46FromDiscord<Phil> Hmmm
19:49:17FromDiscord<Phil> I have a tiny package whose focus is around being a connection pool for an sqlite database
19:50:16FromDiscord<Phil> It already has a helper proc `withDbConn` that gives you a connection and recycles it immediately once you leave the code block.↵In a very similar fashion I could do a `withDbTransaction`... but that kind of feels like it's beyond of what the scope of the package should be
19:50:18FromDiscord<Phil> hmmm
19:52:25FromDiscord<Waldecir Santos> I've been using https://exercism.org/dashboard to learn nim, do you guys suggest any other idea to pratice and learn more about nim ?
19:52:39FromDiscord<Waldecir Santos> (edit) "https://exercism.org/dashboard to" => "https://exercism.org/"
19:53:01FromDiscord<Phil> Do you have a project lying around that you'd be willing to re-implement?
19:53:42FromDiscord<Phil> I'd recommend implementing a project any day over exercism & co, it forces you very quickly to learn a fair amount about the language
19:53:53FromDiscord<Waldecir Santos> not really my only idea was to implement a "django-like" framework on nim, but that is for a future project, not something to learn I think.
19:53:54FromDiscord<Phil> (edit) "I'd recommend implementing a project ... any" added "that you care about"
19:54:19Amun-Raor rewrite one of your projects in nim
19:54:23Amun-Rato*
19:54:51FromDiscord<Phil> I have decided, withDbTransaction shall become a database utility proc and not go into the connection pool package
19:54:54FromDiscord<krisppurg> Now its a different error but it's similar https://media.discordapp.net/attachments/371759389889003532/937798113496813608/message.txt
19:55:49Amun-Raempty page
19:56:03FromDiscord<krisppurg> ?
19:56:43Amun-Rakrisppurg: I see no contents of message.txt
19:57:02FromDiscord<krisppurg> sent a code paste, see https://play.nim-lang.org/#ix=3Oca
19:57:59*fvs joined #nim
19:58:09Amun-Rathat should be -I as in capital i and not lowercase l
19:58:36FromDiscord<krisppurg> bruh
19:58:51FromDiscord<krisppurg> didnt notice that
19:58:56*jjido quit (Quit: My MacBook Air has gone to sleep. ZZZzzz…)
20:00:44FromDiscord<krisppurg> still same eror
20:00:46FromDiscord<krisppurg> (edit) "eror" => "error"
20:01:45Amun-Rawhat directory is opus directory in?
20:01:58*jjido joined #nim
20:02:05FromDiscord<Phil> Does `raise` in the except block of a `try-except` construct just reraise the caught exception?
20:02:24FromDiscord<Phil> (edit) "Does ... `raise`" added "a blank "
20:02:25Amun-RaPhil: like in python? good question
20:02:41FromDiscord<krisppurg> wait nvm its working now
20:02:43FromDiscord<krisppurg> pog
20:02:56FromDiscord<Phil> sent a code paste, see https://play.nim-lang.org/#ix=3Oce
20:03:40FromDiscord<Phil> If it works that way: Good! I'd like to catch an exception, just "rollback" the transaction and then reraise it because I merely want to do a rollback and close the transaction
20:03:55FromDiscord<Phil> (edit) "transaction" => "transaction, not actually deal with the exception"
20:04:05Amun-RaPhil: finally>/
20:04:08Amun-Ra?
20:04:21FromDiscord<Phil> Finally would also act if the transaction succeeds
20:04:26FromDiscord<Phil> I don't wanna rollback if it works
20:04:28FromDiscord<Phil> Only if it doesn't
20:05:12FromDiscord<krisppurg> sent a long message, see http://ix.io/3Ocf
20:05:51FromDiscord<krisppurg> (edit) "http://ix.io/3Ocf" => "http://ix.io/3Ocg"
20:06:49Amun-RaPhil: seems to be working https://play.nim-lang.org/#ix=3Ocj
20:07:09FromDiscord<Phil> In reply to @Amun-Ra "<@180601887916163073>: seems to be": Sweet! Thanks a lot!
20:08:55*vicfred joined #nim
20:09:38Amun-Rakrisppurg: it should work if the file exists C:\Users\KrispPurg\Desktop\Projects\Programming\nim-lang\discord_bots\dimscord\include\opus\opus_defines.h
20:10:16Amun-Ratho I'm not much of a windows user
20:12:20*tiorock joined #nim
20:12:20*tiorock quit (Changing host)
20:12:20*tiorock joined #nim
20:12:20*rockcavera is now known as Guest3833
20:12:20*tiorock is now known as rockcavera
20:13:10*jjido quit (Quit: My MacBook Air has gone to sleep. ZZZzzz…)
20:15:59*Guest3833 quit (Ping timeout: 268 seconds)
21:06:07*jjido joined #nim
21:30:33FromDiscord<Patitotective> How con I convert the _shared library_ nim outputs to an actual _Linux_ (Ubuntu) executable?
21:30:44FromDiscord<Patitotective> So I can double-click it to run it
21:30:54*FromDiscord quit (Remote host closed the connection)
21:31:08*FromDiscord joined #nim
21:45:07FromDiscord<exelotl> sent a code paste, see https://play.nim-lang.org/#ix=3OcO
21:45:55FromDiscord<iffy (Matt Haggard)> I want to export one of the `macros.ident` procs (https://nim-lang.org/docs/macros.html#ident%2Cstring) but not the deprecated one (https://nim-lang.org/docs/macros.html#ident%2CNimNode) How do I do it? `import macros; export ident` is as close as I can get
21:47:14FromDiscord<iffy (Matt Haggard)> Strike that. This is as close as I can get\: `proc ident(x: string): NimNode = macros.ident(x)`
22:04:18FromDiscord<Elegantbeef> sent a code paste, see https://play.nim-lang.org/#ix=3OcV
22:04:44FromDiscord<Elegantbeef> You want wrapping enum logic?↵(@exelotl)
22:05:15FromDiscord<Elegantbeef> sent a code paste, see https://play.nim-lang.org/#ix=3OcW
22:12:23FromDiscord<exelotl> hmm yeah I guess something like this is what I need
22:31:16FromDiscord<Elegantbeef> I do kinda think there should be a `succWrapped` but i guess that's just a module type and whenever the compiler releases with that support is when we'll have it
22:31:42FromDiscord<Elegantbeef> modulo type\
22:33:41*l1x joined #nim
22:51:09FromDiscord<planetis> It seems that operators ending with \ are special, %{"a"\: [1], "b"\: [1,2]} won't parse but with %\ it will
22:56:12*jjido quit (Quit: My MacBook Air has gone to sleep. ZZZzzz…)
23:06:11*jmdaemon quit (Ping timeout: 268 seconds)
23:06:37FromDiscord<impbox [ftsf]> yeah I made an incWrap and decWrap, super handy
23:07:15FromDiscord<impbox [ftsf]> sent a code paste, see https://play.nim-lang.org/#ix=3Odd
23:07:26FromDiscord<impbox [ftsf]> also works for toggling bools
23:22:54FromDiscord<huantian> does anyone know of a good crossplatorm (mainly win/linux) library for system notifications and task bar icon thingy
23:23:21FromDiscord<Elegantbeef> sent a code paste, see https://play.nim-lang.org/#ix=3Odi
23:23:35*oprypin quit (Quit: Bye)
23:23:44*oprypin joined #nim
23:24:54FromDiscord<Elegantbeef> For system notifications linux is relatively easy, tasbar is another ordeal
23:28:32*jmdaemon joined #nim
23:31:20FromDiscord<huantian> hm yeah↵the most annoying part would be probably having to test on windows myself, if I do do it myself
23:31:56*vicfred quit (Quit: Leaving)
23:33:14FromDiscord<Elegantbeef> Wine can work for testing
23:33:22FromDiscord<Elegantbeef> Though obvious best is the real software