00:20:52 | * | lumo_e joined #nim |
00:21:21 | * | def- quit (Quit: -) |
00:24:08 | * | def- joined #nim |
00:27:09 | * | def- quit (Client Quit) |
00:29:52 | * | def- joined #nim |
00:36:07 | * | def- quit (Quit: -) |
00:39:28 | * | def- joined #nim |
00:42:40 | * | def- quit (Client Quit) |
00:47:00 | * | def- joined #nim |
00:50:05 | * | def- quit (Client Quit) |
00:50:18 | * | def- joined #nim |
01:03:17 | * | Mister_Magister quit (Remote host closed the connection) |
01:06:38 | * | Mister_Magister joined #nim |
03:03:09 | * | lumo_e quit (Quit: Quit) |
03:47:17 | FromDiscord | <Yardanico> if someone has a fresh pair of eyes, can you check if I made any mistakes in <https://github.com/nim-lang/Nim/pull/22886> ? it's quite a sensitive piece of code related to parsing http responses in httpclient |
03:53:27 | FromDiscord | <Yardanico> oh, right, a small mistake - spaces in the header value is ok |
03:56:37 | FromDiscord | <Yardanico> ah nvm it already works because it parses until the colon |
04:12:37 | FromDiscord | <Yardanico> ok, right, this doesn't handle the case if the http server responds with a multiline header line (if it starts with space/tab) before the first header |
04:31:58 | FromDiscord | <Yardanico> guess i will give up and make httpclient more lenient so that it at least works like python/curl/etc, because they all seem to accept headers without any value after the colon happily even if it's not valid http spec-wise |
04:32:36 | FromDiscord | <Elegantbeef> Down with non spec compliant code! 😛 |
04:43:15 | FromDiscord | <Yardanico> it's really bizzare, but I guess that's what you get with decades-old text protocols |
04:43:41 | FromDiscord | <Yardanico> weird text after the first HTTP version + status response line like " asdasdasds"? curl errors out but Python just ignores it as if it never existed |
04:45:13 | FromDiscord | <Elegantbeef> Probably either an "optimisation" or just a shitty parser |
04:45:27 | FromDiscord | <Elegantbeef> "We got a valid response for the most part, no need to validate more" |
04:47:22 | FromDiscord | <Yardanico> the best way would be to find some http 1.1 spec test suite to test clients |
04:48:52 | FromDiscord | <sOkam! 🫐> is there a way to output non-mangled `.js` symbols when compiling with the js target? |
04:49:07 | FromDiscord | <Yardanico> define "mangled" |
04:49:09 | FromDiscord | <Elegantbeef> `exportJs` |
04:49:13 | FromDiscord | <Yardanico> ah, mangled |
04:58:26 | * | Guest77 joined #nim |
04:58:39 | * | Guest77 quit (Client Quit) |
05:32:32 | FromDiscord | <sOkam! 🫐> In reply to @Elegantbeef "`exportJs`": is there a way to do that auto, without having to apply it to every single symbol manually? |
05:32:51 | FromDiscord | <Elegantbeef> No cause generics exist |
05:32:59 | FromDiscord | <Elegantbeef> `{.push exportJs.}` |
05:33:21 | FromDiscord | <sOkam! 🫐> ah push might work, true. didn't cross my mind |
07:01:14 | * | advesperacit joined #nim |
07:04:05 | * | PMunch joined #nim |
08:39:49 | * | FromDiscord quit (Remote host closed the connection) |
08:40:02 | * | FromDiscord joined #nim |
12:27:42 | FromDiscord | <kryp7on> sent a long message, see http://ix.io/4Km4 |
12:28:25 | FromDiscord | <kryp7on> (edit) "http://ix.io/4Km4" => "http://ix.io/4Km5" |
12:29:49 | * | edr joined #nim |
12:41:44 | FromDiscord | <jviega> Yes, it currently generates C that gets compiled. Plenty of people do legitimate security tools in this community, and there's help for that. And Nim is fine for low level control, you have easy direct access to C if you need it. |
13:01:43 | FromDiscord | <kryp7on> In reply to @jviega "Yes, it currently generates": thanks for answers. What you mean by "direct access to C"? Does that mean that if I need low level control, I need to write code in C instead of Nim? |
13:04:11 | FromDiscord | <jviega> Well, you could, but you can just call into C functions |
13:04:42 | FromDiscord | <jviega> And most of the ones you'd ever use are already wrapped w/ a higher level interface |
13:07:15 | FromDiscord | <kryp7on> oh, thats some things that I dont know yet about, Im gonna learn Nim. thanks so much 😄 |
13:07:34 | FromDiscord | <kryp7on> (edit) "Nim." => "Nim so Ill understand what you are said here ." |
13:32:49 | PMunch | To clarify you can call C functions if you need them, for example if someone else has written something in C you want to use. But you can do low-level stuff directly in Nim if you're writing things from scratch. |
13:46:59 | * | rockcavera joined #nim |
13:50:08 | * | krux02_ joined #nim |
13:52:44 | FromDiscord | <kryp7on> thanks bot! :)) |
13:53:10 | FromDiscord | <kryp7on> (edit) ":))" => ":))↵↵EDIT: I reazlied its not bot, its real human. Thanks PMunch haha 😄" |
13:53:35 | PMunch | Haha, surprisingly common mistake |
14:15:16 | FromDiscord | <kryp7on> could you recommend me Nim resources for total Nim beginner? |
14:18:10 | PMunch | https://nimprogrammingbook.com/, along with Nim in Action, and Mastering Nim are good resources. There's of course a list of the official tutorials along with many other good resources available here: https://nim-lang.org/documentation.html |
14:30:08 | FromDiscord | <auxym> In reply to @kryp7on "could you recommend me": IMO if you're already familiar with programming in another language, than the official tutorials at https://nim-lang.org/docs/tut1.html is good. https://nim-by-example.github.io/ is also good. |
14:33:27 | FromDiscord | <auxym> @kryp7on also see https://github.com/byt3bl33d3r/OffensiveNim. The reason some of us are a bit annoyed by such efforts is that the result is Nim (the compiler and all compiled nim programs) getting blocked by Windows Defender and many other common AV software, which blocks Nim adoption by many people (eg corporate PCs on which nim cannot be installed, or newbies who may be scared to disable AV for nim and think there's a real risk) |
14:40:51 | FromDiscord | <kryp7on> In reply to @auxym "IMO if you're already": thanks so much, I bookmarked those links.↵↵yes, read that on the internet. But its not Nim's nor it is problem in malware development, its Microsoft which sucks and I dont like them so much |
14:41:06 | FromDiscord | <kryp7on> (edit) "In reply to @auxym "IMO if you're already": thanks so much, I bookmarked those links.↵↵yes, read that on the internet. But its not Nim's ... nor" added "problem" |
14:41:16 | FromDiscord | <auxym> I agree. MS but also other AV vendors |
14:41:21 | FromDiscord | <kryp7on> they could just whitelist Nim compiler |
14:41:25 | FromDiscord | <kryp7on> yea, thats idiotic imo |
14:41:25 | FromDiscord | <auxym> yes |
14:41:27 | PMunch | Well it is a problem for Nim, regardless of whether it's Nims fault or not.. |
14:41:36 | FromDiscord | <kryp7on> they should then flag Rust and C compiler also |
14:41:49 | FromDiscord | <kryp7on> yea, true |
14:41:57 | FromDiscord | <auxym> they do flag, or flagged, Go IIRC |
14:49:44 | * | itsmekali321 joined #nim |
14:50:20 | * | itsmekali321 quit (Client Quit) |
14:56:43 | * | LuxuryMode joined #nim |
14:58:08 | FromDiscord | <juancarlospaco> Time to time I get virus warnings on plain-text pure-python files. 🤷 |
15:03:24 | FromDiscord | <treeform> Windows antivirus companies are basically a scam and are worse than the protection they offer. They are more likely to mine Bitcoin ( https://www.theverge.com/2022/1/7/22869528/norton-crypto-miner-security-software-reaction ) or man-in-the-middle ( https://www.thesafemac.com/avasts-man-in-the-middle/ ). Antivirus companies have become the bad actors they tried but failed to stop. (https://www.cbc.ca/news/science/antivirus-software-1.3668 |
15:06:04 | * | PMunch quit (Quit: Leaving) |
15:20:20 | FromDiscord | <nervecenter> In reply to @kryp7on "could you recommend me": For learning a language, I always recommend:↵1) Open the X in Y Minutes page (https://learnxinyminutes.com/docs/nim/)↵2) Open official docs (https://nim-lang.org/docs/manual.html, https://nim-lang.org/docs/nimc.html, https://nim-lang.org/docs/lib.html)↵3) Translate a toy project you already have, or work on HackerRank or Advent of Code exercises |
15:20:53 | FromDiscord | <nervecenter> (edit) "In reply to @kryp7on "could you recommend me": For learning" => "sent" | "language, I always recommend:↵1) Open the X in Y Minutes page (https://learnxinyminutes.com/docs/nim/)↵2) Open official docs (https://nim-lang.org/docs/manual.html, https://nim-lang.org/docs/nimc.html, https://nim-lang.org/docs/lib.html)↵3) Translate a toy project you already have, or work on HackerRank or Advent of Code exercises" => "long mess |
15:25:45 | FromDiscord | <gyatsoyt> `time.now()` is not In nim? |
15:27:09 | FromDiscord | <Chronos [She/Her]> Iirc it's 'now', at least |
15:27:12 | FromDiscord | <Chronos [She/Her]> sent a code paste, see https://play.nim-lang.org/#ix=4KmN |
15:27:13 | FromDiscord | <Chronos [She/Her]> Is there a bot for searching stdlib docs? I feel like that'd be very useful |
15:28:57 | FromDiscord | <Chronos [She/Her]> https://nim-lang.org/docs/times.html#now @gyatsoyt |
15:42:14 | * | CO2 quit (Quit: WeeChat 4.1.0) |
15:45:55 | FromDiscord | <Chronos [She/Her]> https://dylibso.com/blog/hermit-actually-portable-wasm/ hm what do people think of this? It's interesting imo |
15:46:22 | FromDiscord | <Chronos [She/Her]> Tho would it be that different from using that libc to compile the code from the beginning? |
15:54:36 | FromDiscord | <juancarlospaco> In reply to @treeform "Windows antivirus companies are": Or AV actually making Viruses and Ransoms as shadow companies or financing it. |
15:55:14 | FromDiscord | <Chronos [She/Her]> Glad I use Linux, means these type of stuff are less popular :p |
15:55:23 | FromDiscord | <Chronos [She/Her]> Tho that most definitely will change someday oof |
15:55:44 | FromDiscord | <Chronos [She/Her]> Gotta run everything in a container or as a WASM app now /j |
16:12:23 | FromDiscord | <griffith1deadly> how i can get generated nim code by macro? |
16:12:44 | FromDiscord | <Phil> Echo yournimnode.repr |
16:13:31 | FromDiscord | <Phil> Or rather a macro should return a nimnode with all the you want to generate, you can echo the repr of that |
16:14:37 | * | CO2 joined #nim |
16:20:59 | FromDiscord | <griffith1deadly> In reply to @isofruit "Echo yournimnode.repr": thanks, as i can see my mapper to type work normal? https://media.discordapp.net/attachments/371759389889003532/1168585346196451328/image.png?ex=65524ce9&is=653fd7e9&hm=4d81558158ce531c23ee3656b4dd50f06dc478320df9dca3b64bab0a0c6b8266& |
16:25:04 | FromDiscord | <Phil> In reply to @griffith1deadly "thanks, as i can": Could you rephrase that ?I don't quite understand |
16:26:18 | FromDiscord | <griffith1deadly> In reply to @isofruit "Could you rephrase that": i'm trying to convert function parameters into a separate type of object type. the code generated looks like the correct type? |
16:28:00 | FromDiscord | <e.e.7> In reply to @treeform "Windows antivirus companies are": Along these lines, I always enjoy coming back to this truly wonderful issue: https://bugs.chromium.org/p/project-zero/issues/detail?id=693↵Make sure to read `exploit.html` in comment 13 too. |
16:28:06 | FromDiscord | <Phil> I don't know typedefs of the top of my head, you're better off looking at dumptree of a similar type declaration and comparing your ast to that |
16:30:51 | FromDiscord | <treeform> In reply to @e.e.7 "Along these lines, I": Wow I’ll add that to the list of links! |
16:30:53 | FromDiscord | <griffith1deadly> In reply to @isofruit "I don't know typedefs": my code as ast and output from dumpTree is the same, but the output via repr typesections looks unformatted, i think maybe I'm doing something wrong, but compilation is going fine. |
16:34:38 | FromDiscord | <Phil> In reply to @griffith1deadly "my code as ast": The ast is what matters, formatting being of is just the repr proc being weird |
16:39:26 | FromDiscord | <Chronos [She/Her]> In reply to @griffith1deadly "my code as ast": Would `treeRepr` be better? |
16:40:22 | FromDiscord | <Chronos [She/Her]> sent a code paste, see https://paste.rs/O58gs |
16:44:30 | FromDiscord | <griffith1deadly> In reply to @chronos.vitaqua "Would `treeRepr` be better?": treeRepr for NimNode dont work, which is why I asked the question. |
16:44:41 | FromDiscord | <Chronos [She/Her]> It doesn't? Huh... |
16:45:15 | FromDiscord | <Chronos [She/Her]> https://nim-lang.org/docs/macros.html#treeRepr,NimNode it accepts a NimNode though |
16:46:01 | FromDiscord | <griffith1deadly> oh, i used dumpTree, and I'm talking about treeRepr, checked - it works, thanks! |
16:46:14 | FromDiscord | <Chronos [She/Her]> No worries! :D |
16:48:21 | FromDiscord | <griffith1deadly> sent a code paste, see https://play.nim-lang.org/#ix=4Kna |
16:49:29 | FromDiscord | <Chronos [She/Her]> Not sure, tho iirc that'll be deprecated eventually, look at `std/macrocache` |
16:50:15 | FromDiscord | <Chronos [She/Her]> sent a code paste, see https://play.nim-lang.org/#ix=4Knc |
16:53:34 | FromDiscord | <griffith1deadly> In reply to @chronos.vitaqua "Not sure, tho iirc": what in the case of macrocache should I use?↵my idea is that from all the labeled functions by my pragma I can create only one types section. |
16:59:05 | FromDiscord | <Phil> Out of curiosity griffith, you also now newly experimenting with macros? |
16:59:08 | FromDiscord | <Phil> (edit) "macros?" => "macros 😄 ?" |
17:02:56 | * | derpydoo quit (Read error: No route to host) |
17:03:23 | FromDiscord | <griffith1deadly> In reply to @isofruit "Out of curiosity griffith,": aha, yes, i want to make a good system of autoparsing objects from js to call Nim procedures through jsony. and allow conversion with the possibility of using complex and complex types, by mark procedure with pragmas. i wanted to generalize the parameters of such functions into one type, then already convert json string into an object, and call the original procedure by fields |
17:03:57 | FromDiscord | <griffith1deadly> In reply to @griffith1deadly "aha, yes, i want": this would have to be used in conjunction with webview2 bindings |
17:04:53 | * | derpydoo joined #nim |
17:05:25 | FromDiscord | <Chronos [She/Her]> In reply to @griffith1deadly "what in the case": It's just a way to store data at compile time basically, that's it |
17:05:44 | FromDiscord | <Chronos [She/Her]> Compile time as in during the VM and such where it unrolls macros |
17:06:04 | FromDiscord | <Phil> In reply to @griffith1deadly "aha, yes, i want": Cool to see yet another person joining the macro folk 😄 |
17:06:28 | FromDiscord | <griffith1deadly> In reply to @chronos.vitaqua "It's just a way": then I will have to make an "inline" of this type section myself somewhere? |
17:26:20 | FromDiscord | <Chronos [She/Her]> In reply to @griffith1deadly "then I will have": As long as your macro pastes uses the body then it's fine I think |
17:45:41 | * | ehmry quit (Quit: https://quassel-irc.org - Chat comfortably. Anywhere.) |
17:45:58 | * | ehmry joined #nim |
17:56:55 | * | CO2 quit (Quit: WeeChat 4.1.1) |
18:17:25 | * | rockcavera quit (Remote host closed the connection) |
18:19:30 | * | rockcavera joined #nim |
18:36:15 | * | LuxuryMode quit (Quit: Connection closed for inactivity) |
18:47:32 | * | CO2 joined #nim |
19:14:47 | FromDiscord | <Chronos [She/Her]> What's the difference between Ed25519 and Curve25519? Apparently the latter can be used for encryption and decryption, while the former is solely for signature verification |
19:15:21 | FromDiscord | <Chronos [She/Her]> I need to be able to use the public key to encrypt data, and the private key to decrypt data, so I assume Curve25519 is what I want? |
19:15:24 | FromDiscord | <Chronos [She/Her]> Unless I'm missing something |
19:19:14 | FromDiscord | <Chronos [She/Her]> Realised I can rework this so it's slightly different |
19:21:58 | FromDiscord | <Chronos [She/Her]> https://cryptobook.nakov.com/digital-signatures/eddsa-sign-verify-examples this... Is confusing me now, so I only need the private key for signing? |
19:22:49 | FromDiscord | <Chronos [She/Her]> Okay I think I'm just misunderstanding this tbh |
19:23:22 | FromDiscord | <odexine> signing/verifying is kinda basically the inverse of encrypting/decrypting |
19:24:08 | FromDiscord | <Chronos [She/Her]> Okay so, if I sign data, does that mean verifying that signed data will only work for valid data? What if the message is different but still signed with that private key? |
19:24:21 | FromDiscord | <odexine> where signing is basically "encrypting with the private key" and verifying is "decrypting with the public key" |
19:24:41 | FromDiscord | <odexine> In reply to @chronos.vitaqua "Okay so, if I": ? valid data? |
19:25:07 | FromDiscord | <Chronos [She/Her]> Ah sorry, I mean if I encode a message |
19:25:09 | FromDiscord | <odexine> the message can be whatever, as long as it's signed properly |
19:25:32 | FromDiscord | <odexine> once the signature is there, any changes without resigning will cause verification to fail |
19:40:04 | FromDiscord | <Chronos [She/Her]> Okay then I don't think Ed25519 will work for me |
19:40:12 | FromDiscord | <Chronos [She/Her]> I need to compare it against another value |
20:02:07 | FromDiscord | <leorize> just use libsodium if you want ed25519 |
20:05:30 | FromDiscord | <Chronos [She/Her]> In reply to @leorize "just use libsodium if": The issue is I'm not sure what to use for ensuring that a client is legit :p↵↵My idea was to have something following this https://media.discordapp.net/attachments/371759389889003532/1168641850329014362/Initial_Authentication.png?ex=65528189&is=65400c89&hm=41fa9203b6df7cc26ebc8142251435f76735ee753ea7cf7cc6b1d7480dc6963b& |
20:06:12 | FromDiscord | <Chronos [She/Her]> But I'm trying to decide what to use for encryption |
20:06:18 | FromDiscord | <Chronos [She/Her]> I could use RSA tbh... |
20:06:22 | FromDiscord | <Chronos [She/Her]> OpenSSL provides that |
20:07:32 | * | derpydoo quit (Quit: derpydoo) |
20:07:41 | FromDiscord | <leorize> wdym client is legit? |
20:07:46 | FromDiscord | <leorize> wdym client í legit?↵(@Chronos [She/Her]) |
20:08:41 | FromDiscord | <leorize> if your problem domain is authentication then picking an encryption scheme is the least of your concerns |
20:09:28 | FromDiscord | <Chronos [She/Her]> I just need a way to ensure that the server isn't impersonating a different server, really |
20:10:00 | FromDiscord | <leorize> you need a trust root then |
20:10:45 | FromDiscord | <leorize> for most systems, DNS + TLS is the trust root |
20:11:14 | FromDiscord | <leorize> you can also pin the certificate, that's what browsers does for popular sites |
20:11:41 | FromDiscord | <Chronos [She/Her]> Trust root? :p |
20:12:09 | FromDiscord | <leorize> something that you implicitly trust in your system |
20:12:09 | FromDiscord | <Chronos [She/Her]> I think the chat app being decentralised would complicate things, no? |
20:12:14 | FromDiscord | <leorize> because you have to trust /something/ to bootstrap the system |
20:13:12 | FromDiscord | <leorize> no |
20:13:20 | FromDiscord | <Chronos [She/Her]> Oh then cool |
20:13:50 | FromDiscord | <leorize> TLS is always a safe pick as your trust axiom |
20:13:54 | FromDiscord | <Chronos [She/Her]> Not sure how I'd even go about implementing that though |
20:14:26 | FromDiscord | <Elegantbeef> You use one of the countless libraries that already implement it 😄 |
20:14:34 | FromDiscord | <leorize> if you can connect to the server and it presents a valid certificate, then it's verified |
20:16:06 | FromDiscord | <Chronos [She/Her]> I want to be able to block an entire instance though too, my idea with that diagram above is that I could use the pubkey in a table with an ID assigned to it |
20:16:10 | FromDiscord | <leorize> in fact this is like TLS but less secure \:P↵(@Chronos [She/Her]) |
20:16:13 | FromDiscord | <Chronos [She/Her]> In reply to @Elegantbeef "You use one of": Such as? :p |
20:17:11 | FromDiscord | <Elegantbeef> Just block instances based off domain or ip |
20:17:12 | FromDiscord | <leorize> I'd recommend not muddling security details like authentication and key exchange with other properties of the system |
20:18:09 | FromDiscord | <leorize> and if you block a server via its pubkey, they can just spin another one with a different pubkey |
20:18:19 | FromDiscord | <Chronos [She/Her]> True |
20:18:32 | FromDiscord | <Chronos [She/Her]> In reply to @leorize "I'd recommend not muddling": Not sure what you mean by this though? |
20:18:33 | FromDiscord | <leorize> it's trivial to generate a keypair compared to grabbing a new domain/IP |
20:18:44 | FromDiscord | <Chronos [She/Her]> In reply to @Elegantbeef "Just block instances based": Blocking domain is probably smart |
20:18:52 | FromDiscord | <Elegantbeef> There is no solid way of blocking a decentralised system |
20:19:09 | FromDiscord | <Chronos [She/Her]> In reply to @leorize "it's trivial to generate": VPNs plus home routers though? Blocking by domain is probably alright |
20:19:10 | FromDiscord | <Elegantbeef> If you are so worried about people that you blocked interacting with you, use a whitelist instead of a blacklist |
20:19:24 | FromDiscord | <Chronos [She/Her]> Yeah was about to say I was gonna do that too :p |
20:19:44 | FromDiscord | <leorize> don't try to design a security system that does N things at once without cryptography experience↵(@Chronos [She/Her]) |
20:19:45 | FromDiscord | <Elegantbeef> Why "too" |
20:19:52 | FromDiscord | <Elegantbeef> If you have a white list there is no reason to do anything else |
20:20:14 | FromDiscord | <leorize> VPNs are not magic, you can find the IP ranges for almost all VPN services online↵(@Chronos [She/Her]) |
20:20:18 | FromDiscord | <Chronos [She/Her]> In reply to @leorize "don't try to design": Ah, yeah fair :p |
20:21:08 | FromDiscord | <leorize> also, with VPNs cutting off port forwarding, how do you think someone even reach the internet? |
20:21:20 | FromDiscord | <Elegantbeef> It's decentralised I can spool up a VPS or just self host on a network if I wanted to briefly bypass any blocks if you do not use a whitelist |
20:21:21 | FromDiscord | <Chronos [She/Her]> Oh VPNs cut that off? |
20:21:52 | FromDiscord | <Elegantbeef> So it's pretty moot to be that worried about blocked people |
20:22:18 | FromDiscord | <Chronos [She/Her]> The only thing I need to know now then, is how I'd make sure a TLS certificate is valid |
20:22:29 | FromDiscord | <Chronos [She/Her]> In reply to @Elegantbeef "So it's pretty moot": Fair enough :p |
20:22:52 | FromDiscord | <leorize> that's a part of the TLS handshake and many implementations does it for you |
20:22:53 | FromDiscord | <Elegantbeef> Isnt this what libraries that have SSL provides you? |
20:23:50 | FromDiscord | <Chronos [She/Her]> Oh, I would've thought I'd have to check that somehow myself |
20:25:06 | FromDiscord | <leorize> you used to |
20:25:09 | FromDiscord | <leorize> then turns out no one knows how to do it correctly |
20:25:17 | FromDiscord | <Chronos [She/Her]> Lol |
20:26:19 | FromDiscord | <Chronos [She/Her]> Though last issue is how do I know if it's a blocked domain? I assume I just have to have them pass me their domain as a string and make any requests to that? |
20:26:46 | FromDiscord | <Chronos [She/Her]> Then make any requests I need to make, back to them? |
20:27:12 | FromDiscord | <leorize> you just... have a block list? |
20:27:33 | FromDiscord | <leorize> and if you want to connect to them you need to domain to begin with, no? |
20:27:37 | FromDiscord | <Chronos [She/Her]> I don't know how I'd know what the domain is in the first place though? |
20:27:53 | FromDiscord | <Chronos [She/Her]> In reply to @leorize "and if you want": The request has to be initiated by one side |
20:28:23 | FromDiscord | <leorize> now i'm confused |
20:28:28 | FromDiscord | <leorize> how do you even initiate a connection in your architecture |
20:31:17 | FromDiscord | <Phil> asyncdispatch as a module just sucks the life out of me looking at it |
20:31:54 | FromDiscord | <Chronos [She/Her]> A user (from a Userspace) joins a Serverspace, so the Userspace has to send a request to the Serverspace that a user wants to join, and then the Serverspace should connect to the websocket send in the request from a Userspace |
20:32:01 | FromDiscord | <Chronos [She/Her]> That's how I imagined it at least |
20:32:55 | FromDiscord | <leorize> right, so what do you use to get the address to this serverspace?↵(@Chronos [She/Her]) |
20:33:42 | FromDiscord | <Phil> It's got a ton of docs, but a fair few bits of information are missing and apparently you can't add them because they're only true in like half the cases the the type gets used as (from the way it looks to me) it gets used wrongly sometimes (explicitly speaking: Callback) |
20:33:43 | FromDiscord | <Chronos [She/Her]> It'd have to be user input since the user would join from a URL |
20:33:58 | FromDiscord | <Phil> (edit) "the" => "that" |
20:34:03 | FromDiscord | <Phil> (edit) "It's got a ton of docs, but a fair few bits of information are missing and apparently you can't add them because they're only true in like half ... that" added "the cases" | removed "cases the" |
20:34:31 | FromDiscord | <Elegantbeef> What do you mean phil? |
20:34:34 | FromDiscord | <leorize> I think you found your domain↵(@Chronos [She/Her]) |
20:34:43 | FromDiscord | <Chronos [She/Her]> Ah |
20:34:53 | FromDiscord | <Elegantbeef> Yea chronos think about mastodon or matrix |
20:35:08 | FromDiscord | <Chronos [She/Her]> But the Serverspace is the one that has to block the Userspace :p |
20:35:16 | FromDiscord | <Chronos [She/Her]> So the Serverspace has the domain so it should be fine |
20:35:18 | FromDiscord | <Chronos [She/Her]> I think |
20:35:26 | FromDiscord | <Chronos [She/Her]> In reply to @Elegantbeef "Yea chronos think about": Idk how either works |
20:35:35 | FromDiscord | <Elegantbeef> Your first domain is got by word of mouth or your selfhosted instance |
20:35:35 | FromDiscord | <Elegantbeef> Why is the server space blocking userspace? |
20:35:36 | FromDiscord | <leorize> what is an userspace? |
20:35:48 | FromDiscord | <leorize> this is why chronos is better btw↵(@Phil) |
20:35:59 | FromDiscord | <Elegantbeef> So look at them |
20:36:11 | FromDiscord | <Phil> sent a long message, see http://ix.io/4Ko4 |
20:36:13 | FromDiscord | <Elegantbeef> They're widely used decentralized programs |
20:36:24 | FromDiscord | <leorize> xmpp too if you want something that almost become the universal IM protocol |
20:36:30 | FromDiscord | <Phil> Well turns out the bool only means something in 3/4 cases where callback is used |
20:36:50 | FromDiscord | <Elegantbeef> You register to a homeserver or instance, then you block a user, when the message is forwarded to all waiting clients you check if they have that user blocked |
20:36:51 | FromDiscord | <leorize> wait until you look at the windows callback code lol |
20:36:57 | FromDiscord | <Elegantbeef> Afaik all interactions are done on server side |
20:37:13 | FromDiscord | <Phil> So you can't add a doc comment that says that the Callback bool means "if true, do not repeat execution, if false do repeat execution" (or the other way round, I honestly don't remember, the way that bool is used makes no sense to me) |
20:37:16 | FromDiscord | <Elegantbeef> Both Mastodon and Matrix do the `[email protected]` |
20:37:49 | FromDiscord | <Phil> Because it's wrong in the 4th case (with `addProcess`) |
20:38:38 | FromDiscord | <Elegantbeef> Well time to fix it all Phil, throw darts until shit works 😛 |
20:38:49 | FromDiscord | <Phil> And if you added the docs to `Callback` it'd raise the expectation that it behaves this way also with `addProcess`, which it won't |
20:38:51 | FromDiscord | <leorize> or just get chronos in to replace asyncdispatch already \:P |
20:39:02 | FromDiscord | <Elegantbeef> That's at least how I PR to anything |
20:39:16 | FromDiscord | <Phil> I contribute to like 3 packages at the moment, like, just no |
20:39:45 | FromDiscord | <Phil> The plan was to make a docs PR to improve the situation a bit for an area where I recently learned a bit and wanted to add the information |
20:39:59 | FromDiscord | <Phil> And apparently now that's not possible without refactoring the actual code |
20:40:13 | FromDiscord | <Phil> And that just kills energy |
20:40:14 | FromDiscord | <Elegantbeef> Oh noes 3 packages 😛 |
20:40:15 | FromDiscord | <Elegantbeef> Leo I thought you're supposed to say "Just use CPS" |
20:40:17 | FromDiscord | <leorize> I would but that hasn't fly for awhile right? |
20:40:19 | FromDiscord | <Elegantbeef> No clue |
20:40:34 | FromDiscord | <leorize> technically I could write an asyncdispatch shim for nim-sys |
20:40:34 | FromDiscord | <Elegantbeef> I used CPS once to replace closure iterators then realised it was not any better |
20:40:35 | FromDiscord | <Phil> In reply to @Elegantbeef "Oh noes 3 packages": For me that's a lot because that kind of multitasking basically kills my brain |
20:40:58 | FromDiscord | <Elegantbeef> All I needed was my own `asClosure` for my WM's iterators |
20:41:05 | FromDiscord | <Elegantbeef> Oh I'm just kidding of course Phil, I live in disarray |
20:41:09 | FromDiscord | <leorize> yea cps is not made for closure iters |
20:42:05 | FromDiscord | <Elegantbeef> I did use it here https://github.com/beef331/goodwm/blob/master/src/goodwm/layouts.nim#L162-L175 before revisting goodwm to make it compile and sorta work in 2.0 |
20:42:17 | FromDiscord | <Elegantbeef> Now as you can see I just use my own closure generator macro and it's pretty nice |
20:42:52 | FromDiscord | <Chronos [She/Her]> In reply to @Elegantbeef "Why is the server": Because users are stored on the Userspace, a Userspace is basically the auth server↵↵A Serverspace is where servers (where people can talk) are stored |
20:42:56 | FromDiscord | <Phil> I may just use chronos going forward and rather contribute to the situation getter better there (I mean, if I touch async in nim again at some point, that tends to happen more by accident or when I have a curious phase) |
20:43:09 | FromDiscord | <Phil> And assuming there even is anything that needs contributing |
20:43:22 | FromDiscord | <Elegantbeef> That seems silly |
20:43:32 | FromDiscord | <leorize> please give nim-sys a try \:)↵(@Phil) |
20:43:40 | FromDiscord | <Elegantbeef> I don't know how matrix or mastodon are structured there, but it really does seem like the wrong way about it |
20:43:43 | FromDiscord | <Phil> (edit) "And assuming there even is anything that needs contributing ... " added "that an unknown can help with" |
20:44:04 | FromDiscord | <Chronos [She/Her]> In reply to @Elegantbeef "So look at them": Look at what? Did the bridge drop something? |
20:44:09 | arkanoid | I'm practicing in wrapping a C library using move semantics, so I have to use =hooks and sink/lent |
20:44:12 | FromDiscord | <Elegantbeef> You send actions to a server the server does what you tell it, why do you need two degrees of seperation |
20:44:18 | FromDiscord | <leorize> I think you're doing it the wrong way around↵(@Chronos [She/Her]) |
20:44:25 | arkanoid | but how can I test if my solution os memory safe |
20:44:30 | FromDiscord | <Elegantbeef> Look at Matrix/Mastodon |
20:44:52 | FromDiscord | <Elegantbeef> Valgrind |
20:44:58 | FromDiscord | <Elegantbeef> Though using move semantics with C is questionable unless the C tells you that it takes ownership |
20:45:08 | FromDiscord | <Elegantbeef> Depending what you mean there |
20:45:15 | FromDiscord | <Phil> ~~I wish I could actually read Valgrind output~~ |
20:45:21 | FromDiscord | <Elegantbeef> If you mean using destructors for C allocated resources it's fine |
20:45:33 | FromDiscord | <leorize> some C libraries have built-in reference counting |
20:45:36 | FromDiscord | <Elegantbeef> But if you mean giving up Nim allocated resources to C code it's questionable |
20:45:51 | arkanoid | Elegantbeef, yeah the API clearly express ownership in documentation |
20:45:53 | FromDiscord | <leorize> it's easy, if it says "no problem", you don't care, if it says "unreachable resource found", your code is leaking↵(@Phil) |
20:45:55 | FromDiscord | <Elegantbeef> `--debugger:native -d:useMalloc` |
20:46:14 | FromDiscord | <Elegantbeef> This isnt wasmer is it? |
20:46:14 | FromDiscord | <Elegantbeef> Or WasmEdge... |
20:46:19 | FromDiscord | <Chronos [She/Her]> In reply to @leorize "I think you're doing": How so? Serverspace instances need to be able to block Userspace instances in case they're just full of spam bots |
20:46:29 | FromDiscord | <Elegantbeef> Forget which wasm runtime used a `#define own` |
20:46:43 | FromDiscord | <Elegantbeef> That seems wrong |
20:46:55 | FromDiscord | <Elegantbeef> You have a whitelist in the first place |
20:46:59 | FromDiscord | <leorize> what I meant is that your separation sounds wrong |
20:47:07 | FromDiscord | <Phil> In reply to @leorize "it's easy, if it": hmmmmm I mean I have an owlkettle example that I'm almost certain leaks memory that should serve as a true positive to test against, I'll see whether that tracks |
20:47:11 | FromDiscord | <Chronos [She/Her]> In reply to @Elegantbeef "You send actions to": So bake it into one? I was thinking it'd be nice to make the Userspace reusable in any other project that needs an account system aha |
20:47:29 | FromDiscord | <Chronos [She/Her]> In reply to @leorize "what I meant is": Ah, so I should just merge the two components instead then? |
20:47:42 | FromDiscord | <Elegantbeef> If you do ask for permission you can never have a spam instance that you did not permit |
20:47:55 | FromDiscord | <Chronos [She/Her]> That is what I'll be doing |
20:48:09 | FromDiscord | <leorize> the big fallacy in \~\~distributed\~\~ software is thinking that you can just "reuse"↵(@Chronos [She/Her]) |
20:48:23 | FromDiscord | <Chronos [She/Her]> In reply to @leorize "I think you're doing": I was confused from this message aha |
20:48:39 | FromDiscord | <Elegantbeef> You're better off just adding auth tokens for logins on other platforms 😄 |
20:48:42 | FromDiscord | <leorize> [Edit](https://discord.com/channels/371759389889003530/371759389889003532/1168652582080749588): the big fallacy in ~~distributed~~ software is thinking that you can just "reuse" |
20:49:16 | FromDiscord | <Elegantbeef> "Login with your BlehInstance account" |
20:49:21 | FromDiscord | <Chronos [She/Her]> In reply to @leorize "[Edit](https://discord.com/channels/371759389889003": It'd need modifications of course but if most of the initial code is done, why would it be an issue to just rework some aspects to my needs for a later project? |
20:49:35 | FromDiscord | <Chronos [She/Her]> In reply to @Elegantbeef "You're better off just": Like GitHub? |
20:49:52 | arkanoid | I wonder if Nim program can measure used heap and use it in testcases, like "assert noHeapUsed()" |
20:50:01 | FromDiscord | <Phil> sent a code paste, see https://play.nim-lang.org/#ix=4Ko8 |
20:50:01 | FromDiscord | <Elegantbeef> But yea arkanoid if you allocate using Nim's allocator the move semantics are not 'valid' |
20:50:14 | FromDiscord | <Elegantbeef> I mean implementing your own auth token login system for your server instance |
20:50:47 | FromDiscord | <Elegantbeef> Did you compile with `--debugger:native -d:useMalloc`? |
20:51:06 | FromDiscord | <Phil> Ah, forgot the malloc |
20:51:09 | FromDiscord | <Chronos [She/Her]> In reply to @Elegantbeef "I mean implementing your": I still don't understand... 😅 |
20:51:10 | FromDiscord | <Elegantbeef> Also worth noting since you're using libgtk/libadwaita if they do not use the system's malloc it won't be tracked |
20:51:23 | FromDiscord | <leorize> because fully grasping your problem domain requires extensive experimentation↵(@Chronos [She/Her]) |
20:51:25 | FromDiscord | <Elegantbeef> It'll be slow as all balls to start |
20:51:29 | FromDiscord | <leorize> and you must be ready to throw it all and redo |
20:51:30 | FromDiscord | <Elegantbeef> But it'll eventually start |
20:51:49 | FromDiscord | <leorize> if you focus too much on "reuse", you usually end up with something that is not fit for any purposes |
20:52:05 | FromDiscord | <Phil> In reply to @Elegantbeef "Did you compile with": Recompiled, still started like that 😄 |
20:52:23 | FromDiscord | <Elegantbeef> I'm saying chronos just like the "login with github" or "login with google" you add the abillity to do "login with your chat server" 😛 |
20:52:26 | FromDiscord | <Elegantbeef> I'm almost 100% kidding |
20:52:29 | FromDiscord | <Phil> And yeah, I remember it being slow as mollases, like "minutes" to start up |
20:52:30 | FromDiscord | <leorize> note that leak report is only shown at exit |
20:52:42 | FromDiscord | <Elegantbeef> Of course it'll start like that |
20:52:44 | FromDiscord | <Chronos [She/Her]> In reply to @leorize "if you focus too": Fair enough |
20:52:46 | FromDiscord | <Elegantbeef> valgrind is slow as balls on big things |
20:52:47 | * | neceve joined #nim |
20:53:16 | FromDiscord | <leorize> leaksanitizer is a simpler one to use if speed is of concern |
20:53:18 | FromDiscord | <Phil> Beef, this is a gtk app consisting of like... two dozen widgets total and one of those widgets is the window itself |
20:53:37 | FromDiscord | <Chronos [She/Her]> In reply to @Elegantbeef "I'm saying chronos just": Ooooh so OAuth login shit but implemented on my chat server, then allow people to be able to login with other chat servers? |
20:54:10 | FromDiscord | <leorize> valgrind can/will give you a 4x slowdown |
20:54:10 | FromDiscord | <Chronos [She/Her]> In reply to @isofruit "Beef, this is a": Isn't GTK pretty big? |
20:54:26 | FromDiscord | <leorize> address sanitizer is slightly better that it's usually 2x |
20:54:49 | FromDiscord | <Phil> In reply to @chronos.vitaqua "Isn't GTK pretty big?": Maaaaybe but you're also not compiling in a small subset of GTK and |
20:54:54 | FromDiscord | <Elegantbeef> Sorta chronos, but the entire point of decentralised is you do not need to do that 😛 |
20:54:57 | FromDiscord | <leorize> if leaks are the only thing you care about then try leak sanitizer |
20:55:19 | FromDiscord | <Chronos [She/Her]> In reply to @isofruit "Maaaaybe but you're also": Fair |
20:55:27 | FromDiscord | <Phil> In reply to @leorize "valgrind can/will give you": If it were only 4x... |
20:55:37 | FromDiscord | <leorize> note that valgrind will audit /all/ memory addresses |
20:55:39 | FromDiscord | <Elegantbeef> The point was if you really wanted to reuse the account server you could add OAuth, and just disable the http side |
20:55:57 | FromDiscord | <Chronos [She/Her]> Aah |
20:55:58 | FromDiscord | <Elegantbeef> Feels like atleast 30 times slowdown with GUI programs |
20:56:17 | FromDiscord | <leorize> it depends on your memory address pattern |
20:56:22 | FromDiscord | <Elegantbeef> I've used valgrind on my game that uses SDL and Opengl, it takes forever to boot |
20:56:24 | FromDiscord | <leorize> the pointer chasing of modern GUI is definitely not gonna help |
20:56:40 | FromDiscord | <Elegantbeef> We're not even talking about running |
20:56:55 | FromDiscord | <Chronos [She/Her]> Okay, so to make it clear for my eternally chaotic mind, could a summary be made?- I'm kinda slow aha |
20:56:56 | FromDiscord | <Elegantbeef> Even just initialising it's slow |
20:57:05 | FromDiscord | <Elegantbeef> And my games are all DOD'd |
20:57:06 | FromDiscord | <Chronos [She/Her]> I feel like that'd be obvious by now but |
20:57:25 | FromDiscord | <Elegantbeef> Summary of what? |
20:58:05 | FromDiscord | <Elegantbeef> Nuke userspace(it was horridly named anyway), all interaction happens server side and propagate to users that are listening |
20:58:10 | FromDiscord | <Elegantbeef> Userspace sounds like "client side" not "Authorisation Server" |
20:58:35 | FromDiscord | <Phil> In reply to @leorize "if leaks are the": They are, I'll google it |
20:58:54 | FromDiscord | <Phil> The clang thing? |
20:59:25 | FromDiscord | <leorize> `-d:useMalloc --passC:-fsanitizer=leak --passL:-fsanitizer=leak` \<- that's all you need↵(@Phil) |
20:59:28 | FromDiscord | <leorize> clang and gcc \>=12 should support it |
20:59:35 | FromDiscord | <Elegantbeef> Should work with gcc/clang iirc |
20:59:44 | FromDiscord | <Chronos [She/Her]> Of what I need to actually do, I know that:↵- I should use an allowlist instead of a denylist↵- Merge functionality of Serverspace and Userspace (so Supernovae, which was what I was gonna call the group of components :p)↵- And have a way for users to join instances via a link? |
21:00:05 | FromDiscord | <leorize> you get speed but less accuracy so it won't tell you where you leaked |
21:00:05 | FromDiscord | <leorize> but it will tell if you leaked |
21:00:06 | FromDiscord | <Elegantbeef> Though leo doesn't this have the same issue, it only sanitises the Nim program? |
21:00:29 | FromDiscord | <leorize> I think leak sanitizer overwrites the weak malloc symbol in the program address space |
21:00:43 | FromDiscord | <leorize> instead of modifying the source |
21:00:50 | FromDiscord | <Elegantbeef> Wonder if libgtk/libadwaita use malloc 😄 |
21:00:56 | FromDiscord | <leorize> they do |
21:01:03 | FromDiscord | <Elegantbeef> Ah |
21:01:18 | FromDiscord | <Phil> In reply to @leorize "you get speed but": -fsanitize=leak? |
21:01:47 | FromDiscord | <Phil> -fsanitizer=leak causes errors |
21:01:53 | FromDiscord | <Phil> (edit) "-fsanitizer=leak causes errors ... " added "that the flag doesn't exist" |
21:02:00 | FromDiscord | <leorize> gtk is a nice library, all things considered |
21:02:00 | FromDiscord | <Elegantbeef> If only windows shipped it 😛 |
21:02:00 | FromDiscord | <leorize> qt is more consistent but is layered with abstraction layers |
21:02:02 | FromDiscord | <leorize> yea↵(@Phil) |
21:02:15 | FromDiscord | <leorize> my bad, that's a typo |
21:03:01 | FromDiscord | <leorize> and the C interface doesn't exist, although there is supposedly a framework for wrapping Qt now |
21:03:37 | FromDiscord | <Phil> Ahhhh crud |
21:03:39 | FromDiscord | <leorize> still very coupled with pyqt so might require a bit of work to navigate |
21:04:15 | FromDiscord | <Phil> sent a code paste, see https://play.nim-lang.org/#ix=4Koe |
21:04:24 | FromDiscord | <Chronos [She/Her]> Thanks Leo and Beef for helping me iron out my stupid idea :P |
21:04:37 | FromDiscord | <Phil> Well, at least I got my suspicion confirmed |
21:06:01 | FromDiscord | <Elegantbeef> The good part is not a single one of those are inside your Nim program 😄 |
21:06:02 | FromDiscord | <leorize> add `--stacktrace:off --debugger:native --passC:-fno-omit-frame-pointer` and see if you get better traces↵(@Phil) |
21:06:03 | FromDiscord | <Elegantbeef> Which means the leaks are due to resource management and not Nim bugs |
21:06:26 | FromDiscord | <leorize> bold of you to assume that destructors is bug-free \:P |
21:06:37 | arkanoid | wait, I'm confused now. Should I use valgrind or -fsanitize=leak |
21:06:43 | FromDiscord | <Elegantbeef> Oh I know it's not bug free |
21:06:50 | FromDiscord | <Elegantbeef> valgrind gives more detail |
21:07:04 | FromDiscord | <Elegantbeef> It will tell you where resources were allocated |
21:07:12 | FromDiscord | <leorize> and this is my favorite tool for profiling memory\: https://github.com/KDE/heaptrack |
21:07:15 | FromDiscord | <Elegantbeef> Not as useful when you're not allocating inside Nim |
21:07:17 | FromDiscord | <leorize> infinitely faster than massif |
21:07:46 | FromDiscord | <Elegantbeef> I generally profile memory by using a microscope and a tally count |
21:08:21 | FromDiscord | <Phil> sent a code paste, see https://play.nim-lang.org/#ix=4Kof |
21:08:35 | FromDiscord | <Phil> Compiled with:↵` nim c --path:. -d:useMalloc --passC:-fsanitize=leak --passL:-fsanitize=leak --stacktrace:off --debugger:native --passC:-fno-omit-frame-pointer ./examples/widgets/video.nim` |
21:09:00 | FromDiscord | <leorize> heaptrack can do leaks too and it's faster than valgrind |
21:09:05 | FromDiscord | <leorize> so you can try running with that |
21:09:20 | FromDiscord | <Phil> That's a program for a change I assume? |
21:09:29 | FromDiscord | <Phil> Ah you linked it up above |
21:09:50 | FromDiscord | <Phil> Oh hey its in the arch repo |
21:10:00 | FromDiscord | <Phil> And jesus christ that's a lot of dependencies |
21:10:09 | FromDiscord | <leorize> it's a kde program |
21:10:34 | FromDiscord | <Phil> I use gnome mostly, I'm not that used to having a program come with like 30 dependencies immediately |
21:11:20 | NimEventer | New thread by lou15b: Changing an object's field is rejected in a destructor with new syntax, see https://forum.nim-lang.org/t/10580 |
21:11:21 | FromDiscord | <Phil> Should I compile the binary with anything fancy before I launch it with heaptrack? |
21:11:29 | FromDiscord | <Elegantbeef> Me overhere using awesome wm and using gnome and kde programs |
21:11:40 | FromDiscord | <leorize> turn sanitizer off \:P↵(@Phil) |
21:11:51 | FromDiscord | <leorize> keep debugger and no-omit-frame-pointer |
21:11:54 | FromDiscord | <leorize> and useMalloc |
21:12:15 | FromDiscord | <Phil> stacktrace:off (why off?) ? |
21:12:31 | FromDiscord | <leorize> because it inserts unnecessary filler code |
21:12:55 | FromDiscord | <leorize> the trace accounting is a nim-specific thing so none of these tools can read it |
21:14:41 | FromDiscord | <Phil> I have a large fascinating window now! https://media.discordapp.net/attachments/371759389889003532/1168659259806994452/image.png?ex=655291c0&is=65401cc0&hm=24ff4524ac13a281c7148db910ff04b994acd8950d97cb94b84fb795f15d0a6b& |
21:14:45 | FromDiscord | <Elegantbeef> To add, given that you are not attempting to debug Nim problems, it's just a bunch of extra nuisance that will not aid you |
21:14:57 | FromDiscord | <Phil> Based on that gtk is doing all the leaks but I'm like 60% sure that's due to wrong useage on the nim end |
21:15:06 | FromDiscord | <Elegantbeef> Lol you leaked 90% of the memory |
21:15:13 | FromDiscord | <Elegantbeef> 99% |
21:15:30 | FromDiscord | <leorize> yea you don't have a good trace |
21:15:32 | FromDiscord | <Phil> The leak was large enough for me to notice within task manager |
21:15:43 | FromDiscord | <Phil> I anticipated something like that |
21:16:09 | FromDiscord | <leorize> check the tree to see if there's any helpful traces |
21:16:54 | FromDiscord | <Phil> By tree you mean the ... bottom-up tab since that has expandable entries in a listß |
21:16:55 | FromDiscord | <Phil> (edit) "listß" => "list?" |
21:17:23 | FromDiscord | <Phil> Oh hey, a Flamegraph |
21:17:24 | FromDiscord | <leorize> yea the next 3 tabs have different view of the call tree |
21:17:43 | FromDiscord | <Chronos [She/Her]> Is there any reason to encrypt a user's email with a secret? If the database has been leaked, wouldn't it already mean that they likely have the key? |
21:17:51 | FromDiscord | <Chronos [She/Her]> Secret |
21:17:56 | FromDiscord | <leorize> you might need to use an another distro for dev to get better traces |
21:18:34 | FromDiscord | <leorize> ie. run a fedora distrobox |
21:18:48 | FromDiscord | <leorize> arch strips all debug info and frame pointers so a lot of call data might be lost there |
21:18:53 | FromDiscord | <Phil> Err... any keys to identifying "helpful traces"ß |
21:18:55 | FromDiscord | <Phil> (edit) "traces"ß" => "traces"?" |
21:19:03 | FromDiscord | <Phil> Basically look for somewhere where it mentions my own code? |
21:19:45 | FromDiscord | <leorize> if you can put up with it, maybe valgrind can give you an insight \:P |
21:20:15 | arkanoid | heaptrack seems really nice |
21:20:30 | FromDiscord | <leorize> is this code of yours public? I have a fedora box here that I can try to run for you |
21:20:40 | FromDiscord | <Phil> I mean, generally the libgstreamer stuff seems to be the main culprit https://media.discordapp.net/attachments/371759389889003532/1168660767193710652/image.png?ex=65529327&is=65401e27&hm=2056805179a0257cfe65b3f244e65bba6eb24eba5e9398d6d9cffacf80143502& |
21:20:55 | FromDiscord | <Phil> In reply to @leorize "is this code of": Yeah, it's already in owlkettle. Or rather the example in question that leaks as hell is in owlkettle |
21:20:56 | FromDiscord | <Chronos [She/Her]> I need to figure out how to properly sort my code oof, right now I'm keeping all types in one file, but if I move them into their own files I wouldn't even know how to name or organise them |
21:21:11 | FromDiscord | <Phil> One sec, looking for it |
21:21:16 | FromDiscord | <leorize> sounds like you might not be cleaning up your video widgets properly? |
21:21:28 | FromDiscord | <Phil> https://media.discordapp.net/attachments/371759389889003532/1168660971301130240/image.png?ex=65529358&is=65401e58&hm=59a937d989eee96f41b55f97327054dcc9b59856c2aa8fa25c16f049c963a95f& |
21:21:35 | FromDiscord | <Phil> https://github.com/can-lehmann/owlkettle/blob/main/examples/widgets/video.nim |
21:22:02 | FromDiscord | <Phil> Actually that is a good point, I don't think any of the widgets have destructors |
21:22:18 | FromDiscord | <Phil> Immaterial to this point in particular because mediastream does have destructors |
21:23:03 | FromDiscord | <Phil> Let me get the links to the video widget and the wrapped mediastream code and type |
21:23:29 | FromDiscord | <Elegantbeef> Widgets are refs they'd need finalizers or the manual thing you've done for things for custom dealloc |
21:23:53 | FromDiscord | <Phil> sent a long message, see http://ix.io/4Koi |
21:23:55 | * | derpydoo joined #nim |
21:24:07 | FromDiscord | <Phil> In reply to @Elegantbeef "Widgets are refs they'd": Define finalizer, you mean destructor hooks? |
21:24:52 | FromDiscord | <Phil> Note:↵The Video widget takes ownership over the MediaStream |
21:25:20 | FromDiscord | <Phil> Actually that's a lie, it doesn't, hmm |
21:25:26 | FromDiscord | <Elegantbeef> No nim allows you to do `new(T, finalizer)` to set a global finalizer for `T` |
21:25:31 | * | neceve quit (Ping timeout: 255 seconds) |
21:25:46 | FromDiscord | <Elegantbeef> This is how one did destructors for refs before 2.0 |
21:25:57 | FromDiscord | <Phil> Er... does that work for inheritance? |
21:26:02 | FromDiscord | <leorize> I got you some traces |
21:26:04 | FromDiscord | <leorize> it's not pretty |
21:26:06 | FromDiscord | <Elegantbeef> It should work |
21:26:18 | FromDiscord | <Phil> So `new(GtkWidget, <finalizer>)`? |
21:26:29 | FromDiscord | <Phil> In reply to @leorize "it's not pretty": As in everything is wrong or as in hard to read ? |
21:26:40 | FromDiscord | <Elegantbeef> Yea, but I'd suggest just doing the manual technique in a macro |
21:27:16 | FromDiscord | <Elegantbeef> sent a code paste, see https://play.nim-lang.org/#ix=4Kok |
21:28:01 | FromDiscord | <leorize> hard to read↵(@Phil) |
21:28:24 | FromDiscord | <leorize> but the traces are infinitely better than the one you got on arch \:P |
21:28:25 | FromDiscord | <Phil> Hmm we might get away with defining that for using `WidgetState` for `GtkWidgetImpl` since that contains a ref to the actual GtkWidget on its `internalWidget` field |
21:28:52 | FromDiscord | <Phil> I'll take the file and look over it, I'd love to not leak memory like a sieve for that widget.↵The only reason we added it was that we concluded that the problem must lie in GTK |
21:29:47 | FromDiscord | <leorize> trace.log https://media.discordapp.net/attachments/371759389889003532/1168663062279106581/trace.log?ex=6552954a&is=6540204a&hm=63bf9d0dd7f02a079fd7aa0cdf0f16e500ff8ba68ee3d995014e972430541e6b& |
21:30:29 | FromDiscord | <leorize> there's nim code in this trace |
21:30:54 | FromDiscord | <leorize> you should consider running a fedora distrobox for this kind of work |
21:31:15 | arkanoid | whats wmt |
21:31:23 | FromDiscord | <Phil> HmmI do have Boxes installed |
21:31:39 | FromDiscord | <leorize> use distrobox |
21:31:42 | arkanoid | what's the difference from nim allocator and useMalloc? |
21:31:47 | FromDiscord | <leorize> it's container-based and don't require a VM |
21:31:59 | FromDiscord | <leorize> malloc is the C allocator↵(<@709044657232936960_arkanoid=5b=49=52=43=5d>) |
21:37:40 | FromDiscord | <leorize> @Phil I can DM you my heaptrack output if you're interested |
21:37:51 | FromDiscord | <leorize> this stuff have lineinfo, unlike that trace |
21:39:53 | FromDiscord | <Phil> In reply to @leorize "<@180601887916163073> I can DM": I got nothing to loose and everything to gain.↵Like something to cross reference for when I setup distrobox on arch.↵For the most part though, I'll have to look at it tomorrow because this feels like it requires more brainpower than I have after a workday at 10pm |
21:42:44 | FromDiscord | <Phil> Ah, I was supposed to load that file into the heaptrack GUI, gotcha |
21:43:55 | FromDiscord | <Phil> Okay, stuff for tomorrow, currently still no clue how to read this compared to the trace.log |
21:45:34 | FromDiscord | <leorize> I managed to run this in valgrind and lol there's even memory corruption |
21:46:00 | FromDiscord | <leorize> but that might just be gtk problem and not yours |
21:46:45 | FromDiscord | <Elegantbeef> There has to be a fallacy about the quality of well used software |
21:47:15 | FromDiscord | <Elegantbeef> "Popular software does not give any merit in the quality of the implementation" 😄 |
21:47:16 | FromDiscord | <Phil> I mean, I'd bet on wrong useage of GTK |
21:47:26 | FromDiscord | <Phil> On our end |
21:47:46 | FromDiscord | <Elegantbeef> I don't doubt it, if you are not destroying the owned GTK resources when the ref goes out of scope |
21:57:51 | FromDiscord | <System64 ~ Flandre Scarlet> https://github.com/Flix01/imgui/wiki/ImGui-Addons-Branch-Home↵Might be interesting to make bindings for this |
22:01:38 | FromDiscord | <Chronos [She/Her]> I wish Debby could have stuff like unique fields tbh, would be useful |
22:01:38 | * | deadmarshal_ quit (Remote host closed the connection) |
22:07:50 | FromDiscord | <Chronos [She/Her]> Is there any way to view older docs and such? Curious aha |
22:17:21 | FromDiscord | <Chronos [She/Her]> sent a code paste, see https://play.nim-lang.org/#ix=4Kou |
22:18:16 | arkanoid | most of the articles about valgrind vs sanitizers says that sanitizers are better because they can detect more thanks to source code and compiler magic, while valgrid is when you just have the executable |
22:18:24 | FromDiscord | <Elegantbeef> `var meh{.cursor.} = ...` |
22:19:09 | FromDiscord | <Chronos [She/Her]> `cursor`? |
22:19:34 | FromDiscord | <Elegantbeef> https://nim-lang.org/docs/destructors.html#the-cursor-pragma |
22:19:53 | FromDiscord | <Chronos [She/Her]> Ah epic, thanks! |
22:20:57 | FromDiscord | <Chronos [She/Her]> Hm |
22:21:07 | FromDiscord | <Chronos [She/Her]> The comment said `# don't copy on assignment for performance` for `encstr.shallow` |
22:22:35 | FromDiscord | <Chronos [She/Her]> I mean that small test seems to work...? |
22:23:07 | FromDiscord | <Elegantbeef> With 2.0 aslong as you do not mutate the string it probably implicitly cursors it |
22:23:10 | FromDiscord | <Chronos [She/Her]> Oh epic both tests pass now |
22:24:03 | FromDiscord | <Chronos [She/Her]> In reply to @Elegantbeef "With 2.0 aslong as": The code assigns that string to an object so |
22:24:09 | FromDiscord | <leorize> you should use an established library like libsodium for all crypto purposes |
22:25:06 | FromDiscord | <Chronos [She/Her]> Ah alright then, I was just gonna use this because it compiles the original source and such but I'll use libsodium then |
22:31:15 | FromDiscord | <Chronos [She/Her]> I'm going to struggle to implement this in a way that isn't going to slow down my entire program :p |
22:32:47 | FromDiscord | <leorize> make it work then make it fast |
22:33:08 | FromDiscord | <leorize> make it fast right away requires experiences that you don't have yet \:P |
22:33:51 | FromDiscord | <Chronos [She/Her]> Fair lol |
22:33:58 | FromDiscord | <Chronos [She/Her]> This looks a bit tricky |
22:34:03 | FromDiscord | <Chronos [She/Her]> The libsodium API :p |
22:34:06 | FromDiscord | <Chronos [She/Her]> Just confusing |
22:35:53 | * | advesperacit quit () |
22:40:57 | NimEventer | New thread by AntonioFS: Mismatch Nim Documentation Regarding 32-bit Floating-Point Literals., see https://forum.nim-lang.org/t/10581 |
22:44:44 | FromDiscord | <Chronos [She/Her]> Ah my version of libsodium is too new :/ |
22:54:00 | FromDiscord | <Chronos [She/Her]> I just made a symlink for `libsodium.so.26` to `libsodium.so.23`, only during etsting |
22:54:04 | FromDiscord | <Chronos [She/Her]> testing lol |
22:56:27 | FromDiscord | <leorize> shouldn't the libsodium wrapper link to the newest version? |
22:57:13 | FromDiscord | <leorize> when the soname changes it means the ABI/API contracts might have been broken, so I'd recommend against symlinking |
22:57:34 | FromDiscord | <leorize> (ie. function now takes 3 parameters instead of 2) |
23:00:56 | arkanoid | I just tested that gcc sanitizer does not need -debugger:native nor --debuginfo, but just -d:useMalloc. What are these two param really doing? |
23:01:38 | arkanoid | it seems to me that are just to change the debugger output to represent nim lines, instead of c ones |
23:02:15 | FromDiscord | <Elegantbeef> The debugger param adds debug information in the generated code which can be used by tooling for source line information |
23:02:55 | arkanoid | and debugger:native |
23:02:58 | arkanoid | ? |
23:03:13 | FromDiscord | <Elegantbeef> That's what I talked about |
23:03:52 | FromDiscord | <Chronos [She/Her]> In reply to @leorize "shouldn't the libsodium wrapper": https://github.com/FedericoCeratto/nim-libsodium/tree/master most up-to-date one I know |
23:04:00 | FromDiscord | <Chronos [She/Her]> I did make an issue |
23:04:02 | FromDiscord | <Chronos [She/Her]> so |
23:05:14 | * | krux02__ joined #nim |
23:05:15 | * | krux02_ quit (Read error: Connection reset by peer) |
23:05:48 | arkanoid | oh! debugger:native flag is equivalent to specifying the --linedir:on and --debuginfo flags. Just found on nim blog |
23:10:38 | FromDiscord | <raynei486> @Chronos [She/Her] btw since you've been talking a lot about langdev this might be an interesting project for you↵https://gitlab.com/pmetras/nim0.git |
23:11:44 | FromDiscord | <Chronos [She/Her]> Oh interesting, thanks! |
23:13:04 | * | termer_ joined #nim |
23:13:12 | * | blackbeard420_ joined #nim |
23:13:18 | * | gshumway_ joined #nim |
23:15:16 | * | koltrast_ joined #nim |
23:15:23 | * | termer quit (Ping timeout: 264 seconds) |
23:15:24 | * | nmz quit (Ping timeout: 264 seconds) |
23:15:24 | * | gshumway quit (Ping timeout: 264 seconds) |
23:15:31 | * | nmz- joined #nim |
23:15:45 | * | blackbeard420 quit (Read error: Connection reset by peer) |
23:17:07 | * | koltrast quit (Ping timeout: 264 seconds) |
23:18:20 | * | lumo_e joined #nim |
23:34:37 | * | tiorock joined #nim |
23:34:37 | * | tiorock quit (Changing host) |
23:34:37 | * | tiorock joined #nim |
23:34:37 | * | rockcavera quit (Killed (mercury.libera.chat (Nickname regained by services))) |
23:34:37 | * | tiorock is now known as rockcavera |
23:38:13 | arkanoid | how can I use "when defined(release):" block in config.nims ? |
23:38:43 | arkanoid | I want to enable set of switched depending if compiling with -d:debug or -d:release |
23:38:56 | arkanoid | if I try, they get ignored |
23:50:14 | * | blackbeard420_ quit (Quit: ZNC 1.8.2 - https://znc.in) |
23:50:26 | * | blackbeard420 joined #nim |
23:56:09 | arkanoid | how do you setup your project to have different compilation flags for debug or release? |
23:56:17 | arkanoid | do you create ad-hoc nimble tasks? |
23:58:29 | arkanoid | switch(..) seems completely ignores in nimble file, so as "if defined(foo)" in config.nims file |
23:59:35 | FromDiscord | <juancarlospaco> In reply to @arkanoid "how can I use": https://github.com/nim-lang/Nim/blob/devel/config/nim.cfg#L86-L94 |