<< 17-12-2022 >>

00:20:48*wallabra_ joined #nim
00:21:52*wallabra quit (Ping timeout: 252 seconds)
00:22:06*wallabra_ is now known as wallabra
01:09:20*rockcavera quit (Remote host closed the connection)
01:48:57*ltriant joined #nim
01:55:52*ltriant quit (Ping timeout: 252 seconds)
02:38:17*ltriant joined #nim
02:43:10*ltriant quit (Ping timeout: 252 seconds)
03:51:58arkanoidusing var parametes doesn't imply heap allocations, right? It's just a safe pointer to a stack variable moving around, correct?
03:52:38FromDiscord<Elegantbeef> `var` parameters are mutable reference that data can be on the stack or heap
03:53:32arkanoidthanks
03:56:30arkanoidI have a recursive algorithm defined as a closure inside a wrapper proc. The wrapper proc defines common constant variables to all iterations, plus a "var output" variable that the inner recursive proc uses as an accumulator
03:56:46*ltriant joined #nim
03:57:12arkanoidI wonder if this approach using closure (is this really a closure?) is better than using plain recursive proc with many (constant) arguments, or not
03:57:35arkanoidplus passing "var output" as var parameter
03:58:25FromDiscord<Elegantbeef> Does the procedure capture any inputs?
03:59:44arkanoidsorry, I'm not sure to know exactly the meaning of "capture" here. Would you be so patient to expand a bit the question to let me understand and learn what's the meaning?
04:02:01*ltriant quit (Ping timeout: 268 seconds)
04:02:59arkanoidthe recursive function reads and write to a 2D uint8 tensor (an uint8 image), that starts as full of 0s and get recursivery drown, the output is the raster itself
04:07:49FromDiscord<Elegantbeef> https://nim-lang.org/docs/intern.html#code-generation-for-closures a bit busy so hoping this will help
04:09:42arkanoidElegantbeef, much gratitude!
04:14:56arkanoidwell, I've also received kinda answer from weave library itself: Error: illegal capture 'recurse' because 'async_recurse' has the calling convention: <nimcall>
04:16:07FromDiscord<Elegantbeef> Basically if you use a variable that isnt global inside of a procedure body your procedure needs to capture the environment
04:16:59arkanoidso if to leverage something that promotes itself as "state-of-the-art" for this kind of job I need a plain func, I guess is better to don't have closures here
04:18:22arkanoidhow to deal with values that are required within the recurse function but doesn't need to be changed from within the recursive function? Should I pass them as plain immutable arg and nim will optimize it out saving tons of copies?
04:18:34FromDiscord<Elegantbeef> Yea especially when it comes to threading a closure is confounding
04:18:37arkanoidor is better to drop a "var" in front of each parameter, to assure it
04:19:03FromDiscord<Elegantbeef> Nim passes by reference on large objects/seq/string
04:19:55arkanoidok but here I have a recursion that is being called for trillion of times, each copy would cost
04:20:17arkanoidI'm using a closure here exactly for this, hoping that this would save lots of copies
04:20:20FromDiscord<Elegantbeef> What type is it?
04:20:46FromDiscord<Elegantbeef> Is it atleast 24 bytes?
04:20:50FromDiscord<Elegantbeef> If so nim does by reference
04:25:18arkanoidthese are all the immutable vars used by the recursion: float32, float32, Tensor[float32], Tensor[float32], Tensor[float32], int, seq[tuple[int,float32,float32]], range[10..100]. The "custom" vars that each recurisive step takes: tuple[float32, float32], int. Then there's the "output" Tensor[uint8] that each recursive step reads one and writes once
04:25:58arkanoidnow sure how to mangle all these into an efficient recursion
04:27:07arkanoidmy for the "immutable" I probably can just drop them as plain args as they are almost all >24 bytes. For the custom ones I can't save memory here, but what about the shared tensor output?
04:29:42arkanoidthe typical recursive function uses the return value a accumulator, but here I have a Tensor[uint8] that I surely dont want to copy
04:30:54arkanoidI'll take a nap over this question, maybe I'll dream an answer. Thanks for the feedback
04:59:00NimEventerNew Nimble package! webby - Web utilities - http headers and query parsing., see https://github.com/treeform/webby/
05:06:16FromDiscord<ShalokShalom> In reply to @Isofruit "Araqs approach seems to": How would data types be wrong in this case ?
05:07:55FromDiscord<ShalokShalom> And do you do property testing?
05:21:51FromDiscord<huantian> In reply to @NimEventer "New Nimble package! webby": @treeform is there something for parsing Content-Dispositon 👀
05:35:53*wallabra_ joined #nim
05:36:36*wallabra quit (Ping timeout: 252 seconds)
05:36:57*wallabra_ is now known as wallabra
05:37:23FromDiscord<treeform> eventually
06:14:05*ltriant joined #nim
06:19:36*ltriant quit (Ping timeout: 272 seconds)
06:55:05FromDiscord<Phil> In reply to @ShalokShalom "How would data types": If I knew I'd already be happy with a testing strategy
06:56:58FromDiscord<ShalokShalom> I mean, conceptionally
07:31:29FromDiscord<Phil> In reply to @ShalokShalom "I mean, conceptionally": Again, if I understood that I'd be going for that testing strategy. This was an almost verbatim quote of araq from the nim thread beef posted about testing
07:43:10FromDiscord<juelix> Can Nim be used to implement a fast and secure webAPI?
08:03:44FromDiscord<PMunch> Definitely
08:18:38*junaid_ joined #nim
08:31:47*pro joined #nim
08:56:29*junaid_ quit (Remote host closed the connection)
09:16:10*pro left #nim (#nim)
09:22:11FromDiscord<ajusa> In reply to @treeform "eventually": And multipart encoding I assume?
09:22:37FromDiscord<ajusa> (edit) "In reply to @treeform "eventually": And multipart encoding I assume? ... " added "Glad I don't need to reinvent the wheel 😃"
09:24:16*xet7 quit (Quit: Leaving)
10:15:42*ltriant joined #nim
10:20:39*ltriant quit (Ping timeout: 260 seconds)
11:27:09NimEventerNew thread by fxn: Why is the cursor pragma called cursor?, see https://forum.nim-lang.org/t/9733
12:09:18NimEventerNew thread by oldMan: Where is the documentation for fidgetty?, see https://forum.nim-lang.org/t/9734
12:24:50*ltriant joined #nim
12:30:06*ltriant quit (Ping timeout: 272 seconds)
12:50:13*jmdaemon quit (Ping timeout: 260 seconds)
13:22:45*ltriant joined #nim
13:28:07*ltriant quit (Ping timeout: 268 seconds)
14:36:54*krux02 joined #nim
14:37:59*krux02 quit (Read error: Connection reset by peer)
14:38:05*krux02_ joined #nim
15:26:09*Ziw joined #nim
15:31:29*Ziw quit (Quit: WeeChat 2.8)
15:35:34*krux02_ quit (Remote host closed the connection)
16:35:18FromDiscord<xoich (xoich)> hello, is there a quick method to get user input in the terminal without the need to press enter? Like a y/n answer
16:47:54FromDiscord<Phil> There are CLI apps that don't require you to press enter after your input before reading it?↵Like, even pacman requires you to, as does apt afaik
16:48:11FromDiscord<xoich (xoich)> does the text in the left column overflow for you too in the docs [here](https://nim-lang.org/docs/terminal.html#TerminalCmd)?
16:48:44FromDiscord<Phil> Can't say that it does https://media.discordapp.net/attachments/371759389889003532/1053715380511719454/image.png
16:48:59FromDiscord<Phil> That's on firefox
16:52:01FromDiscord<xoich (xoich)> ok, it seems I can use std/terminal/getch
16:58:10FromDiscord<xoich (xoich)> it's worse for me, but look at the Proc heading at the bottom, "color\:" is too much to the right↵(@Phil)
17:01:38FromDiscord<Phil> In reply to @xoich (xoich) "it's worse for me,": Ugh, I know this kind of css issue, it's due to the individual word being too long so the browser doesn't know where to break. You'd need to tell it to break up individual words which it doesn't do by default and you can do that in like 5 different ways, figuring out the right one is always a massive pain
17:04:19FromDiscord<Phil> I guess in this case you'd need to add the css-rule "line-break: anywhere" to the ul with the id "top-list" to make sure everything underneath the search-field wraps even if the individual identifier is too long
17:04:55FromDiscord<Phil> The problem is that it then will lead to stuff like this: https://media.discordapp.net/attachments/371759389889003532/1053719456112717845/image.png
17:09:23FromDiscord<Phil> I'm honestly not sure what is preferrable, I guess the current style is acceptable as it's just another way of code-smell telling you you're doing names badly
17:24:19*ltriant joined #nim
17:29:20*ltriant quit (Ping timeout: 255 seconds)
17:34:32FromDiscord<albassort> @Phil
17:34:45FromDiscord<Phil> In reply to @albassort "<@180601887916163073>": I have been summoned
17:34:51FromDiscord<albassort> hi hope your day is well <3
17:35:21FromDiscord<Phil> It is, I recently had a nice idea for when I finally muster up the time and energy to tackle a proper nimqml project and that put me in a good mood!
17:35:44FromDiscord<Phil> Thanks for the well wishes, did I do anything to deserve those though 😛
17:35:49FromDiscord<Phil> (edit) "😛" => "😛?"
17:35:59FromDiscord<albassort> ok but, i know this is strange for us, but i hope you do something away from your programming terminal
17:36:15FromDiscord<albassort> its hard for me, i know
17:37:17FromDiscord<Phil> I do, I tend to just spend my time on the go also on the phone with discord on when there's nothing good from my youtube subscriptions to pass the time
17:37:40FromDiscord<Phil> Luckily public transit is good enough that I can get from A to B without dropping the convo
17:37:54FromDiscord<albassort> ...im starting to know a pattern amongst programmers by trade
17:38:06FromDiscord<albassort> (edit) "know" => "notice"
17:38:13FromDiscord<Phil> Glued to a screen and unwilling to be bored in public transit?
17:38:24FromDiscord<albassort> more like
17:38:35FromDiscord<albassort> hehe when i get done coding at work i get to code at home :D
17:39:10FromDiscord<Phil> I'm currently not doing that since I started feeling a bit rough around the edges when coding, I take that as a good time to either pop up a good show or start playing something
17:41:58FromDiscord<albassort> In reply to @Isofruit "I'm currently not doing": theres a video from a programmer from the 80s who said "I think its beneficial for people who work in the sciences and particularly creative implementations of it to sometimes take a break and do more natural artistic endeavors"
17:42:03FromDiscord<albassort> heavily paraphrasing
17:42:36FromDiscord<albassort> i do feel i should take a break but idk when I'll have the time
17:43:19FromDiscord<Phil> In reply to @albassort "theres a video from": Those are typically the times when I start thinking of interesting things to do with my dnd characters 😉
17:46:49FromDiscord<albassort> https://media.discordapp.net/attachments/371759389889003532/1053729998609076345/image.png
17:46:59FromDiscord<albassort> https://media.discordapp.net/attachments/371759389889003532/1053730041382588426/image.png
17:47:11FromDiscord<albassort> does this look like a memory leak
17:47:35FromDiscord<albassort> yea looks like a memory leask
17:49:32Amun-Raalbassort: do you use nim suppressions for valgrind?
17:49:46FromDiscord<albassort> no...?
17:50:39Amun-Raalthough I don't remember if any gtk app will leak when valgrined…
17:50:58FromDiscord<albassort> im doing uhhhh
17:51:00FromDiscord<albassort> weird things
17:51:40FromDiscord<albassort> i haven't figured out how to break and resume the main loop remotely from now
17:51:48Amun-RaI use this https://pastebin.com/ghuvfSbB
17:51:58FromDiscord<albassort> so currently it destroys itself and then i reset it
17:52:21FromDiscord<albassort> sent a code paste, see https://play.nim-lang.org/#ix=4iQf
17:52:56FromDiscord<albassort> sent a code paste, see https://play.nim-lang.org/#ix=4iQh
17:52:56Amun-Raahm C
17:53:03FromDiscord<albassort> (edit) "https://play.nim-lang.org/#ix=4iQh" => "https://play.nim-lang.org/#ix=4iQi"
17:53:38FromDiscord<albassort> im trying to figure out a good way to implement a cleanup rpoc
17:53:41FromDiscord<albassort> (edit) "rpoc" => "proc"
17:53:45FromDiscord<albassort> (edit) "proc" => "function"
18:03:39FromDiscord<deech> sent a code paste, see https://play.nim-lang.org/#ix=4iQl
18:06:07FromDiscord<<She>Horizon</Her>> In reply to @Isofruit "There are CLI apps": Getch is on example
18:06:12FromDiscord<<She>Horizon</Her>> Well, the function
18:06:20FromDiscord<<She>Horizon</Her>> An app that does than... Not sure
18:15:45FromDiscord<Phil> In reply to @Event Horizon "An app that does": Git log does with exiting you if you press q
18:15:53FromDiscord<Phil> Just remembered
18:16:19FromDiscord<gongongagaga> i need to add `-d:ssl` so nim stops complaining about stuff↵how do i do this with nimble
18:16:29FromDiscord<<She>Horizon</Her>> Ah neat
18:16:42FromDiscord<Phil> In reply to @gongongagaga "i need to add": In what sense?
18:16:47FromDiscord<<She>Horizon</Her>> In reply to @gongongagaga "i need to add": Just a `config.nims` file with `--define:ssl` in the root dir!
18:16:54FromDiscord<Phil> nimble task?
18:16:55FromDiscord<<She>Horizon</Her>> Should be the case, at least!
18:17:17FromDiscord<<She>Horizon</Her>> Probably when you're using ssl features in a nimble package-
18:17:31FromDiscord<gongongagaga> In reply to @Event Horizon "Just a `config.nims` file": this worked, thanks
18:19:29FromDiscord<<She>Horizon</Her>> Np!
18:27:36*wallabra quit (Quit: ZNC 1.8.2 - https://znc.in)
18:34:18*wallabra joined #nim
19:05:55FromDiscord<sekao> does anyone know if methods have to be defined in the same module as their `{.base.}` method, or is there a way to define them elsewhere?
19:29:53*arkurious joined #nim
20:30:16*ltriant joined #nim
20:59:53NimEventerNew Nimble package! tram - 🚋 Traffic Analysis in Nim, see https://github.com/facorazza/tram
21:00:49FromDiscord<QuiteQuietQ> sent a code paste, see https://play.nim-lang.org/#ix=4iR4
21:04:08FromDiscord<Elegantbeef> `for e in elements.mitems`
21:05:58FromDiscord<QuiteQuietQ> omg, of course, thanks! that could really be written in the error message
21:06:21FromDiscord<Elegantbeef> nope
21:07:27FromDiscord<QuiteQuietQ> The compiler can guess that I am trying to iterate a sequence of objects and modify some attributes there, imho
21:07:35FromDiscord<QuiteQuietQ> could guess
21:08:43FromDiscord<Elegantbeef> well `mitems` is just a convention and not hardcoded
21:08:52*wallabra quit (Remote host closed the connection)
21:08:55FromDiscord<Elegantbeef> So you just as likely could mean a completely different iterator
21:09:23FromDiscord<Elegantbeef> But also ref types dont have the same mutability rules
21:09:37FromDiscord<QuiteQuietQ> i don't mean iterator, but iteration itself↵like going over elements one by one
21:12:32FromDiscord<Elegantbeef> For field access it might be simple, but for covering all bases it is more complicated
21:12:43FromDiscord<Elegantbeef> So it's quite a complex solution methinks
21:13:31*wallabra joined #nim
21:18:11FromDiscord<deech> sent a code paste, see https://play.nim-lang.org/#ix=4iRa
21:23:49FromDiscord<ShalokShalom> In reply to @Isofruit "Again, if I understood": Aaaaah↵↵You know so much as I do 😅
21:24:03FromDiscord<ShalokShalom> How unusual 😅
21:27:15FromDiscord<ShalokShalom> In reply to @Isofruit "It is, I recently": Do you already know what app your want to do
21:28:24FromDiscord<Phil> In reply to @ShalokShalom "Do you already know": I had one in mind already had I not come up with anything else, would've been a pretty useless GUI for adding aliases
21:28:32FromDiscord<Phil> (edit) "In reply to @ShalokShalom "Do you already know": I had one in mind already had I not come up with anything else, would've been a pretty useless GUI for adding aliases ... " added "to a bashrc or zshrc file"
21:29:19FromDiscord<ShalokShalom> I could come up with one 😛
21:30:16FromDiscord<ShalokShalom> I know about an app, that is pretty much obligated to be written in qml 😊
21:30:27FromDiscord<Phil> The issue is that any GUI that would be useable would be one that has a 99% likelihood of just being too complex in featurescope
21:30:40FromDiscord<ShalokShalom> Probably
21:30:43FromDiscord<Phil> At least for starting out
21:31:07FromDiscord<ShalokShalom> My previous teacher coded an editor
21:31:17FromDiscord<ShalokShalom> I think that's the most simple
21:31:22FromDiscord<ShalokShalom> She at least thought so
21:32:35FromDiscord<ShalokShalom> And I wanted to code an UI for nspawn
21:33:26FromDiscord<ShalokShalom> That is pretty much determined to be be written in QML
21:33:57FromDiscord<ShalokShalom> And depite me loving to use Qt, its really not as convenient to write apps
21:34:04FromDiscord<ShalokShalom> For me, personally
21:36:10*ltriant quit (Ping timeout: 252 seconds)
21:37:05FromDiscord<Phil> In what sense is it inconvenient?
21:42:11FromDiscord<ShalokShalom> Mostly that it has no good visual creation suit
21:42:22FromDiscord<ShalokShalom> The one that it has, it closed source and bad
21:42:33FromDiscord<ShalokShalom> I probably shared this with you already
21:43:05FromDiscord<ShalokShalom> The author has also a section about qt: https://medium.com/swlh/what-makes-godot-engine-great-for-advance-gui-applications-b1cfb941df3b
21:44:29FromDiscord<ShalokShalom> But my imagined nspawn GUI would have to use Qt, to integrate proper into the desktop↵↵I would like it as a Plasmoid, and that's Qt Qml
21:45:00FromDiscord<ShalokShalom> Here, I have already written a Readme 😄↵↵https://codeberg.org/ShalokShalom/Linda
21:50:50*moonlit quit (Ping timeout: 252 seconds)
21:55:41FromDiscord<Phil> Ah, right, once I am actually understanding the fundamentals of QML I likely should look into available QML tooling
22:13:25*moonlit joined #nim
22:20:23FromDiscord<ShalokShalom> It's quite confusing
22:20:34FromDiscord<ShalokShalom> There are different IDEs
22:21:01FromDiscord<ShalokShalom> One secret tip: Kdenlive
22:38:16arkanoidcould you please explain me in other words what does threadvar do? https://nim-lang.org/docs/manual.html#threads-threadvar-pragma
22:40:42arkanoidI have a heap structure (arraymancer Tensor) that I need to share among many threads, and perform lock on read/write operations. What's the nim idiomatic way to achieve this?
22:41:25*jmdaemon joined #nim
22:41:40arkanoidas sharing heap is a no-no in nim threading, how I am expected to pass an arraymancer.Tensor to many threads?
22:52:29*ltriant joined #nim
22:57:55*ltriant quit (Ping timeout: 268 seconds)
23:07:04*ltriant joined #nim
23:34:17FromDiscord<planetis> Threadvar will make an 'instance' of the var per thread, so its not shared.
23:48:48FromDiscord<Elegantbeef> sent a code paste, see https://play.nim-lang.org/#ix=4iRQ
23:50:12FromDiscord<Elegantbeef> I guess that doesnt work for options
23:52:44FromDiscord<Elegantbeef> sent a code paste, see https://play.nim-lang.org/#ix=4iRR
23:56:53FromDiscord<Elegantbeef> sent a code paste, see https://play.nim-lang.org/#ix=4iRU
23:56:56FromDiscord<Elegantbeef> So odd that the sequence compiles but options do not
23:57:10FromDiscord<Elegantbeef> Guess i have a bug to investigate