<< 26-12-2023 >>

00:26:43FromDiscord<pptx704> sent a code paste, see https://play.nim-lang.org/#ix=html>
00:44:00*Guest66 joined #nim
01:19:02*azimut joined #nim
01:21:51*Guest66 quit (Quit: Client closed)
01:25:26*azimut quit (Remote host closed the connection)
01:25:45*azimut joined #nim
02:12:00*derpydoo quit (Quit: derpydoo)
02:14:49*derpydoo joined #nim
03:03:37*Batzy quit (Ping timeout: 260 seconds)
03:18:44FromDiscord<janakali> @pptx704 this one is weird, I've tried it on android. And in my case it can't find 'TimeoutError' exception. I had to import `std/net` for it to work properly..↵↵Also, only synchronous httpclient supports timeouts: https://nim-lang.org/docs/httpclient.html#timeouts
03:21:59FromDiscord<Prestige> I'm trying to create a symlink of a directory, but it always ends up showing as a file instead. I assume this is because `createSymlink` isn't recursive/doesn't support dirs? Do I just need to create my own recursive function to symlink everything?
03:23:12FromDiscord<Elegantbeef> If you want to sym link a directory why would you need to recurse it?
03:24:21FromDiscord<Prestige> Because `createSymlink` doesn't seem to work with directories
03:24:59FromDiscord<Elegantbeef> Right, but sym linking files assumes you never create any new files
03:25:17FromDiscord<Elegantbeef> So the fix is to sym link the directory by either fixing or implementing your own `createSymLink`
03:26:10FromDiscord<Prestige> Right that's what I'm talking about doing, I assume I'd have to recreate the directory structure recursively and symlink each individual file
03:26:22FromDiscord<Prestige> I was wondering/hoping something like this already exists
03:26:41FromDiscord<Elegantbeef> That sounds like a lot of work when you just want to create a directory symlink
03:26:58FromDiscord<Prestige> I'm not aware of any alternatives
03:27:08FromDiscord<Prestige> I believe what I described is how `cp -rs` works
03:27:11FromDiscord<Elegantbeef> Make a symlink proc that links a directory to a directory
03:28:00FromDiscord<Prestige> What would that function do, though?
03:28:27FromDiscord<Elegantbeef> Properly call the underlying OS proc that does the symlinking
03:30:03FromDiscord<Elegantbeef> I just tested and on my system it creates a symlinked directory
03:30:43FromDiscord<Prestige> fg
03:30:55FromDiscord<Prestige> Can you reference any files within that directory though
03:31:02FromDiscord<Prestige> like within code
03:31:58FromDiscord<Elegantbeef> Yes
03:32:31FromDiscord<Prestige> What arguments are you providing? Mine says the symlink is broken
03:33:01FromDiscord<Elegantbeef> image.png https://media.discordapp.net/attachments/371759389889003532/1189048190801027073/image.png?ex=659cbe6c&is=658a496c&hm=a6644b69057f1c6739eb730be1915e4481d1f137a6493753652ac3dcfd40d9e2&
03:33:14FromDiscord<Prestige> hm an absolute path, I'll try that
03:34:19FromDiscord<Prestige> Okay absolute paths work, that's good to know...I wonder if I can get relative paths working
03:34:58FromDiscord<odexine> Relative paths are likely relative to the current working directory
03:37:48FromDiscord<Elegantbeef> Thought I'd try for fun to make bindings for nimib using a lisp language and now here I am trying to figure out how to properly set a dynamic library's variables
03:38:20FromDiscord<Elegantbeef> Languages really make this harder than they need to!
03:46:55*azimut quit (Ping timeout: 240 seconds)
03:58:20FromDiscord<pptx704> In reply to @janakali "<@695204658192449537> this one is": Yeah I used synchronous ones. I am not sure why it cannot catch the error.
03:58:52FromDiscord<pptx704> Also, is there any way to understand the number of available file descriptors in Nim?
03:58:59FromDiscord<pptx704> sent a code paste, see https://play.nim-lang.org/#ix=html>
03:59:31FromDiscord<pptx704> Getting this error, but when I checked `cat /proc/sys/fs/file-max`, it is technically infinity
04:00:54FromDiscord<leorize> FD limit is separated at multiple layers
04:01:04FromDiscord<leorize> the layer that you will hit the earliest is rlimit
04:01:19FromDiscord<leorize> see `ulimit -n`
04:01:29FromDiscord<pptx704> 1024 it seems
04:02:14FromDiscord<leorize> if you want to get and/or set this number in the program, see\: https://www.man7.org/linux/man-pages/man2/getrlimit.2.html
04:08:43*azimut joined #nim
04:24:57FromDiscord<pptx704> I see. Is this number, per-thread/per-process, or the total?
04:25:04*azimut quit (Remote host closed the connection)
04:25:28*azimut joined #nim
04:39:43*azimut quit (Ping timeout: 240 seconds)
05:24:51FromDiscord<leorize> see the notes section on the same page
08:32:43*derpydoo quit (Ping timeout: 256 seconds)
09:20:06*koltrast joined #nim
09:35:29*xet7 joined #nim
09:52:32*xet7 quit (Remote host closed the connection)
09:56:42FromDiscord<Phil> sent a code paste, see https://play.nim-lang.org/#ix=html>
09:57:07FromDiscord<Phil> sent a code paste, see https://play.nim-lang.org/#ix=html>
09:58:48FromDiscord<Elegantbeef> Have to go annotate it with `{.raises: [].}` thoughI do not get where an exception could be raised due to this code
09:58:51FromDiscord<Phil> I mean I get that isolating "msg" appears to be problematic but I don't get why.↵It's not a ref-type, it should be easily isolateable , I'm already catching Exception against my better judgement because logging forces me to
09:59:04FromDiscord<Elegantbeef> Did you read the warning
09:59:16FromDiscord<Elegantbeef> It's unrelated to isolated and just a `=destroy` error that can have exceptions
10:01:46FromDiscord<Phil> Hmm.↵What exactly are you suggesting to annotate with raises: [] ?↵On the procs it doesn't change anything and I don't think I've ever seen that used any other way
10:02:04FromDiscord<Elegantbeef> `isolated`'s destroy
10:02:08FromDiscord<Elegantbeef> Or your destroy
10:03:34FromDiscord<Phil> I don't have a custom destroy here, the code above doesn't show one and is enough to trigger the issue.↵So essentially change the source code of isolation.nim?
10:04:06FromDiscord<Phil> sent a code paste, see https://play.nim-lang.org/#ix=html>
10:04:28FromDiscord<Elegantbeef> Right cause it's telling you the `=destroy` for `dest.value` might raise
10:04:52FromDiscord<Phil> Yeah but that should cause compiler errors I thought ... hmm
10:05:04FromDiscord<Elegantbeef> https://github.com/nim-lang/Nim/blob/version-2-0/lib/system.nim#L370-L377
10:05:09FromDiscord<Elegantbeef> Nope
10:05:33FromDiscord<Elegantbeef> Atleast not in this wacky world apparently 😄
10:05:47FromDiscord<Elegantbeef> All of these `=destroys` should be marked `=destroy`
10:05:55FromDiscord<Phil> sent a code paste, see https://play.nim-lang.org/#ix=html>
10:06:32FromDiscord<Phil> This is several layers of unholy but it does the job.↵Now to figure out how to actually get a "clean" solution going because catch-and-log seems inappropriate here
10:07:07FromDiscord<Elegantbeef> I mean if your destructor raises an exception you're in a pretty bad place and should fatally crash
10:07:16FromDiscord<Elegantbeef> Returning resources almost never should fail 😄
10:07:41FromDiscord<Phil> I agree, but then I don't want a warning about it since this is the wrong place to look at then imo
10:07:54FromDiscord<Phil> Or rather I don't want to spam my user's logs with warnings about it
10:08:01FromDiscord<Phil> or rather their terminal, not logs
10:08:23FromDiscord<Phil> For this to go wrong you'd need to have done something horribly wrong somewhere else
10:10:34FromDiscord<Elegantbeef> https://github.com/nim-lang/Nim/blob/1324d2e04cb11aaa96e9ba9efc69aee47ed6c1d8/lib/system.nim#L369-L376 ah yea these are the culprit
10:10:36FromDiscord<Elegantbeef> Generic procedures not marked `raises:[]`
10:10:38FromDiscord<Phil (he/him)> So would this be as simple as adding the pragma and making a PR for 2 loc's?
10:10:40FromDiscord<Phil (he/him)> And yes I jumped over to matrix because I suspected the bridge was going through a struggle sesssion again
10:11:53FromDiscord<Elegantbeef> Maybe? I tried to reproduce the warning but cannot
10:12:15FromDiscord<Elegantbeef> Well tried outside of `=destroy`
10:13:20FromDiscord<Phil (he/him)> Huh, these may have seen some changes since 2.0
10:13:33FromDiscord<Phil (he/him)> Looking at them on my local system.nim and that one does look a tad different
10:13:40FromDiscord<Elegantbeef> They still do not have `{.raises:[].}` annotated
10:13:44FromDiscord<Elegantbeef> And yea they have changed a bit
10:14:09FromDiscord<Elegantbeef> Though `A =destroy is implicitly annotated with .raises: []`
10:14:10FromDiscord<Phil (he/him)> sent a code paste, see https://play.nim-lang.org/#ix=html>
10:14:28FromDiscord<Elegantbeef> Oh I linked 2.0... dumb of me
10:14:56FromDiscord<Phil (he/him)> I mean, I use 2.0 so still valid
10:21:54FromDiscord<Phil> Its explicitly object variants that mess it up
10:22:00FromDiscord<Phil> sending e.g. "string" is unproblematic
10:22:54FromDiscord<Phil> Nevermind, its objects too
10:24:05FromDiscord<Phil> sent a code paste, see https://play.nim-lang.org/#ix=html>
10:41:47FromDiscord<Phil (he/him)> sent a code paste, see https://play.nim-lang.org/#ix=html>
10:47:10*azimut joined #nim
11:01:41NimEventerNew thread by JiyaHana: How to use two operating systems in one laptop?, see https://forum.nim-lang.org/t/10804
11:06:33FromDiscord<odexine> ? How is this related to Nim LMAO
11:10:33FromDiscord<nnsee> wtf lol
11:50:15FromDiscord<cephonaltera> based unapologetic tech support requester
12:52:02*jmdaemon quit (Ping timeout: 252 seconds)
13:00:49*junaid_ joined #nim
14:04:35*derpydoo joined #nim
14:19:55NimEventerNew thread by Isofruit: ThreadButler - Multithreading with long-running threads that act as "servers", see https://forum.nim-lang.org/t/10805
14:26:53*derpydoo quit (Ping timeout: 256 seconds)
14:47:53*derpydoo joined #nim
14:54:31*azimut quit (Ping timeout: 240 seconds)
14:58:05*junaid_ quit (Remote host closed the connection)
15:05:28FromDiscord<nnsee> In reply to @NimEventer "New thread by Isofruit:": @Phil [this example] link's broken
15:15:09FromDiscord<tauruuuuuus> using std/parseopt in a nims file is a small nightmare x_x
15:17:20*om3ga joined #nim
15:23:50*azimut joined #nim
15:27:58*azimut quit (Remote host closed the connection)
15:28:19*azimut joined #nim
15:29:56FromDiscord<Phil> In reply to @nnsee "<@180601887916163073> [this example] link's": Which exactly?
15:31:45FromDiscord<nnsee> In reply to @isofruit "Which exactly?": literally ctrl-f `[this example]`
15:41:14FromDiscord<Chronos [She/Her]> In reply to @tauruuuuuus "using std/parseopt in a": Oh? Why?
15:55:38FromDiscord<tauruuuuuus> You cannot use the default parseOpt cmdline arg, because either if you run with `nim` or a shebang, everything single part of the nim/shebang command will pe passed inside the parser
15:56:37FromDiscord<tauruuuuuus> So you parse manually with paramCount/Str...but then you also have to be careful that, if the user does not pass any flag/option/args, you do not have to pass an empty string in, otherwise it's all over again
17:27:05FromDiscord<Phil> In reply to @nnsee "literally ctrl-f `[this example]`": Oh, between the 10 hyperlinks I messed that one up, fixed it
17:32:31FromDiscord<inv2004> @hugogranstrom Hi. I am sorry, disappereared for some time after askind about fragmented table.↵↵And now I came here to ask again 🙂
17:32:45FromDiscord<inv2004> (edit) "table.↵↵And" => "table in nimiSlides↵↵And"
17:33:03FromDiscord<inv2004> (edit) "came" => "am" | "amhere to ask again ... 🙂" added "about it"
17:35:18FromDiscord<inv2004> ... Just found
17:55:24NimEventerNew thread by Ward: Strange Behavior About Nim 2.0 Destructor, see https://forum.nim-lang.org/t/10807
17:55:28FromDiscord<Phil> Just found what?
18:04:59FromDiscord<Chronos [She/Her]> In reply to @tauruuuuuus "You cannot use the": Ah
19:21:02*derpydoo quit (Ping timeout: 256 seconds)
19:48:39FromDiscord<redmechanics> how can i covert an integer to a byte ?
19:55:08FromDiscord<inventormatt> you can call byte on your integer
20:02:44FromDiscord<hugogranstrom> In reply to @inv2004 "... Just found": Just found what?
20:02:58FromDiscord<griffith1deadly> In reply to @redmechanics "how can i covert": byte(integer)
20:03:52FromDiscord<nnsee> In reply to @hugogranstrom "Just found what?": it
20:08:50FromDiscord<hugogranstrom> In reply to @nnsee "it": Ah, just found my old answer
20:47:17FromDiscord<Elegantbeef> @hugogranstrom do you know where nimib annotates rendered codeblocks with the `nim` annotation?
20:48:21FromDiscord<Elegantbeef> It was like 3am last night but I could not find it myself 😄
20:48:51FromDiscord<Elegantbeef> Ah lol, just found it
20:50:46FromDiscord<nnsee> Just found what?
20:51:28*xet7 joined #nim
20:51:28FromDiscord<Elegantbeef> Where nimib annotates the code as nim for the html backend
20:52:28FromDiscord<nnsee> it was a... never mind
20:52:52FromDiscord<Elegantbeef> Even I do not make jokes that shitty
20:54:47FromDiscord<nnsee> ouch, that one hurt
20:59:19FromDiscord<hugogranstrom> In reply to @Elegantbeef "<@454991120028663809> do you know": We do it manually (as I think you found) but we also have highlight.js activated so it's not impossible that it could have a tiny part to play as well in the end result
20:59:59FromDiscord<Elegantbeef> Well it annotates the block from the partials which means `NbBlock` likely needs a `language` field to do `replace("$lang", lang)`
21:29:57*deadmarshal_ quit (Ping timeout: 268 seconds)
21:33:08FromDiscord<hugogranstrom> I think I'm confusing two different kinds of code blocks here now. `nbCode` and friends use the partials but markdown code blocks in `nbText` uses highlight.js
21:34:51FromDiscord<Elegantbeef> Yea I was wrong it's not as simple as I thought since the nim blocks are annotated "nohighlight"
21:36:27FromDiscord<Elegantbeef> Well I guess I could just replace that whole string....
21:36:44FromDiscord<Elegantbeef> image.png https://media.discordapp.net/attachments/371759389889003532/1189320917713690736/image.png?ex=659dbc6b&is=658b476b&hm=450bc9ffe2173394d51d058a6560db8a06d9a148156977ba0ee7df994565b7f5&
21:36:45FromDiscord<Elegantbeef> Ehhh
21:39:10FromDiscord<Elegantbeef> https://hatebin.com/mcqwyqqyrt boy is it ugly though
21:49:04*jmdaemon joined #nim
21:51:37FromDiscord<hugogranstrom> The "solution" is to create a new block with a new partial for general code (don't know if it already exists in some form already). `nbCode` is specifically for Nim code and you should ideally not use it for other languages. Ideally we should have a generic code block that the nbCode modifies though
21:52:06FromDiscord<Elegantbeef> Ah `nbCode` is badly named then 😄
21:52:52FromDiscord<hugogranstrom> I mean, nimib was primarily only aimed at nim code from the beginning 😉
21:54:01*deadmarshal_ joined #nim
21:54:40FromDiscord<Elegantbeef> Well I guess my PR is too hacky and I need to change it more
21:55:35FromDiscord<hugogranstrom> Yeah, if you used the block context instead it would be less hacky though
21:56:05FromDiscord<hugogranstrom> So like `blk.context["lang"] = "C"`
21:57:10FromDiscord<hugogranstrom> And in the end that might be something we want to use in a generic code block
21:58:14FromDiscord<hugogranstrom> And then we can do conditional stuff in the templates as well that `nohighlight` is only added if `lang` is empty (default).
21:59:35FromDiscord<Elegantbeef> Uh huh conditional templating... that's something I totally know how to do with this stuff 😄
21:59:54FromDiscord<Elegantbeef> This is where I say the shitty joke of "Oh you look like you know what you're doing why don't you handle this"
22:03:04FromDiscord<hugogranstrom> Hehe yeah it sounds more complex than it really is but I understand that diving into mustache templates is not something you want to do if you absolutely aren't forced to.
22:03:38FromDiscord<hugogranstrom> Let's make a deal then, open an issue in nimib about this so we don't forget it 🙈😂
22:04:10FromDiscord<Phil> mustache templates? Oh lord
22:06:24FromDiscord<hugogranstrom> You're familiar with them?
22:06:57FromDiscord<Elegantbeef> I've spent all my template points in Nim templates, not string templates!
22:06:58FromDiscord<Phil> We use them at work to generate rather elaborate elasticsearch templates
22:07:18FromDiscord<Phil> Did I mention that the query language for elasticsearch is the worst query language I've ever seen?
22:07:40FromDiscord<hugogranstrom> In reply to @Elegantbeef "I've spent all my": Sounds like a wise decision!
22:08:02FromDiscord<Elegantbeef> Anyway issue is made, so uhh be merry or something
22:08:39FromDiscord<hugogranstrom> In reply to @isofruit "Did I mention that": Oh, then you know the pains of it 😅 never seen the elasticsearch query language and I'm not tempted to find out after that introduction either 😵‍💫
22:09:13FromDiscord<Phil> In reply to @hugogranstrom "Oh, then you know": Luckily they're providing an SQL frontend recently so you can write SQL instead, which hoh boy is that an upgrade
22:09:57FromDiscord<hugogranstrom> In reply to @Elegantbeef "Anyway issue is made,": Awesome! We'll see when we get at this, but in the meantime if you want to get something working, create a new block (mostly copy-paste the nbBlock stuff)
22:10:22FromDiscord<hugogranstrom> In reply to @isofruit "Luckily they're providing an": Definitely sounds like an upgrade!
22:11:17FromDiscord<Phil> In reply to @hugogranstrom "Oh, then you know": Elasticsearch is basically super valuable if you need searchability through some seriously complex criteria that should enable scoring.↵Like matching by hobbies in a weighted way where mismatches shouldn't be hard exclusion criteria, just make your score worse and if you're still the best match after that you're still top of the list
22:11:30FromDiscord<Phil> (edit) "should enable" => "requires"
22:12:43FromDiscord<Elegantbeef> Got any references?↵(@hugogranstrom)
22:14:21FromDiscord<hugogranstrom> In reply to @isofruit "Elasticsearch is basically super": Sounds very powerful
22:14:33FromDiscord<Elegantbeef> Or is it just as simple as making a `NdBlock` and adding to it's context
22:15:16FromDiscord<hugogranstrom> Look at the definition of the `nbCode` template in `nimib/nimib.nim`
22:15:56FromDiscord<hugogranstrom> Then look at the partial (template) that is defined in some proc somewhere 🙈
22:16:40FromDiscord<hugogranstrom> But yes, essentially you make a NbBlock and add to it's context
22:21:03FromDiscord<Elegantbeef> Ah I think I understand how this templating works!
22:21:06FromDiscord<Elegantbeef> Let's see how fast that disappears
22:22:19FromDiscord<hugogranstrom> Nice, haha let's hope it lasts the entire night because I'm going to bed now 😴
22:23:22FromDiscord<hugogranstrom> Your new block will need a new name, and that name will be the key for the partial and renderProcs/renderPlan (if you stumble upon them?
22:23:39FromDiscord<hugogranstrom> (edit) "them?" => "them)"
22:37:01FromDiscord<Elegantbeef> Yea that works nicely
22:37:29FromDiscord<Elegantbeef> Also if `language` is nil `hljs` guesses the language so I guess it's a win
22:47:16FromDiscord<Phil> Naming things my mortal enemy
22:56:55FromDiscord<Phil> sent a code paste, see https://play.nim-lang.org/#ix=html>
22:57:05FromDiscord<Phil> (edit)
23:01:03FromDiscord<user2m> sent a code paste, see https://play.nim-lang.org/#ix=html>
23:07:12FromDiscord<Elegantbeef> The macro likely mutates `command` blocks
23:15:42FromDiscord<user2m> hmm ok I'll have a look at the source
23:46:31*azimut quit (Ping timeout: 240 seconds)