<< 04-06-2024 >>

00:08:03FromDiscord<zumi.dxy> @pmunch been using your labeledtry thing some more now, I kinda wish there was some way I know whether a specific statement inside labeledtry can throw exceptions so I can determine if I should label it or not↵the compiler complains about labeledTry being able to raise a generic `Exception` when I use `{.raises:[].}`, and I think `{.raises: [Exception].}` isn't granular
00:08:43FromDiscord<zumi.dxy> the `|>` looks nice with a ligatured font at least https://media.discordapp.net/attachments/371759389889003532/1247341227829891082/Screenshot_20240604_070016_Termux.jpg?ex=665fac8b&is=665e5b0b&hm=00e143bb940df3378f69727d0ff97b3cf21c2459139547203d21472f972b61fc&
00:25:33*beholders_eye quit (Read error: Connection reset by peer)
00:26:01FromDiscord<dawidek.2137> can you import with "absolute" path starting from .nimble project's root, instead of relative to file?
00:27:19*Lord_Nightmare quit (Quit: ZNC - http://znc.in)
00:29:56*Lord_Nightmare joined #nim
00:31:19*beholders_eye joined #nim
00:34:46FromDiscord<dawidek.2137> another funny question: can I use `--import:PATH` without getting annoying `imported and not used` errors? (preferably only for the files imported with this switch!)
00:38:29*beholders_eye quit (Ping timeout: 240 seconds)
01:36:30NimEventerNew Nimble package! chame - Standards-compliant HTML5 parser in Nim, see https://chawan.net/doc/chame/
01:36:30NimEventerNew Nimble package! chagashi - Implementation of the WHATWG-specified text encoders and decoders, see https://git.sr.ht/~bptato/chagashi
01:36:34NimEventerNew Nimble package! monoucha - High-level wrapper for QuickJS, see https://git.sr.ht/~bptato/monoucha
02:55:19*fallback joined #nim
03:26:36*krux02 quit (Remote host closed the connection)
05:08:36ehmryhows does one get nimble to find the `compiler` modules?
05:10:03ehmry`nimble install compiler` installs `nim` instead
05:20:42FromDiscord<Robyn [She/Her]> In reply to @ehmry "hows does one get": You have to add Nim's compiler to the path
05:21:08FromDiscord<Robyn [She/Her]> `--path:$nim` should be enough?
05:32:58ehmryso do people actually use nimble, or use --path:…?
05:33:32FromDiscord<ElegantBeef> Of course they actually use nimble files
05:33:55ehmrybut what about package that depend on compiler?
05:34:08FromDiscord<ElegantBeef> I use ` import "$nim" / compiler /...`
05:34:24FromDiscord<ElegantBeef> I never want to use a compiler package that is not the same as the nim version compiling
05:34:55ehmryis that documented somewhere?
05:35:04FromDiscord<ElegantBeef> I think it is, but I do not recall where
05:38:10FromDiscord<ElegantBeef> https://nim-lang.org/docs/nimc.html#compiler-usage-commandminusline-switches
05:41:36ehmryElegantBeef: thank you, that solves my problem
05:57:30FromDiscord<pmunch> In reply to @zumi.dxy "<@392962235737047041> been using your": Hmm, quite possible that labelTry itself can technically throw an exception. I haven't got the code in front of me, but it's not unlikely that it does something which can technically throw but which doesn't because it's built in a macro to always work.
05:59:09FromDiscord<ElegantBeef> Think they are after a hint or a warning when they do not transform one
06:26:30*deadmarshal_ quit (Remote host closed the connection)
06:46:54*deadmarshal_ joined #nim
07:04:29*kenran joined #nim
07:15:15*rockcavera quit (Remote host closed the connection)
07:44:37FromDiscord<Robyn [She/Her]> In Nim is there a way of setting of setting the name of an anonymous proc for debugging?
07:45:59FromDiscord<ElegantBeef> `exportc` can be used but good luck
07:46:30FromDiscord<Robyn [She/Her]> Why good luck?
07:46:33FromDiscord<ElegantBeef> <https://github.com/beef331/traitor/blob/master/traitor.nim#L184-L185> a cursed way of doing it
07:46:41FromDiscord<ElegantBeef> Cause depending what you're doing the symbols might overlap
07:47:02FromDiscord<Robyn [She/Her]> Ah
07:48:06FromDiscord<Robyn [She/Her]> In reply to @elegantbeef "<https://github.com/beef331/traitor/blob/master/tra": Might do something like this if it's the best option
07:50:12FromDiscord<Phil> sent a code paste, see https://play.nim-lang.org/#pasty=pJVfZHMS
07:50:57FromDiscord<Phil> this is with --debugger:native
07:51:11FromDiscord<Phil> and the typical no-omit-frame-pointer flags
08:08:59*SchweinDeBurg quit (Quit: WeeChat 4.4.0-dev)
08:09:24*SchweinDeBurg joined #nim
08:26:01FromDiscord<Phil> sent a code paste, see https://play.nim-lang.org/#pasty=bhjWLUct
08:26:16FromDiscord<Phil> (edit) "https://play.nim-lang.org/#pasty=vDFWdJSC" => "https://play.nim-lang.org/#pasty=ZIUduvSb"
08:26:41FromDiscord<Phil> (edit) "https://play.nim-lang.org/#pasty=rUiHePeK" => "https://play.nim-lang.org/#pasty=HIzamkLm"
08:50:08FromDiscord<Robyn [She/Her]> Oh can a pragma macro add a name to an anonymous proc?
08:50:51FromDiscord<Robyn [She/Her]> And do procs passed in via parameters retain their name or is that info lost?
09:02:32FromDiscord<dawidek.2137> is there a pragma to make a variable initialize only once per proc call?↵basically move the variable initialization out of loops similiar to {.global.}
09:03:53FromDiscord<Robyn [She/Her]> In reply to @dawidek.2137 "is there a pragma": I believe `once` exists btw it's not a pragma, it's a block of code
09:03:59FromDiscord<Robyn [She/Her]> Maybe it works as a pragma? Not sure
09:08:58FromDiscord<pmunch> In reply to @zumi.dxy "the `|>` looks nice": Tried this out myself, and realised the error is that you're just not `except`-ing anything..
09:09:33FromDiscord<pmunch> sent a code paste, see https://play.nim-lang.org/#pasty=CoFiHUrz
09:57:07FromDiscord<zumi.dxy> Well it is a cropped screenshot
09:58:28FromDiscord<zumi.dxy> there is an `except Exception as e` down below
09:58:54FromDiscord<pmunch> Oh
09:58:55FromDiscord<pmunch> Hmm
09:59:31FromDiscord<zumi.dxy> what I wanted was a way to know which lines may throw an exception so I don't have to label every line↵...or maybe not, since NoLabel is a thing
09:59:34FromDiscord<pmunch> Do you have a minimal repro I could play with?
09:59:35FromDiscord<zumi.dxy> :p
09:59:48*ntat joined #nim
09:59:57FromDiscord<pmunch> Yeah the idea is that you only label the things you know how to handle
10:00:27FromDiscord<pmunch> So you chuck a big try/except around some code, label the scenarios you know can go wrong, and then handle those.
10:00:53FromDiscord<zumi.dxy> It's not really a bug and more a "feature request", although I thought `{.raises:[].} would have been a block pragma (because `{.cast.}` is
10:01:09FromDiscord<zumi.dxy> In reply to @pmunch "So you chuck a": Fair enough I suppose
10:01:34FromDiscord<pmunch> NoLabel basically means that something you didn't except to go wrong went wrong
10:01:44FromDiscord<pmunch> In which case you should probably abort
10:02:17FromDiscord<zumi.dxy> I mean I've already done that kind of thing with the `results` package↵but the problem there is exception types that are too generic
10:02:25FromDiscord<zumi.dxy> so labeledTry gives an edge there at least
10:03:21FromDiscord<zumi.dxy> maybe I can try both :D
10:03:50FromDiscord<zumi.dxy> (as in, using `results` with `labeledTry` I mean)
10:05:11FromDiscord<Robyn [She/Her]> With results, wouldn't you return an error enum?
10:07:47FromDiscord<zumi.dxy> Sometimes, yeah
10:08:38FromDiscord<zumi.dxy> but apparently most of the time it's just a string if you don't need special cases
10:09:06FromDiscord<zumi.dxy> meanwhile http servers↵where you need to return different error codes depending on what happens
10:09:52FromDiscord<zumi.dxy> (or just return 200 OK with `{"message": "error lmao get trolled"}`
10:09:58FromDiscord<pmunch> The goal of labeltry is to give you a type safe way to differentiate between different things that can fail for the same reason. For example if you need to do two network calls, both can fail for the same reasons, but with labeltry you don't need to put each in its own `try`/`except` to figure out which one failed.
10:10:39FromDiscord<pmunch> That just sounds like a very poorly behaved API tbh..
10:13:11FromDiscord<zumi.dxy> lmaooooo
10:13:20FromDiscord<zumi.dxy> yeah
10:28:12*beholders_eye joined #nim
10:36:25FromDiscord<Robyn [She/Her]> In reply to @zumi.dxy "(or just return 200": Sounds horrid
10:42:21*beholders_eye quit (Ping timeout: 272 seconds)
10:57:37*beholders_eye joined #nim
12:19:39*beholders_eye quit (Read error: Connection reset by peer)
12:20:33*xet7 quit (Quit: Leaving)
12:25:18*beholders_eye joined #nim
13:15:59*beholders_eye quit (Read error: Connection reset by peer)
13:27:41*beholders_eye joined #nim
14:23:28FromDiscord<Robyn [She/Her]> In a template can I create a Nim identifier from a static string?
14:29:02FromDiscord<threefour> Why would my program be crashing when trying to collect a cycle with ORC, but Boehm runs perfectly?
14:29:06FromDiscord<Robyn [She/Her]> Scratch that, how do I get the name of a proc?
14:29:08*kenran quit (Remote host closed the connection)
14:29:31FromDiscord<Robyn [She/Her]> In reply to @threefour "Why would my program": Boehm works differently from ORC, what's the error message when ORC crashes?
14:30:50FromDiscord<threefour> sent a code paste, see https://play.nim-lang.org/#pasty=fZsONtUL
14:32:14FromDiscord<threefour> It's a guaranteed crash with ORC, and a guaranteed success with Boehm.
14:32:26FromDiscord<Robyn [She/Her]> Are you doing multithreading? What library are you using?
14:33:39FromDiscord<threefour> Yes, no library. Just `createThread` and `joinThread`, specifically because I've had only issues with libraries.
14:34:20FromDiscord<odexine> are you sharing references between threads
14:34:59FromDiscord<threefour> Wouldn't that cause issues with Boehm too if that was the case?
14:35:34FromDiscord<odexine> i believe it wouldnt
14:37:06FromDiscord<threefour> Then I guess I'll need to sniff around for that
14:41:13*rockcavera joined #nim
14:44:39FromDiscord<threefour> Also, I call `createThread` 4 times in my code. With ORC, my process ends up with 5 threads (including main thread), which is what I expect. With Boehm, I somehow end up with 16 threads. What's that about?
14:45:03FromDiscord<Robyn [She/Her]> Maybe it's something to do with the GC?
14:45:10FromDiscord<odexine> Böhm probably uses threads for the GC
14:45:11FromDiscord<Robyn [She/Her]> No clue though, sorry
14:46:04FromDiscord<threefour> Makes sense
14:46:43FromDiscord<nocturn9x> is there a way to track memory allocations in nim
14:46:48FromDiscord<nocturn9x> like know what is allocated when and how
14:46:52FromDiscord<nocturn9x> (edit) "like know what is allocated when and how ... " added "big"
14:53:59*lucasta joined #nim
14:58:02FromDiscord<Phil> So I'm looking into GTask in GTK and its examples
14:58:52FromDiscord<Phil> Does anyone actually understand wtf the example does and how it even works?↵https://docs.gtk.org/gio/class.Task.html↵Like, I'm reading through the first example. I assume baker_bake_cake_async is the entry point into this thing.↵It creates a task... and then it sets the return value ?!
14:59:14FromDiscord<Phil> I am so fucking confused
15:03:46FromDiscord<Phil> I think this whole thing makes a lot more sense when I ignore "Task" as an async operation and just focus on the multithreaded application of it
15:22:58FromDiscord<threefour> sent a code paste, see https://play.nim-lang.org/#pasty=jZJvssTF
15:24:12FromDiscord<odexine> In reply to @threefour "If the cycle collection": sounds like it to me yes
16:20:45*Batzy_ joined #nim
16:21:06FromDiscord<threefour> Why are indirect calls not gc-safe?
16:24:14*Batzy quit (Ping timeout: 268 seconds)
16:29:22FromDiscord<ravinder387> sent a code paste, see https://play.nim-lang.org/#pasty=aILOasMx
16:29:51FromDiscord<ravinder387> sent a code paste, see https://play.nim-lang.org/#pasty=AHQQcRHX
16:36:19*ntat quit (Quit: Leaving)
16:46:07*lucasta quit (Quit: Leaving)
16:55:45FromDiscord<threefour> You can do a `Thread[void]`, and then you wouldn't have a third argument on the `createThread` call, if you don't want to pass any data to the thread.
17:03:19*ntat joined #nim
17:24:49FromDiscord<tauruuuuuus> is there a roadmap for the next minor version of nim anywhere?
17:27:23*beholders_eye quit (Read error: Connection reset by peer)
17:33:08*beholders_eye joined #nim
17:58:17*ntat quit (Quit: Leaving)
19:05:48FromDiscord<dddeserttt> Hello
19:07:46*krux02 joined #nim
19:07:57FromDiscord<dddeserttt> Taurus you like nim?
19:32:03*beholders_eye quit (Read error: Connection reset by peer)
19:38:00*beholders_eye joined #nim
19:58:17*jmdaemon joined #nim
20:08:49FromDiscord<Robyn [She/Her]> I don't have the patience with my macro oof
20:08:58FromDiscord<Robyn [She/Her]> I can't stand it ;-;
20:26:48FromDiscord<threefour> Where are Nim's smart/shared pointers again?
20:27:19FromDiscord<threefour> Nvm found it
20:41:03*rockcavera quit (Ping timeout: 252 seconds)
21:01:07*Batzy joined #nim
21:04:12*Batzy_ quit (Ping timeout: 268 seconds)
21:17:38FromDiscord<frusadev> Hi everyone. I was wondering... What actually causes nimsuggest to return 1 ?
21:52:05*Batzy quit (Ping timeout: 240 seconds)
22:20:29*jmdaemon quit (Ping timeout: 240 seconds)
22:38:32*rockcavera joined #nim
23:41:43*beholders_eye quit (Read error: Connection reset by peer)
23:47:31*beholders_eye joined #nim