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:58 | arkanoid | using var parametes doesn't imply heap allocations, right? It's just a safe pointer to a stack variable moving around, correct? |
03:52:38 | FromDiscord | <Elegantbeef> `var` parameters are mutable reference that data can be on the stack or heap |
03:53:32 | arkanoid | thanks |
03:56:30 | arkanoid | I 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:12 | arkanoid | I 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:35 | arkanoid | plus passing "var output" as var parameter |
03:58:25 | FromDiscord | <Elegantbeef> Does the procedure capture any inputs? |
03:59:44 | arkanoid | sorry, 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:59 | arkanoid | the 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:49 | FromDiscord | <Elegantbeef> https://nim-lang.org/docs/intern.html#code-generation-for-closures a bit busy so hoping this will help |
04:09:42 | arkanoid | Elegantbeef, much gratitude! |
04:14:56 | arkanoid | well, I've also received kinda answer from weave library itself: Error: illegal capture 'recurse' because 'async_recurse' has the calling convention: <nimcall> |
04:16:07 | FromDiscord | <Elegantbeef> Basically if you use a variable that isnt global inside of a procedure body your procedure needs to capture the environment |
04:16:59 | arkanoid | so 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:22 | arkanoid | how 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:34 | FromDiscord | <Elegantbeef> Yea especially when it comes to threading a closure is confounding |
04:18:37 | arkanoid | or is better to drop a "var" in front of each parameter, to assure it |
04:19:03 | FromDiscord | <Elegantbeef> Nim passes by reference on large objects/seq/string |
04:19:55 | arkanoid | ok but here I have a recursion that is being called for trillion of times, each copy would cost |
04:20:17 | arkanoid | I'm using a closure here exactly for this, hoping that this would save lots of copies |
04:20:20 | FromDiscord | <Elegantbeef> What type is it? |
04:20:46 | FromDiscord | <Elegantbeef> Is it atleast 24 bytes? |
04:20:50 | FromDiscord | <Elegantbeef> If so nim does by reference |
04:25:18 | arkanoid | these 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:58 | arkanoid | now sure how to mangle all these into an efficient recursion |
04:27:07 | arkanoid | my 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:42 | arkanoid | the 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:54 | arkanoid | I'll take a nap over this question, maybe I'll dream an answer. Thanks for the feedback |
04:59:00 | NimEventer | New Nimble package! webby - Web utilities - http headers and query parsing., see https://github.com/treeform/webby/ |
05:06:16 | FromDiscord | <ShalokShalom> In reply to @Isofruit "Araqs approach seems to": How would data types be wrong in this case ? |
05:07:55 | FromDiscord | <ShalokShalom> And do you do property testing? |
05:21:51 | FromDiscord | <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:23 | FromDiscord | <treeform> eventually |
06:14:05 | * | ltriant joined #nim |
06:19:36 | * | ltriant quit (Ping timeout: 272 seconds) |
06:55:05 | FromDiscord | <Phil> In reply to @ShalokShalom "How would data types": If I knew I'd already be happy with a testing strategy |
06:56:58 | FromDiscord | <ShalokShalom> I mean, conceptionally |
07:31:29 | FromDiscord | <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:10 | FromDiscord | <juelix> Can Nim be used to implement a fast and secure webAPI? |
08:03:44 | FromDiscord | <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:11 | FromDiscord | <ajusa> In reply to @treeform "eventually": And multipart encoding I assume? |
09:22:37 | FromDiscord | <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:09 | NimEventer | New thread by fxn: Why is the cursor pragma called cursor?, see https://forum.nim-lang.org/t/9733 |
12:09:18 | NimEventer | New 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:18 | FromDiscord | <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:54 | FromDiscord | <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:11 | FromDiscord | <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:44 | FromDiscord | <Phil> Can't say that it does https://media.discordapp.net/attachments/371759389889003532/1053715380511719454/image.png |
16:48:59 | FromDiscord | <Phil> That's on firefox |
16:52:01 | FromDiscord | <xoich (xoich)> ok, it seems I can use std/terminal/getch |
16:58:10 | FromDiscord | <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:38 | FromDiscord | <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:19 | FromDiscord | <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:55 | FromDiscord | <Phil> The problem is that it then will lead to stuff like this: https://media.discordapp.net/attachments/371759389889003532/1053719456112717845/image.png |
17:09:23 | FromDiscord | <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:32 | FromDiscord | <albassort> @Phil |
17:34:45 | FromDiscord | <Phil> In reply to @albassort "<@180601887916163073>": I have been summoned |
17:34:51 | FromDiscord | <albassort> hi hope your day is well <3 |
17:35:21 | FromDiscord | <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:44 | FromDiscord | <Phil> Thanks for the well wishes, did I do anything to deserve those though 😛 |
17:35:49 | FromDiscord | <Phil> (edit) "😛" => "😛?" |
17:35:59 | FromDiscord | <albassort> ok but, i know this is strange for us, but i hope you do something away from your programming terminal |
17:36:15 | FromDiscord | <albassort> its hard for me, i know |
17:37:17 | FromDiscord | <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:40 | FromDiscord | <Phil> Luckily public transit is good enough that I can get from A to B without dropping the convo |
17:37:54 | FromDiscord | <albassort> ...im starting to know a pattern amongst programmers by trade |
17:38:06 | FromDiscord | <albassort> (edit) "know" => "notice" |
17:38:13 | FromDiscord | <Phil> Glued to a screen and unwilling to be bored in public transit? |
17:38:24 | FromDiscord | <albassort> more like |
17:38:35 | FromDiscord | <albassort> hehe when i get done coding at work i get to code at home :D |
17:39:10 | FromDiscord | <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:58 | FromDiscord | <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:03 | FromDiscord | <albassort> heavily paraphrasing |
17:42:36 | FromDiscord | <albassort> i do feel i should take a break but idk when I'll have the time |
17:43:19 | FromDiscord | <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:49 | FromDiscord | <albassort> https://media.discordapp.net/attachments/371759389889003532/1053729998609076345/image.png |
17:46:59 | FromDiscord | <albassort> https://media.discordapp.net/attachments/371759389889003532/1053730041382588426/image.png |
17:47:11 | FromDiscord | <albassort> does this look like a memory leak |
17:47:35 | FromDiscord | <albassort> yea looks like a memory leask |
17:49:32 | Amun-Ra | albassort: do you use nim suppressions for valgrind? |
17:49:46 | FromDiscord | <albassort> no...? |
17:50:39 | Amun-Ra | although I don't remember if any gtk app will leak when valgrined… |
17:50:58 | FromDiscord | <albassort> im doing uhhhh |
17:51:00 | FromDiscord | <albassort> weird things |
17:51:40 | FromDiscord | <albassort> i haven't figured out how to break and resume the main loop remotely from now |
17:51:48 | Amun-Ra | I use this https://pastebin.com/ghuvfSbB |
17:51:58 | FromDiscord | <albassort> so currently it destroys itself and then i reset it |
17:52:21 | FromDiscord | <albassort> sent a code paste, see https://play.nim-lang.org/#ix=4iQf |
17:52:56 | FromDiscord | <albassort> sent a code paste, see https://play.nim-lang.org/#ix=4iQh |
17:52:56 | Amun-Ra | ahm C |
17:53:03 | FromDiscord | <albassort> (edit) "https://play.nim-lang.org/#ix=4iQh" => "https://play.nim-lang.org/#ix=4iQi" |
17:53:38 | FromDiscord | <albassort> im trying to figure out a good way to implement a cleanup rpoc |
17:53:41 | FromDiscord | <albassort> (edit) "rpoc" => "proc" |
17:53:45 | FromDiscord | <albassort> (edit) "proc" => "function" |
18:03:39 | FromDiscord | <deech> sent a code paste, see https://play.nim-lang.org/#ix=4iQl |
18:06:07 | FromDiscord | <<She>Horizon</Her>> In reply to @Isofruit "There are CLI apps": Getch is on example |
18:06:12 | FromDiscord | <<She>Horizon</Her>> Well, the function |
18:06:20 | FromDiscord | <<She>Horizon</Her>> An app that does than... Not sure |
18:15:45 | FromDiscord | <Phil> In reply to @Event Horizon "An app that does": Git log does with exiting you if you press q |
18:15:53 | FromDiscord | <Phil> Just remembered |
18:16:19 | FromDiscord | <gongongagaga> i need to add `-d:ssl` so nim stops complaining about stuff↵how do i do this with nimble |
18:16:29 | FromDiscord | <<She>Horizon</Her>> Ah neat |
18:16:42 | FromDiscord | <Phil> In reply to @gongongagaga "i need to add": In what sense? |
18:16:47 | FromDiscord | <<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:54 | FromDiscord | <Phil> nimble task? |
18:16:55 | FromDiscord | <<She>Horizon</Her>> Should be the case, at least! |
18:17:17 | FromDiscord | <<She>Horizon</Her>> Probably when you're using ssl features in a nimble package- |
18:17:31 | FromDiscord | <gongongagaga> In reply to @Event Horizon "Just a `config.nims` file": this worked, thanks |
18:19:29 | FromDiscord | <<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:55 | FromDiscord | <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:53 | NimEventer | New Nimble package! tram - 🚋 Traffic Analysis in Nim, see https://github.com/facorazza/tram |
21:00:49 | FromDiscord | <QuiteQuietQ> sent a code paste, see https://play.nim-lang.org/#ix=4iR4 |
21:04:08 | FromDiscord | <Elegantbeef> `for e in elements.mitems` |
21:05:58 | FromDiscord | <QuiteQuietQ> omg, of course, thanks! that could really be written in the error message |
21:06:21 | FromDiscord | <Elegantbeef> nope |
21:07:27 | FromDiscord | <QuiteQuietQ> The compiler can guess that I am trying to iterate a sequence of objects and modify some attributes there, imho |
21:07:35 | FromDiscord | <QuiteQuietQ> could guess |
21:08:43 | FromDiscord | <Elegantbeef> well `mitems` is just a convention and not hardcoded |
21:08:52 | * | wallabra quit (Remote host closed the connection) |
21:08:55 | FromDiscord | <Elegantbeef> So you just as likely could mean a completely different iterator |
21:09:23 | FromDiscord | <Elegantbeef> But also ref types dont have the same mutability rules |
21:09:37 | FromDiscord | <QuiteQuietQ> i don't mean iterator, but iteration itself↵like going over elements one by one |
21:12:32 | FromDiscord | <Elegantbeef> For field access it might be simple, but for covering all bases it is more complicated |
21:12:43 | FromDiscord | <Elegantbeef> So it's quite a complex solution methinks |
21:13:31 | * | wallabra joined #nim |
21:18:11 | FromDiscord | <deech> sent a code paste, see https://play.nim-lang.org/#ix=4iRa |
21:23:49 | FromDiscord | <ShalokShalom> In reply to @Isofruit "Again, if I understood": Aaaaah↵↵You know so much as I do 😅 |
21:24:03 | FromDiscord | <ShalokShalom> How unusual 😅 |
21:27:15 | FromDiscord | <ShalokShalom> In reply to @Isofruit "It is, I recently": Do you already know what app your want to do |
21:28:24 | FromDiscord | <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:32 | FromDiscord | <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:19 | FromDiscord | <ShalokShalom> I could come up with one 😛 |
21:30:16 | FromDiscord | <ShalokShalom> I know about an app, that is pretty much obligated to be written in qml 😊 |
21:30:27 | FromDiscord | <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:40 | FromDiscord | <ShalokShalom> Probably |
21:30:43 | FromDiscord | <Phil> At least for starting out |
21:31:07 | FromDiscord | <ShalokShalom> My previous teacher coded an editor |
21:31:17 | FromDiscord | <ShalokShalom> I think that's the most simple |
21:31:22 | FromDiscord | <ShalokShalom> She at least thought so |
21:32:35 | FromDiscord | <ShalokShalom> And I wanted to code an UI for nspawn |
21:33:26 | FromDiscord | <ShalokShalom> That is pretty much determined to be be written in QML |
21:33:57 | FromDiscord | <ShalokShalom> And depite me loving to use Qt, its really not as convenient to write apps |
21:34:04 | FromDiscord | <ShalokShalom> For me, personally |
21:36:10 | * | ltriant quit (Ping timeout: 252 seconds) |
21:37:05 | FromDiscord | <Phil> In what sense is it inconvenient? |
21:42:11 | FromDiscord | <ShalokShalom> Mostly that it has no good visual creation suit |
21:42:22 | FromDiscord | <ShalokShalom> The one that it has, it closed source and bad |
21:42:33 | FromDiscord | <ShalokShalom> I probably shared this with you already |
21:43:05 | FromDiscord | <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:29 | FromDiscord | <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:00 | FromDiscord | <ShalokShalom> Here, I have already written a Readme 😄↵↵https://codeberg.org/ShalokShalom/Linda |
21:50:50 | * | moonlit quit (Ping timeout: 252 seconds) |
21:55:41 | FromDiscord | <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:23 | FromDiscord | <ShalokShalom> It's quite confusing |
22:20:34 | FromDiscord | <ShalokShalom> There are different IDEs |
22:21:01 | FromDiscord | <ShalokShalom> One secret tip: Kdenlive |
22:38:16 | arkanoid | could you please explain me in other words what does threadvar do? https://nim-lang.org/docs/manual.html#threads-threadvar-pragma |
22:40:42 | arkanoid | I 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:40 | arkanoid | as 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:17 | FromDiscord | <planetis> Threadvar will make an 'instance' of the var per thread, so its not shared. |
23:48:48 | FromDiscord | <Elegantbeef> sent a code paste, see https://play.nim-lang.org/#ix=4iRQ |
23:50:12 | FromDiscord | <Elegantbeef> I guess that doesnt work for options |
23:52:44 | FromDiscord | <Elegantbeef> sent a code paste, see https://play.nim-lang.org/#ix=4iRR |
23:56:53 | FromDiscord | <Elegantbeef> sent a code paste, see https://play.nim-lang.org/#ix=4iRU |
23:56:56 | FromDiscord | <Elegantbeef> So odd that the sequence compiles but options do not |
23:57:10 | FromDiscord | <Elegantbeef> Guess i have a bug to investigate |