00:08:03 | FromDiscord | <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:43 | FromDiscord | <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:01 | FromDiscord | <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:46 | FromDiscord | <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:30 | NimEventer | New Nimble package! chame - Standards-compliant HTML5 parser in Nim, see https://chawan.net/doc/chame/ |
01:36:30 | NimEventer | New Nimble package! chagashi - Implementation of the WHATWG-specified text encoders and decoders, see https://git.sr.ht/~bptato/chagashi |
01:36:34 | NimEventer | New 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:36 | ehmry | hows does one get nimble to find the `compiler` modules? |
05:10:03 | ehmry | `nimble install compiler` installs `nim` instead |
05:20:42 | FromDiscord | <Robyn [She/Her]> In reply to @ehmry "hows does one get": You have to add Nim's compiler to the path |
05:21:08 | FromDiscord | <Robyn [She/Her]> `--path:$nim` should be enough? |
05:32:58 | ehmry | so do people actually use nimble, or use --path:…? |
05:33:32 | FromDiscord | <ElegantBeef> Of course they actually use nimble files |
05:33:55 | ehmry | but what about package that depend on compiler? |
05:34:08 | FromDiscord | <ElegantBeef> I use ` import "$nim" / compiler /...` |
05:34:24 | FromDiscord | <ElegantBeef> I never want to use a compiler package that is not the same as the nim version compiling |
05:34:55 | ehmry | is that documented somewhere? |
05:35:04 | FromDiscord | <ElegantBeef> I think it is, but I do not recall where |
05:38:10 | FromDiscord | <ElegantBeef> https://nim-lang.org/docs/nimc.html#compiler-usage-commandminusline-switches |
05:41:36 | ehmry | ElegantBeef: thank you, that solves my problem |
05:57:30 | FromDiscord | <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:09 | FromDiscord | <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:37 | FromDiscord | <Robyn [She/Her]> In Nim is there a way of setting of setting the name of an anonymous proc for debugging? |
07:45:59 | FromDiscord | <ElegantBeef> `exportc` can be used but good luck |
07:46:30 | FromDiscord | <Robyn [She/Her]> Why good luck? |
07:46:33 | FromDiscord | <ElegantBeef> <https://github.com/beef331/traitor/blob/master/traitor.nim#L184-L185> a cursed way of doing it |
07:46:41 | FromDiscord | <ElegantBeef> Cause depending what you're doing the symbols might overlap |
07:47:02 | FromDiscord | <Robyn [She/Her]> Ah |
07:48:06 | FromDiscord | <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:12 | FromDiscord | <Phil> sent a code paste, see https://play.nim-lang.org/#pasty=pJVfZHMS |
07:50:57 | FromDiscord | <Phil> this is with --debugger:native |
07:51:11 | FromDiscord | <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:01 | FromDiscord | <Phil> sent a code paste, see https://play.nim-lang.org/#pasty=bhjWLUct |
08:26:16 | FromDiscord | <Phil> (edit) "https://play.nim-lang.org/#pasty=vDFWdJSC" => "https://play.nim-lang.org/#pasty=ZIUduvSb" |
08:26:41 | FromDiscord | <Phil> (edit) "https://play.nim-lang.org/#pasty=rUiHePeK" => "https://play.nim-lang.org/#pasty=HIzamkLm" |
08:50:08 | FromDiscord | <Robyn [She/Her]> Oh can a pragma macro add a name to an anonymous proc? |
08:50:51 | FromDiscord | <Robyn [She/Her]> And do procs passed in via parameters retain their name or is that info lost? |
09:02:32 | FromDiscord | <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:53 | FromDiscord | <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:59 | FromDiscord | <Robyn [She/Her]> Maybe it works as a pragma? Not sure |
09:08:58 | FromDiscord | <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:33 | FromDiscord | <pmunch> sent a code paste, see https://play.nim-lang.org/#pasty=CoFiHUrz |
09:57:07 | FromDiscord | <zumi.dxy> Well it is a cropped screenshot |
09:58:28 | FromDiscord | <zumi.dxy> there is an `except Exception as e` down below |
09:58:54 | FromDiscord | <pmunch> Oh |
09:58:55 | FromDiscord | <pmunch> Hmm |
09:59:31 | FromDiscord | <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:34 | FromDiscord | <pmunch> Do you have a minimal repro I could play with? |
09:59:35 | FromDiscord | <zumi.dxy> :p |
09:59:48 | * | ntat joined #nim |
09:59:57 | FromDiscord | <pmunch> Yeah the idea is that you only label the things you know how to handle |
10:00:27 | FromDiscord | <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:53 | FromDiscord | <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:09 | FromDiscord | <zumi.dxy> In reply to @pmunch "So you chuck a": Fair enough I suppose |
10:01:34 | FromDiscord | <pmunch> NoLabel basically means that something you didn't except to go wrong went wrong |
10:01:44 | FromDiscord | <pmunch> In which case you should probably abort |
10:02:17 | FromDiscord | <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:25 | FromDiscord | <zumi.dxy> so labeledTry gives an edge there at least |
10:03:21 | FromDiscord | <zumi.dxy> maybe I can try both :D |
10:03:50 | FromDiscord | <zumi.dxy> (as in, using `results` with `labeledTry` I mean) |
10:05:11 | FromDiscord | <Robyn [She/Her]> With results, wouldn't you return an error enum? |
10:07:47 | FromDiscord | <zumi.dxy> Sometimes, yeah |
10:08:38 | FromDiscord | <zumi.dxy> but apparently most of the time it's just a string if you don't need special cases |
10:09:06 | FromDiscord | <zumi.dxy> meanwhile http servers↵where you need to return different error codes depending on what happens |
10:09:52 | FromDiscord | <zumi.dxy> (or just return 200 OK with `{"message": "error lmao get trolled"}` |
10:09:58 | FromDiscord | <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:39 | FromDiscord | <pmunch> That just sounds like a very poorly behaved API tbh.. |
10:13:11 | FromDiscord | <zumi.dxy> lmaooooo |
10:13:20 | FromDiscord | <zumi.dxy> yeah |
10:28:12 | * | beholders_eye joined #nim |
10:36:25 | FromDiscord | <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:28 | FromDiscord | <Robyn [She/Her]> In a template can I create a Nim identifier from a static string? |
14:29:02 | FromDiscord | <threefour> Why would my program be crashing when trying to collect a cycle with ORC, but Boehm runs perfectly? |
14:29:06 | FromDiscord | <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:31 | FromDiscord | <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:50 | FromDiscord | <threefour> sent a code paste, see https://play.nim-lang.org/#pasty=fZsONtUL |
14:32:14 | FromDiscord | <threefour> It's a guaranteed crash with ORC, and a guaranteed success with Boehm. |
14:32:26 | FromDiscord | <Robyn [She/Her]> Are you doing multithreading? What library are you using? |
14:33:39 | FromDiscord | <threefour> Yes, no library. Just `createThread` and `joinThread`, specifically because I've had only issues with libraries. |
14:34:20 | FromDiscord | <odexine> are you sharing references between threads |
14:34:59 | FromDiscord | <threefour> Wouldn't that cause issues with Boehm too if that was the case? |
14:35:34 | FromDiscord | <odexine> i believe it wouldnt |
14:37:06 | FromDiscord | <threefour> Then I guess I'll need to sniff around for that |
14:41:13 | * | rockcavera joined #nim |
14:44:39 | FromDiscord | <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:03 | FromDiscord | <Robyn [She/Her]> Maybe it's something to do with the GC? |
14:45:10 | FromDiscord | <odexine> Böhm probably uses threads for the GC |
14:45:11 | FromDiscord | <Robyn [She/Her]> No clue though, sorry |
14:46:04 | FromDiscord | <threefour> Makes sense |
14:46:43 | FromDiscord | <nocturn9x> is there a way to track memory allocations in nim |
14:46:48 | FromDiscord | <nocturn9x> like know what is allocated when and how |
14:46:52 | FromDiscord | <nocturn9x> (edit) "like know what is allocated when and how ... " added "big" |
14:53:59 | * | lucasta joined #nim |
14:58:02 | FromDiscord | <Phil> So I'm looking into GTask in GTK and its examples |
14:58:52 | FromDiscord | <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:14 | FromDiscord | <Phil> I am so fucking confused |
15:03:46 | FromDiscord | <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:58 | FromDiscord | <threefour> sent a code paste, see https://play.nim-lang.org/#pasty=jZJvssTF |
15:24:12 | FromDiscord | <odexine> In reply to @threefour "If the cycle collection": sounds like it to me yes |
16:20:45 | * | Batzy_ joined #nim |
16:21:06 | FromDiscord | <threefour> Why are indirect calls not gc-safe? |
16:24:14 | * | Batzy quit (Ping timeout: 268 seconds) |
16:29:22 | FromDiscord | <ravinder387> sent a code paste, see https://play.nim-lang.org/#pasty=aILOasMx |
16:29:51 | FromDiscord | <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:45 | FromDiscord | <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:49 | FromDiscord | <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:48 | FromDiscord | <dddeserttt> Hello |
19:07:46 | * | krux02 joined #nim |
19:07:57 | FromDiscord | <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:49 | FromDiscord | <Robyn [She/Her]> I don't have the patience with my macro oof |
20:08:58 | FromDiscord | <Robyn [She/Her]> I can't stand it ;-; |
20:26:48 | FromDiscord | <threefour> Where are Nim's smart/shared pointers again? |
20:27:19 | FromDiscord | <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:38 | FromDiscord | <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 |