<< 02-01-2024 >>

00:06:44*xet7 quit (Quit: Leaving)
00:06:57FromDiscord<Phil> sent a code paste, see https://play.nim-lang.org/#ix=html>
00:07:36FromDiscord<Phil> sent a code paste, see https://play.nim-lang.org/#ix=html>
00:17:29FromDiscord<Phil> Errrrr cann heaptrack do the same kind of accuracy to locating memory leaks?
00:17:35FromDiscord<Phil> as valgrind
00:21:28FromDiscord<albassort> does arraymancer have a radial function
00:21:35FromDiscord<albassort> to iterate radially outside the center
00:21:39FromDiscord<albassort> (edit) "the center" => "a given point"
00:23:16FromDiscord<albassort> sent a long message, see <!doctype html>
00:24:19FromDiscord<Phil> sent a code paste, see https://play.nim-lang.org/#ix=html>
00:24:55FromDiscord<leorize> leak is not what you should be worried about here
00:24:56FromDiscord<leorize> and if you can't pay for valgrind, try address sanitizer
00:25:32FromDiscord<albassort> isn
00:25:36FromDiscord<albassort> (edit) "isn" => "isn't valgrind fre"
00:25:51FromDiscord<Phil> I can, just don't have kcachegrind installed
00:26:17FromDiscord<Phil> Preferred heaptrack because I could understand that way more
00:26:46FromDiscord<leorize> with threading you should focus on data races
00:27:32FromDiscord<albassort> isn'
00:27:50FromDiscord<Phil> Okay, so next entirely new topic.↵I guess I'll need to google how to detect data races with valgrind which likely needs some flags somewhere?
00:27:59FromDiscord<albassort> hey phil can you recap me on what you're doing and why you aren't trying to fix it by addressing ORC?
00:28:04FromDiscord<albassort> (edit) "addressing" => "adding to"
00:28:22FromDiscord<Phil> What? How would orc... what?
00:28:22FromDiscord<leorize> oh lol matrix did got get an entire topic of discussion
00:28:47FromDiscord<albassort> In reply to @isofruit "What? How would orc...": if there is a leak isn't it ORCs fault and you're doing some weird edge case
00:28:50FromDiscord<albassort> this is my assumption
00:28:54FromDiscord<leorize> it's called helgrind and DRD↵(@Phil)
00:29:04FromDiscord<Audrey Hale> image12.png https://media.discordapp.net/attachments/371759389889003532/1191538616896327782/image12.png?ex=65a5cdcf&is=659358cf&hm=e85f0820a34a13e9c79d37f1115611e9f575833aa0f308b33e62e4ca74bdfee8&
00:29:05FromDiscord<Phil (he/him)> Jumping over to fractal
00:29:07FromDiscord<Audrey Hale> 1659914977733321.jpg https://media.discordapp.net/attachments/371759389889003532/1191538628283863131/1659914977733321.jpg?ex=65a5cdd2&is=659358d2&hm=c6a1eef36537b80dbf572e52dd3294f60c3370f19473ee541b7e5ff6cae9164e&
00:29:11FromDiscord<albassort> hmm
00:29:14FromDiscord<Audrey Hale> troon shit fake pussy.jpg https://media.discordapp.net/attachments/371759389889003532/1191538661473406976/troon_shit_fake_pussy.jpg?ex=65a5cdda&is=659358da&hm=a52114571e9a18817d3e20235a8c19308bee1e07835a7f8c7b3dfc80eeaa1497&
00:29:15FromDiscord<albassort> strange
00:29:20FromDiscord<Audrey Hale> pussy dirt.mp4 https://media.discordapp.net/attachments/371759389889003532/1191538686484037683/pussy_dirt.mp4?ex=65a5cde0&is=659358e0&hm=2ac8554de1502a531153ba5b9897684079df6ac61614b86c8282f38551ef48a3&
00:29:39FromDiscord<Audrey Hale> image12.png https://media.discordapp.net/attachments/371759389889003532/1191538759414587463/image12.png?ex=65a5cdf1&is=659358f1&hm=59331c1ad567df83869fa1900f6d298932a2cc1e47c82608679f57745d0118b2&
00:29:39FromDiscord<albassort> <@&371760044473319454> some kid never got enough love from their parrents
00:29:45FromDiscord<Audrey Hale> 1659914977733321.jpg https://media.discordapp.net/attachments/371759389889003532/1191538784748187679/1659914977733321.jpg?ex=65a5cdf8&is=659358f8&hm=fd02ab97d7bd8b3f66d64549a9269f5c542ed77d4920ef52f0fc30be7b84c5ff&
00:30:39FromDiscord<albassort> sorry for the indirect ping i should have described the issue
00:31:03FromDiscord<Phil> No all good, we remove the ping when the issue was resolved
00:31:14FromDiscord<albassort> anyway my logic being
00:31:17FromDiscord<albassort> orc shouldn't leak
00:31:38FromDiscord<Phil> I haven't even figured out if I really have a leak or anything
00:31:51FromDiscord<leorize> \_\_IO\_file is C's FILE
00:31:52FromDiscord<albassort> that is the hardest part of finding leaks
00:31:56FromDiscord<leorize> did you remember to close them?
00:31:58FromDiscord<albassort> somertimes they're quantum
00:32:11FromDiscord<albassort> In reply to @leorize "did you remember to": do they not close on their own
00:32:22FromDiscord<albassort> when you close the streamas
00:32:23FromDiscord<Elegantbeef> The issue with orc isn't really leaking as much as Orc not interferring with orc
00:32:24FromDiscord<albassort> (edit) "streamas" => "streams"
00:32:28FromDiscord<Elegantbeef> It's presently only single threaded mind
00:32:59FromDiscord<Phil (he/him)> Close... the channels? The queue?
00:33:00FromDiscord<albassort> ah so phil issue is hes doing something both exotic and threaded and orc isn't smart enough
00:33:18FromDiscord<leorize> whatever that allocated those?
00:33:30FromDiscord<albassort> those are allocated for multiple reasons
00:33:43FromDiscord<albassort> they get closed on their own, or are supposed to
00:33:47FromDiscord<leorize> ah, you're doing this on arch aren't you?
00:34:29FromDiscord<albassort> phil doesn't strike me as a comrade arch user
00:34:47FromDiscord<Phil (he/him)> ... is this the point where I actually am finally forced to figure out how to do a fedora VM on my machine?
00:34:52FromDiscord<albassort> hes too stable, he'd use Debian or fedo--
00:34:53FromDiscord<Phil (he/him)> I use arch btw.↵(@albassort)
00:35:29FromDiscord<leorize> so these tools will help you\:↵1. add `-fno-omit-frame-pointer` and `-mno-omit-leaf-frame-pointer` to `nim` cflags↵2. use `distrobox` to load a distro like `fedora` as your dev box
00:35:31FromDiscord<Phil (he/him)> image.png https://media.discordapp.net/attachments/371759389889003532/1191540240385593385/image.png?ex=65a5cf53&is=65935a53&hm=4946a9d1c0c68b185e1e20b6813830cfe300c93b4053af563579afaa99bd0662&
00:35:33FromDiscord<albassort> In reply to @Phil (he/him) "... is this the": don't do a vm, make an install then chroot in
00:35:33FromDiscord<Phil (he/him)> Literally my desktop
00:35:46FromDiscord<albassort> p sure theres dockers for this situation
00:35:57FromDiscord<leorize> distrobox is super easy to use for this purpose
00:36:07FromDiscord<leorize> I use it to build a fedora dev environment on gentoo
00:36:10FromDiscord<Phil (he/him)> Not. in. my. life will do anything even remotely potentially dangerous to my actual installation↵(@albassort)
00:36:33FromDiscord<albassort> In reply to @leorize "distrobox is super easy": never heard of it will investigate
00:36:59FromDiscord<leorize> https://wiki.archlinux.org/title/Distrobox
00:37:13FromDiscord<leorize> and you should setup podman in rootless mode\: https://wiki.archlinux.org/title/Podman
00:37:17FromDiscord<Phil (he/him)> thanks, was just about to look for which commands are needed to make one
00:37:24FromDiscord<albassort> i have a debian installation i obtained somehow
00:37:25FromDiscord<Phil (he/him)> Already have a docker client going so eh
00:37:30FromDiscord<albassort> that i chroot into and compile stuff in
00:37:38*krux02 quit (Remote host closed the connection)
00:37:39FromDiscord<leorize> docker uses root so...
00:37:52FromDiscord<leorize> podman doesn't need root, which is why I prefer it for this stuff
00:38:03FromDiscord<leorize> nor does it need a daemon
00:38:10FromDiscord<albassort> i like docker because i don't understand how it works
00:38:18FromDiscord<albassort> its pure magic
00:38:44FromDiscord<leorize> containers are just chroots with extra steps \:p
00:38:50FromDiscord<Elegantbeef> Meanwhile me over-here preferring lxd
00:38:53FromDiscord<Phil (he/him)> Iso 5s ago\: "Fine, I'll install it"↵"please install podman" (my alias)↵Iso 2s ago\: "The fuck does it need 100MB for"
00:39:43FromDiscord<albassort> In reply to @Elegantbeef "Meanwhile me over-here preferring": i heard that lsd varient was pretty mid
00:39:46FromDiscord<leorize> distrobox does support docker, never tried though
00:40:24FromDiscord<Elegantbeef> Drugs r bad
00:40:38FromDiscord<albassort> making fun of the name
00:40:40FromDiscord<albassort> >:(
00:40:48FromDiscord<albassort> drugs r bad tho don't do drugs kids
00:42:04FromDiscord<albassort> also im guessing that uh there is no radial iterator for arraymancer :(
00:42:18FromDiscord<albassort> i know i wrote one in kotlin 2 years ago but i dont wanna go find my cocde
00:42:21FromDiscord<albassort> (edit) "cocde" => "old code"
00:42:34FromDiscord<albassort> i'll just floor a sin wave
00:42:34FromDiscord<leorize> you can ask in the science channel
00:42:47FromDiscord<leorize> someone probably wrote one
00:43:07FromDiscord<albassort> by the time i have an answer i will have already written one
00:43:15FromDiscord<albassort> the only thing between me and it is procrastination
00:43:33FromDiscord<leorize> never hurt to have a backup plan
00:43:56FromDiscord<leorize> who knows maybe it will be an mratsim impl and surpass your stuff in performance \:p
00:44:42FromDiscord<albassort> i find the line we draw between normal cs stuff and #science very arbitrary and silly
00:44:58FromDiscord<albassort> science is when you include numbers
00:45:09FromDiscord<leorize> nim science is when you do math \:p
00:45:19FromDiscord<Phil> ... Ahhhh crud
00:45:37FromDiscord<Phil> All my aliases from my zshrc file still count when I enter the fedora container
00:45:51FromDiscord<Phil> Which means my alias "lsd => ls" just screwed me
00:45:52FromDiscord<Elegantbeef> That doesn't sound right
00:46:07FromDiscord<leorize> fedora have lsd in its repository
00:46:15FromDiscord<leorize> just dnf install it
00:46:46FromDiscord<Phil> Yeah but its kinda forcing double installs etc... just meh
00:47:01FromDiscord<leorize> I solved that problem by not installing dev tool on the host \:p
00:47:35FromDiscord<Phil> ... shouldn't... a fedora container kinda... yknow... have its own filesystem?
00:48:23FromDiscord<leorize> distrobox create supports `--home` to set a different folder as the home directory, if you want
00:49:08FromDiscord<Phil> I would prefer that ... where does dnf install the dependencies to? In the container I hope? Or does it put them in my FS somewhere?
00:49:18FromDiscord<Phil> (edit) "dependencies" => "packages"
00:49:25FromDiscord<leorize> ofc it's in your fs, in the containers storage \:p
00:50:27FromDiscord<Phil> uninstalling valgrind and kcachegrind to install them under fedora then
00:51:10*azimut joined #nim
00:51:27FromDiscord<Phil> I kinda wish nowadays I hadn't put my OS in a 50GB partition or whatever I gave it
00:51:52FromDiscord<Phil> Still good that the home folder is in its own partition but the 50GB really aren't enough
00:52:00FromDiscord<leorize> 64GB ought to be enough for everyone \:p
00:52:17FromDiscord<leorize> good news for you then because podman in user mode saves container to your home directory
00:52:18FromDiscord<rubythulhu> `import some_module; export some_module` <- this exports all the exports from that module, right? so you can use it to create a module that's just a combination of a bunch of submodules?
00:52:49FromDiscord<leorize> you can, and in fact some libraries are like that↵(@rubythulhu)
00:53:11*azimut quit (Remote host closed the connection)
00:53:34*azimut joined #nim
00:53:53FromDiscord<Phil> In reply to @rubythulhu "`import some_module; export some_module`": Even further, some files use include instead of import, but that's a rather special case and you shouldn't use include in general.
00:53:54FromDiscord<rubythulhu> yeah basically i want `import lib/engine` to just be `import engine/[a,b,c,d,e]; export a,b,c,d,e` essentially
00:54:22FromDiscord<rubythulhu> that sounds gross b/c it would break privacy between the submodules
00:54:35FromDiscord<rubythulhu> that's why you called it a special case i guess haha
00:54:41FromDiscord<Phil> Can be necessary if you split one large module apart into smaller modules that would end up in a circular dependency chain
00:54:53FromDiscord<Phil> But yeah, fully agree with you
00:55:09FromDiscord<leorize> you get to do disambiguation with the include route
00:55:37FromDiscord<rubythulhu> i love how often i have a nim question and the answer is "duh, exactly what you would think"
00:55:45FromDiscord<Phil> Okay, I got nowhere today regarding the testing and it's 2am, I'm sleeping now and likely will be too dead tomorrow
00:56:41FromDiscord<leorize> g'night
01:01:30FromDiscord<albassort> does nim have anything like ? : (I know the answer I just don't like it)
01:02:04FromDiscord<Elegantbeef> If expression or search elvis
01:02:09FromDiscord<leorize> you can always make your own
01:02:21FromDiscord<albassort> sent a code paste, see https://play.nim-lang.org/#ix=html>
01:02:31FromDiscord<albassort> In reply to @leorize "you can always make": >:(
01:02:42FromDiscord<albassort> In reply to @Elegantbeef "If expression or search": who is elvis isn't he dead
01:02:45FromDiscord<Elegantbeef> `max(shape[0], shape[1])`
01:02:47FromDiscord<leorize> isn't that thing what you call `min()`?
01:02:51FromDiscord<leorize> ah max, sorry
01:03:12FromDiscord<albassort> thank
01:06:43FromDiscord<Elegantbeef> https://github.com/mattaylor/elvis does exist but it's completely broken
01:06:58FromDiscord<Elegantbeef> https://github.com/mattaylor/elvis/pull/12 this PR does resolve some issues with it
01:08:57FromDiscord<albassort> its ok Cunningham's Law came i nclutc h here
01:09:02FromDiscord<albassort> (edit) "nclutc h" => "n clutch"
01:23:59NimEventerNew question by Nate Ackerman: Nim: Analog of .dirty. pragma for macros, see https://stackoverflow.com/questions/77743832/nim-analog-of-dirty-pragma-for-macros
01:58:03NimEventerNew Nimble package! bight - Byte-ordering operations with a simple read/write API., see https://github.com/auxym/bight
02:38:39*TheLink quit (Ping timeout: 252 seconds)
02:38:54*dtomato9 joined #nim
02:38:56*TheLink joined #nim
02:40:50*dtomato quit (Ping timeout: 252 seconds)
02:40:51*dtomato9 is now known as dtomato
03:17:41*end quit (Ping timeout: 252 seconds)
03:30:51*mal`` quit (Quit: Leaving)
03:31:55*end joined #nim
03:32:13*mal`` joined #nim
03:51:58FromDiscord<zectbumo> how do I install nimble modules globally?
03:52:09FromDiscord<Elegantbeef> `nimble install x`
03:52:47FromDiscord<zectbumo> that's what I thought but it seems to install only on a per user level ~/.nimble/pkgs/
03:58:43FromDiscord<zectbumo> let's see I'm on version nimble v0.13.1 compiled at 2023-10-07 07:33:02
03:59:12FromDiscord<Elegantbeef> I mean that's how it does global
03:59:19FromDiscord<Elegantbeef> if you mean to install inside root, it does not
03:59:49FromDiscord<zectbumo> huh?? like global as in /usr/local/nimble/pkgs
04:00:26FromDiscord<Elegantbeef> Right
04:01:03FromDiscord<Elegantbeef> Maybe I'm just out of the loop but installing Nim source files into a shared user directory makes very little sense 😄
04:01:44FromDiscord<zectbumo> I must have been sleeping under a rock. What year is it?
04:02:51FromDiscord<Elegantbeef> 1993
04:02:53FromDiscord<zectbumo> okay. riddle me this. I want to install pkgs for another user (as a super user)
04:05:52FromDiscord<Elegantbeef> Hey i'm a simple person
04:05:57FromDiscord<Elegantbeef> Speak slowly and carry a bit pointer
04:08:57FromDiscord<zectbumo> okay. not sure how I missed this the 4 times I went through the help page:↵--nimbleDir:dirname Set the Nimble directory.
04:11:12FromDiscord<zectbumo> it must be the -2 impairment I debuff I currently have
04:11:45FromDiscord<zectbumo> (edit) "it must be the -2 impairment I debuff I currently have ... " added "beurp"
04:19:51*pbsds quit (Quit: The Lounge - https://thelounge.chat)
04:20:34*pbsds joined #nim
04:38:28FromDiscord<hlsee> Is there anything that I can read about what "annoymous proc" is? I am relatively new in programming and confused about this terminology
04:38:49FromDiscord<Elegantbeef> It's a proc without a name it's that simple
04:38:57FromDiscord<Elegantbeef> `let a = proc() = echo "hello"` is the simplest form
04:39:11FromDiscord<hlsee> Ohh I see, thank you
05:17:14FromDiscord<spacelucy> hey is it possible to have nim compile a binary with a different name than the file
05:17:16*rockcavera quit (Remote host closed the connection)
05:17:36FromDiscord<Elegantbeef> `-o`
05:17:38FromDiscord<spacelucy> like i have a file called main.nim but can i have it create a binary called something else without having to manually rename it after
05:17:46FromDiscord<Elegantbeef> Insert rtfm here https://nim-lang.org/docs/nimc.html
05:18:51FromDiscord<spacelucy> oh, missed that
05:18:53FromDiscord<spacelucy> thanks
05:34:26FromDiscord<spacelucy> also is there a way to install the binary to your system like `sudo cmake install` or do you just need to do it manually with `sudo cp binary /usr/bin`?
05:35:55NimEventerNew thread by oyster: Where is libgo.dll?, see https://forum.nim-lang.org/t/10830
05:39:46FromDiscord<Elegantbeef> `sudo nim c --outDir` could work
05:39:50FromDiscord<Elegantbeef> I do not know though if it does
05:46:58NimEventerNew thread by oyster: Some MM modes leads to SIGSEGV, see https://forum.nim-lang.org/t/10831
05:50:17FromDiscord<Elegantbeef> I really should never talk to people about fun type things... Implemented yet another trait system 😄
05:51:39FromDiscord<Robyn [She/Her]> Oh?
05:51:45FromDiscord<huantian> In reply to @spacelucy "also is there a": Me when people are manually installing binaries to /usr/bin
05:52:21FromDiscord<huantian> In reply to @Elegantbeef "I really should never": We need a trait system of trait systems
05:53:17FromDiscord<Robyn [She/Her]> In reply to @spacelucy "also is there a": Why do that instead of adding a directory to PATH?
05:55:36FromDiscord<zectbumo> In reply to @Elegantbeef "I really should never": what's the trickiest part?
05:56:28FromDiscord<Elegantbeef> Not using too many macros
05:56:49FromDiscord<Elegantbeef> image.png https://media.discordapp.net/attachments/371759389889003532/1191621097456664646/image.png?ex=65a61aa0&is=6593a5a0&hm=97cde54cc83b6e176e2dff2c001ad1f3ef642978f0076f94e8cb7be1dee50d47&
05:57:43*azimut quit (Ping timeout: 240 seconds)
05:57:56FromDiscord<Robyn [She/Her]> In reply to @Elegantbeef "image.png": Out of curiosity, could you not utilise concepts for this? For defining traits, that is
05:57:57FromDiscord<zectbumo> "Traitor" 😄
05:58:17FromDiscord<Elegantbeef> I did in the older version of traitor
05:59:52FromDiscord<Robyn [She/Her]> Ah
05:59:54FromDiscord<Elegantbeef> I wanted to make this as simple as possible to reduce the complexity
05:59:57FromDiscord<Robyn [She/Her]> Why'd ya switch?
05:59:59FromDiscord<Robyn [She/Her]> Aah
06:00:12FromDiscord<Elegantbeef> The entire code is like 100 lines + the stuff inside micros I used
06:00:14FromDiscord<Robyn [She/Her]> Concepts would've looked better here imo :P
06:00:20FromDiscord<zectbumo> what does implTrait do?
06:00:33FromDiscord<Elegantbeef> Generates the vtable and `.()` macro
06:00:59FromDiscord<Elegantbeef> Wait I do not need the `.()` macro
06:01:02FromDiscord<zectbumo> neat
06:01:21FromDiscord<Elegantbeef> I guess thanks you helped me see the error in my ways
06:02:39FromDiscord<zectbumo> it's cool to see the language do what you want the way you want
06:04:38FromDiscord<huantian> In reply to @Elegantbeef "image.png": That’s neato
06:05:37FromDiscord<Elegantbeef> Indeed, might be ticking traitor's version now
06:05:44FromDiscord<Elegantbeef> Need to test it further though
06:06:20FromDiscord<Elegantbeef> Tuples really are the king of meta-programming no one told you about
06:07:00FromDiscord<Robyn [She/Her]> How so?
06:08:04FromDiscord<Elegantbeef> You can use them anywhere you want to have either data or types that are user defined but of any length
06:08:19FromDiscord<Elegantbeef> I use them for my GUI library, I use them for my ECS toy, I use them here
06:09:03FromDiscord<Elegantbeef> In the GUI library they allow me to get an ok interface to making GUI trees
06:09:22FromDiscord<Elegantbeef> In the ECS stuffs they allow me to specify components to query in an order invariant manner
06:09:58FromDiscord<Elegantbeef> So I can do `for (hp, vel) in world.query (Health, Velocity)` or `for (vel, hp) in world.query (Velocity, Health)`
06:10:51FromDiscord<Elegantbeef> It has a fair bit of repetition, but for the gui example https://github.com/beef331/gooey/blob/master/example/sdlimpl.nim#L309-L433
06:11:03FromDiscord<Elegantbeef> A DSL might be better, but it's also more tedious to use here atleast
06:13:04FromDiscord<Elegantbeef> Instead of using inheritance I just use generic types and tuples to have GUI trees the "root" node is always a tuple with each field being a child element that then accepts children tuples or elements
06:13:57FromDiscord<Elegantbeef> This also means the entire tree is statically typed and uses 0 dynamic dispatch
06:15:16FromDiscord<Robyn [She/Her]> Ah fair
06:15:36FromDiscord<Elegantbeef> A two word question and a whole lot of rambling
06:19:05FromDiscord<Robyn [She/Her]> It's interesting, dw
06:19:11FromDiscord<Robyn [She/Her]> I'm just a woman of few words :p
06:19:51FromDiscord<Elegantbeef> `Error: 'string' does not implement a procedure named 'doThing' with the prototype 'proc (_: Atom){.nimcall.}'.` is this understandable?
06:23:33FromDiscord<Robyn [She/Her]> I'd say so, yeah, doubt you could do this easily but, say what trait isn't implemented specifically?
06:24:29FromDiscord<Elegantbeef> > Error\: 'string' does not implement a procedure named 'doThing' with the prototype 'proc (\_\: Atom){.nimcall.}'.
06:24:36FromDiscord<Elegantbeef> This shit is done so simply
06:24:52FromDiscord<Elegantbeef> I could use a macro to convert it to `proc doThing(_: string)` but ugh
06:25:20FromDiscord<Elegantbeef> Whoops failed to copy↵> Error\: 'string' failed to match the trait 'MyOtherTrait' it does not implement a procedure named 'doThing' with the prototype 'proc (\_\: Atom){.nimcall.}'.
06:26:48FromDiscord<Robyn [She/Her]> Looks good yeah
06:26:58FromDiscord<Robyn [She/Her]> In reply to @Elegantbeef "I could use a": This would make it better yeah, but eh
06:27:46FromDiscord<Elegantbeef> One downside of the tuple that hits me is it makes it so overloading is not possible
06:27:52FromDiscord<Elegantbeef> You can have one `doThing` and no overloads
06:28:21FromDiscord<Robyn [She/Her]> Ah, couldn't you make a hacky workaround?
06:28:43FromDiscord<Elegantbeef> Yea name one `doThingStr` like we're in C
06:29:44FromDiscord<Elegantbeef> that or use a `tuple((string, proc))`
06:30:25FromDiscord<Elegantbeef> Actually that does not work cause the string would be a value
06:32:52FromDiscord<Elegantbeef> I guess the simplest hack would be to say "use accquote so `\`doThing1\`\`
06:33:07FromDiscord<Elegantbeef> sent a code paste, see https://play.nim-lang.org/#ix=html>
06:47:39FromDiscord<zectbumo> found in source `hasTinyCBackend` 🤭
06:48:10FromDiscord<Elegantbeef> Sorry for your loss
06:48:35FromDiscord<zectbumo> "C" is for compatible, btw
06:49:19FromDiscord<zectbumo> (edit) "btw" => "mind you"
06:50:27FromDiscord<zectbumo> it must be getting late
07:06:03FromDiscord<ringabout> wtf, https://www.virustotal.com/gui/file/4e43bf2af5372aab568d6a056054bf34ff5cf0a6747ab20aa6674a1e00d0fda4?nocache=1 `virustotal` seems to have reported false positives on nightlies since three months ago
07:11:59*PMunch joined #nim
07:45:32FromDiscord<djazz> Why is that though? Nim compiler matching some signature of malware in Nim?
07:49:14*advesperacit joined #nim
07:54:34FromDiscord<Elegantbeef> I mean a hello world written in C compiled with mingw is flagged as malware 😄
08:03:33PMunchThe problem is that we don't trust these results at all any longer. What if someone supply chain attacks the Nim compiler and sneak something funky into it?
08:08:25FromDiscord<Elegantbeef> Right, but the thing is if the heuristics are so bad that even a hello world is flagged as possible malware the entire verification is bad
08:10:27FromDiscord<Elegantbeef> 6/72 vendors on virustotal flagged a simple C hello world compiled with `mingw-gcc -o3 input.c`
08:18:17FromDiscord<Clonkk> Malware developers using Nim + AV Vendor not bothering with doing relevant analysis and just checking NimMain symbols probably
08:18:33FromDiscord<Elegantbeef> Nah I checked that
08:18:46FromDiscord<Elegantbeef> No more malware reported on `NimMain` than a normal program
08:18:55FromDiscord<Clonkk> Hey that's a start
08:19:15FromDiscord<Clonkk> Maybe they check filesystem access  ?
08:20:21*advesperacit quit ()
08:22:32*advesperacit joined #nim
08:22:43FromDiscord<Elegantbeef> Maybe it's Nim's allocator 😄
08:22:48FromDiscord<Elegantbeef> Who knows really
08:23:03FromDiscord<Elegantbeef> I'd need to setup a windows VM to test all this stuff
08:23:07FromDiscord<Elegantbeef> But installing windows is a sin
08:26:43FromDiscord<zectbumo> do we still have a bot that runs nim code?
08:28:34FromDiscord<zectbumo> I think nim r someprog should return the exit code of someprog. it just returns 1 on any nonzero exit code
08:38:07FromDiscord<intellij_gamer> !eval echo("test")
08:38:10NimBottest
08:38:25FromDiscord<intellij_gamer> Neat
08:53:36FromDiscord<Clonkk> It boggles the mind they don't do offer an API to whitelist software vendors
09:07:06FromDiscord<Phil> Likely don't want to pay the money to review that
09:10:49FromDiscord<Phil> Huh, "addChannel" is one of the things that leaks memory.↵Hmmm likely because the destroy proc does not... yeah no idea, I do destroy the stuff I have I think
09:11:19FromDiscord<Phil> I mean, it's a static amount and you need the stuff behind that memory until the application closes down, so not really a leak
09:16:26FromDiscord<Elegantbeef> @Robyn [She/Her] if curious I found a non hacky solution to overloads... more tuples!↵`type MyTrait = tuple[doThing: (proc(_: Atom), proc(_: Atom, bleh: int))]`
09:18:16FromDiscord<mratsim> In reply to @isofruit "Huh, "addChannel" is one": use addresssanitiser
09:51:00FromDiscord<Phil> In reply to @mratsim "use addresssanitiser": Looking over the docs, that's a tool for detecting memory leaks.↵Is the idea to compile the nim code to c and run the tool over that code?
09:51:27FromDiscord<Phil> No wait... it's a clang option ?
09:52:47FromDiscord<Phil> Okay so compile file with special flags and run it to get some output.↵And then basically read the stacktrace which doesn't look like the easiest of reads
10:00:51FromDiscord<mratsim> In reply to @isofruit "No wait... it's a": clang or gcc
10:01:31FromDiscord<mratsim> In reply to @isofruit "Okay so compile file": if you compile with --debugger:native, it will give you where that memory was allocated
10:01:42FromDiscord<mratsim> so it's easy to know the offending data structure
10:02:37FromDiscord<mratsim> see slide 25: https://github.com/mratsim/talks/blob/master/2020-06-20%20-%20NimConf%202020%20-%20Multithreading%2C%20the%20good%2C%20the%20bad%20and%20the%20buggy.pdf
10:03:22FromDiscord<mratsim> and also this for setup: https://github.com/mratsim/constantine/blob/master/constantine.nimble#L650-L662
10:32:04NimEventerNew thread by aiac: Why object variants not support same field name ?, see https://forum.nim-lang.org/t/10833
10:39:18FromDiscord<bigcatnova> https://discord.com/channels/371759389889003530/371759389889003532/1191390891747840070
10:39:52FromDiscord<Elegantbeef> `a[1..^1]`
10:56:58FromDiscord<Phil> ... not gonna lie, with all this stuff I feel like I'm slowly creeping towards a skillset where I unironically could take a look at httpbeast and not start being confused
11:56:16NimEventerNew thread by Angluca: Maybe nappgui is best cross platform gui lib for nim, see https://forum.nim-lang.org/t/10835
12:01:35*azimut joined #nim
12:13:45*jmdaemon quit (Ping timeout: 268 seconds)
12:24:08FromDiscord<nnsee> In reply to @isofruit "Looking over the docs,": asan is well worth familiarizing yourself with, it's incredibly useful
13:33:58NimEventerNew thread by Araq: Sum types, 2024 variant, see https://forum.nim-lang.org/t/10836
13:59:23*fallback quit (Read error: Connection reset by peer)
14:06:54*fallback joined #nim
14:21:54FromDiscord<Robyn [She/Her]> Oh that's what a sun type is
14:21:56FromDiscord<Robyn [She/Her]> Sum
14:21:57FromDiscord<Robyn [She/Her]> Neat
14:36:00*fallback quit (Read error: Connection reset by peer)
14:59:36*khazakar quit (Quit: Connection closed for inactivity)
15:00:27*fallback joined #nim
15:07:44*PMunch quit (Quit: Leaving)
15:15:32*yeti left #nim (\\//_)
15:31:20FromDiscord<mratsim> In reply to @chronos.vitaqua "Oh that's what a": Sun types are blazingly fast
15:32:03FromDiscord<mratsim> In reply to @chronos.vitaqua "Oh that's what a": Sum type and product type are quite interesting concepts.↵↵product types are just tuples btw.
15:55:48*fallback quit (Quit: IRCNow and Forever!)
15:56:36FromDiscord<Robyn [She/Her]> Product type?
15:56:40FromDiscord<Robyn [She/Her]> Aah
15:56:44FromDiscord<Robyn [She/Her]> Okay yeah makes sense
16:08:23*fallback joined #nim
16:27:46FromDiscord<jmgomez> In reply to @mratsim "Sum type and product": inheritance is also a form of a product type
16:31:27FromDiscord<eilerolrikpottestepper> Hi, I am currently making an installer that downloads a .exe 7zip self extracting archive and extracts it. However when run I get "Operation did not complete successfully because the file contains a virus or potentially↵unwanted software.". How can I avoid that false positive?
16:31:54FromDiscord<eilerolrikpottestepper> sent a long message, see <!doctype html>
16:32:37FromDiscord<eilerolrikpottestepper> (edit)
16:33:22FromDiscord<eilerolrikpottestepper> (edit) "long message," => "code paste," | "<!doctype html> <html lang=en> <head> <meta charset=utf-8> <title>&nbsp;</title> </head> <style> body { font-family: monospace; margin: 2em; } </style> <body> <p>ix.io is taking a break &#127867;</p> <img src="/underconstruction.gif" width="200px"> </body> </html>" => "https://play.nim-lang.org/#ix=html>"
16:37:22FromDiscord<michaelb.eth> In reply to @eilerolrikpottestepper "Hi, I am currently": > How can I avoid that false positive.↵↵Unfortunately, such false positives are a recurring/known problem. What antivirus software are you running?
16:41:26FromDiscord<eilerolrikpottestepper> In reply to @michaelb.eth "> How can I": It is just Windows defender
16:44:11FromDiscord<michaelb.eth> Ah, well that is quite annoying. Unfortunately, there’s not much to be done about, other than to try to work with the antivirus vendor, in this case Microsoft, informing them (once again) that software built with Nim is being flagged inappropriately
16:54:30*rockcavera joined #nim
17:13:13FromDiscord<hlsee> Was there any attempt to develop Vulkan wrapper for NIm?
17:15:25FromDiscord<hlsee> My apologies, I found it
17:21:19NimEventerNew thread by mantielero: Karax - embedding stylesheet, see https://forum.nim-lang.org/t/10838
17:22:39FromDiscord<asviest> In reply to @hlsee "Was there any attempt": they are all not perfect, also Nim have not perfect wgpu wrapper (only wgpu-native and emscripten)↵https://github.com/ASVIEST/nimgpu↵it’s not developing because I don’t have free time
17:22:57FromDiscord<Phil> asan output is... a thing
17:27:33FromDiscord<hlsee> Ah I see, thank you for letting me know↵(@asviest)
17:30:46FromDiscord<Phil> Okay, first things first, @nnsee address sanitizer question:↵Are you supposed to run that thing on the main file of your library or an example that uses the library to see about memory leaks etc.?
17:32:00FromDiscord<Phil> Because the workflow according to https://github.com/google/sanitizers/wiki/AddressSanitizer#using-addresssanitizer that I found was:↵1) Compile the lib using the flags↵2) ... execute the resulting .out file (?!)
17:32:12FromDiscord<Phil> (edit) "(?!)" => "(?!)↵3) Read the text that should be printing out"
17:32:36*rockcavera quit (Read error: Connection reset by peer)
17:32:54*rockcavera joined #nim
17:32:54*rockcavera quit (Changing host)
17:32:54*rockcavera joined #nim
17:40:11FromDiscord<eilerolrikpottestepper> In reply to @michaelb.eth "Ah, well that is": Is it a specific problem with nim?
17:42:23FromDiscord<eilerolrikpottestepper> It is also a program I need to share with not so tech savvy people so adding exclusions is sadly also not an option.
17:44:39FromDiscord<Phil> sent a long message, see <!doctype html>
17:45:49FromDiscord<Phil> sent a long message, see <!doctype html>
17:49:54*rockcavera quit (Remote host closed the connection)
17:51:25FromDiscord<djazz> hmm, seems like you can't set --opt:size from config.nims? only command line?
17:52:21FromDiscord<djazz> something seems to override it
17:52:29FromDiscord<djazz> did a quick test, it worked
17:52:43FromDiscord<Robyn [She/Her]> So it does work from the config.nims?
17:53:03FromDiscord<djazz> yeah, must be some other flag or option making it choose speed
17:53:06FromDiscord<Robyn [She/Her]> Ah
17:53:24FromDiscord<Robyn [She/Her]> Maybe -d:danger/-d:release?
17:53:38FromDiscord<djazz> it was -d:release
17:53:57FromDiscord<djazz> order matters! hah
17:54:53FromDiscord<djazz> i moved it after release in the nims file, works nowq
17:56:23FromDiscord<Robyn [She/Her]> Nice!
18:01:16*rockcavera joined #nim
18:04:44FromDiscord<Phil> I take it back, I think you're supposed to compile and execute the program.↵But... if I run ↵`nim r --cc:clang -d:release --debugger:native --passC:-fsanitize=address --passL:-fsanitize=address examples/ex_stdinput.nim`↵and finish executing my binary... well nothing gets printed. Is that... good?
18:06:10Amun-Ra--passc=-fsanitize=address
18:06:50FromDiscord<Phil> Still no text output after the binary runs
18:07:28FromDiscord<Phil> `nim r --cc:clang -d:release --debugger:native --passc:-fsanitize=address --passl:-fsanitize=address examples/ex_stdinput.nim`
18:08:03FromDiscord<Phil> So... no obvious memory errors that asan could find (?)
18:08:57FromDiscord<Phil> Ahhhh -d:useMalloc
18:29:25FromDiscord<Phil> ... is there a way to check if there are async events to poll for?
18:35:45FromDiscord<griffith1deadly> sent a code paste, see https://play.nim-lang.org/#ix=html>
18:36:21FromDiscord<Phil> Failed to find that one, thanks, that was the solution!
18:41:50FromDiscord<Phil> That got rid of one of my leaks (I registered an eternal sleep timer to avoid that if check but it's not like that if-check is that slow)
18:43:11FromDiscord<Phil> sent a code paste, see https://play.nim-lang.org/#ix=html>
18:45:07FromDiscord<Phil> sent a code paste, see https://play.nim-lang.org/#ix=html>
18:45:40FromDiscord<Phil> I gues the call to `runServerLoop` somehow leads to instantiation of a global dispatcher and that leads to a memory leak?
19:05:18NimEventerNew thread by Isofruit: Understanding an address sanitizer message for a memory leak caused by global dispatcher (?), see https://forum.nim-lang.org/t/10839
19:15:10FromDiscord<Phil> Even though it's 5 leaks, none of them are really in the scope of my own code, it's all implicit calls to "getGlobalDispatcher" that somehow leak and that I can't really do anything about
19:15:16FromDiscord<Phil> Unless I rip out async support I guess
19:21:53FromDiscord<michaelb.eth> if you use chronos instead, is there the same leak?
19:23:33FromDiscord<Phil> That should be as simple as replacing `import std/asyncdispatch` with `import chronos`, right?
19:24:04FromDiscord<saint.___.> @demotomohiro Did you ever have a sort of blog post or something about nim macros
19:24:09FromDiscord<saint.___.> Like an easy way to get started with them?
19:24:18FromDiscord<saint.___.> Someone posted a site here about that but I forgot who and I can't find the link
19:24:46FromDiscord<Phil> In reply to @saint.___. "<@288750616510201856> Did you ever": https://dev.to/beef331/demystification-of-macros-in-nim-13n8
19:24:58FromDiscord<michaelb.eth> In reply to @isofruit "That should be as": for the most part, I think
19:25:18FromDiscord<Phil> Also the following 2 wisdoms:↵1) Everything is a NimNode pattern. To replicate a piece of code, replicate its NimNode pattern↵2) To look at a NimNode pattern, use `dumpTree` / `dumpAstGen`
19:25:30FromDiscord<saint.___.> In reply to @isofruit "https://dev.to/beef331/demystification-of-macros-in": I don't think this was it but looks good thanks
19:26:13FromDiscord<Phil> In reply to @michaelb.eth "for the most part,": ... that doesn't even compile? erm... confusion↵`/home/philipp/.nimble/pkgs/chronos-3.0.11/chronos/transports/datagram.nim(779, 5) Error: undeclared identifier: 'shallowCopy'`↵For reference I myself don't use that anywhere
19:26:19FromDiscord<Phil> (edit) "use" => "call" | "callthat ... anywhere" added "proc"
19:26:23FromDiscord<saint.___.> @Phil Also in general if I want to make a small lang parser in nim, should I do it with macros or something else
19:26:39FromDiscord<saint.___.> Something very basic
19:26:53FromDiscord<Phil> In reply to @saint.___. "<@180601887916163073> Also in general": Like you want the user to write some gibberish and transform that into nim code?
19:27:59FromDiscord<michaelb.eth> In reply to @isofruit "... that doesn't even": hmm, what if you delete currently installed chronos in pkgs2 and install chronos#head
19:28:36FromDiscord<saint.___.> In reply to @isofruit "Like you want the": Nah I want to design my own very simple DSL for something
19:29:01FromDiscord<Phil> In reply to @michaelb.eth "hmm, what if you": Turns out chronos does not have "hasPendingOperations"
19:29:11FromDiscord<Phil> Time to reimplement that myself
19:30:39FromDiscord<Phil> In reply to @saint.___. "Nah I want to": Okay I need a bit of a description of your vision what you mean by "small lang parser"↵Like user writes stuff into a file, you read that string in, parse that and execute something? Or what?
19:31:05FromDiscord<saint.___.> In reply to @isofruit "Okay I need a": Yeah that would be fine
19:31:20FromDiscord<saint.___.> Like a user types in some sort of string and then it executes some code based on that
19:31:33FromDiscord<saint.___.> Like say the user types in "4p,3t,p" or something
19:31:37FromDiscord<saint.___.> And then it generates some file based on taht
19:31:39FromDiscord<Phil> Then why use macros or templates at all?↵You could parse strings.↵The draw to macros is that you can write that DSL directly inside the nim-file as nim-like-code that you transform
19:31:55FromDiscord<saint.___.> Right
19:32:11FromDiscord<saint.___.> Do u think npeg would work
19:32:22FromDiscord<Phil> never used npeg, that's outside my area of expertise
19:32:30FromDiscord<saint.___.> I'm sort of familiar with npeg
19:32:41FromDiscord<saint.___.> What would the other approach be
19:32:46FromDiscord<Phil> Generally language parsing kinda is generally, I know how to use and write macros at this point ^^'
19:33:00FromDiscord<Phil> (edit) "point" => "point, that's kinda it"
19:33:02FromDiscord<saint.___.> Gotcha
19:33:10FromDiscord<saint.___.> I think I saw some videos on writing an interpreter in nim
19:33:13FromDiscord<saint.___.> Maybe I should check that out
19:34:15FromDiscord<user2m> sent a code paste, see https://play.nim-lang.org/#ix=html>
19:38:32FromDiscord<michaelb.eth> why not just loop over the seq items/pairs rather than using indexed access?
19:39:59FromDiscord<Phil> In reply to @michaelb.eth "hmm, what if you": Okay so on the upside, poll() on chronos does not raise an exception.↵On the downside, poll() on chronos never ends and there's no easy way to check whether there is any work to be done, so this is a tough one to even get to start working
19:41:01FromDiscord<michaelb.eth> ah, I see what you mean
19:49:55FromDiscord<Phil> In reply to @michaelb.eth "ah, I see what": Also can't replicate the way asyncdispatch does it because apparently there's always at least 1 callback in chronos
19:50:04FromDiscord<Phil> And there's no "selector" field
19:50:43FromDiscord<Phil> Also not sure how "idlers" and "ticks" play into determining whether there is work or not
20:16:51FromDiscord<pengwyns> Maybe its the finish.exe files that are causing the AV detections...
20:23:53*flouer_ quit (Ping timeout: 256 seconds)
20:24:19*flouer_ joined #nim
20:26:52FromDiscord<Phil> In reply to @michaelb.eth "ah, I see what": Sidenote and FYI - the current version I'm working on is the branch "add-loonyqueue-support".↵Or rather, I try. trying to grok wth is going on with the various messages adress-sanitizer does spit out is confusing as heck
20:27:09FromDiscord<Phil> (edit) "In reply to @michaelb.eth "ah, I see what": Sidenote and FYI - the current version I'm working on is the branch "add-loonyqueue-support".↵Or rather, I try. trying to grok wth is going on with the various messages adress-sanitizer does spit out is confusing as heck ... " added "and slows me down to basically nothing"
20:29:02FromDiscord<Phil> What's mildly weird is when I look at it through heaptrack rather than address sanitizers I get it stating that "initLogRecord" from chronicles leaks 1KB
20:29:44FromDiscord<Phil> https://media.discordapp.net/attachments/371759389889003532/1191840774434861097/image.png?ex=65a6e737&is=65947237&hm=bd8de16a9ab34086a0e2a0a2033278dc6284862eecfb62cb8b7188ae89d03f0a&
20:30:04FromDiscord<Phil> Honestly I keep getting the impression that "leak-free" is basically impossible because there's so much small crap going on
20:30:15FromDiscord<Phil> (edit) "Honestly I keep getting the impression that "leak-free" is basically impossible because there's so much small crap going on ... " added "that I have no influence over"
20:32:45FromDiscord<Phil> The memory leaks in there are basically:↵- Logging in chronicles (initLogRecord and flushRecord)↵- readLine from nim (which calls fget)
20:35:51FromDiscord<pengwyns> Nim (1.16.16 to 2.0.2) should now no longer be detected by Fortinet, AhnLab-V3 and G-Data. Malwarebytes immediately disregarded my email since I am not a customer of theirs, which is annoying.
20:36:57FromDiscord<Phil> In reply to @pengwyns "Nim (1.16.16 to 2.0.2)": Neato!
20:37:18FromDiscord<Phil> Thanks for making the submission, fingers crossed it suffices in their datasets to not instaflag corresponding binaries
20:37:56FromDiscord<pengwyns> Unfortunately only Fortinet said they would re-evaluate what specifically caused Nim to set off their engine. The others might just be whitelisting Nim.
20:38:40FromDiscord<pengwyns> Still, I hope that with enough feedback, they will all stop flagging this weird bit pattern.
20:44:55*xet7 joined #nim
20:47:27*flouer joined #nim
20:49:56*flouer_ quit (Ping timeout: 245 seconds)
21:03:57FromDiscord<Elegantbeef> image.png https://media.discordapp.net/attachments/371759389889003532/1191849385370329088/image.png?ex=65a6ef3c&is=65947a3c&hm=72eeaf6297ec06295665db4116aa906dbaa154f7e12659894b0eef4132dee56e&
21:04:07FromDiscord<Elegantbeef> Hell yea got overloading working with this trait-ish system
21:09:42FromDiscord<Phil> In reply to @Elegantbeef "image.png": Congratz!
21:17:48FromDiscord<michaelb.eth> nice!
21:18:06FromDiscord<Phil> Question here into the round as well:↵> Does anybody actually use address-sanitizers or valgrind or heaptrack and eradicates potential memory leaks to the point that nothing shows up while they run?
21:24:11FromDiscord<leorize> I always do?
21:24:47FromDiscord<Elegantbeef> Phil really asking "Do people use screwdrivers to drive screws?"
21:26:06FromDiscord<Phil> The amount of non-actionable crap I get out of it just makes it difficult to believe
21:26:30FromDiscord<leorize> you don't have good traces it seems
21:27:16FromDiscord<Phil> you think compiling and running from distrobox fedora will stop it from claiming this is all leakage from std/asyncdispatch?
21:28:04FromDiscord<Elegantbeef> Did you call `GcRunOrc` explicitly just to check your arse?
21:28:47FromDiscord<Elegantbeef> I'm tired and that's supposed to be cover
21:28:49FromDiscord<Elegantbeef> But alas
21:29:28FromDiscord<leorize> for example\: this one looks like a false-positive↵(@Phil)
21:29:34FromDiscord<Phil> sent a code paste, see https://play.nim-lang.org/#ix=html>
21:29:57FromDiscord<leorize> the pointer that is returned by `localtime()` is in static storage, so it should've been reachable and nt leaked
21:30:23FromDiscord<Phil> In reply to @leorize "for example\: this one": It is exactly those kinds of false positives that just make me doubt everything
21:32:16FromDiscord<leorize> address sanitizer is a lot better at this than heaptrack, though
21:33:45FromDiscord<leorize> for this stuff you usually just suppress them on a case-by-case basis
21:33:58FromDiscord<leorize> typically though, you shouldn't have to
21:34:16FromDiscord<Phil> sent a long message, see <!doctype html>
21:34:48FromDiscord<Phil> Or do I just straight up do `distrobox fedora`, from there install clang a second time from dnf (since I already have it from arch) and try that?
21:34:57FromDiscord<leorize> sure
21:35:33FromDiscord<leorize> you can spin up distrobox directly, it has access to your hoome
21:35:56FromDiscord<Phil> I can't run the nim command from there, it does not compile, I assume because some kind of binary or lib somewhere is in an unexpected version
21:36:04FromDiscord<leorize> why are you using arc, though?
21:36:11FromDiscord<leorize> then rebootstrap nim?
21:36:41FromDiscord<Phil> mratsim recommendation as this is how he uses fsanitize in nim and that is my only reference point for using it in nim
21:36:54FromDiscord<leorize> fwiw with address sanitizer, indirect leaks but no direct leaks tends to be a cycle
21:37:14FromDiscord<leorize> my recommendation is to test it the way you use it
21:37:19FromDiscord<leorize> doesn't make sense otherwise
21:37:57FromDiscord<leorize> you should use orc, just in case it's a cycle
21:38:19FromDiscord<Phil> Orc comes on arch with the same 5 leaks, but now one of the stacktraces has to do with the orc cycle detector
21:39:11FromDiscord<leorize> maybe we are talking about different leaks, let me check discord
21:39:24FromDiscord<Phil> I never posted all of them, one sec
21:40:27FromDiscord<Phil> That's without orc https://media.discordapp.net/attachments/371759389889003532/1191858572661891082/message.txt?ex=65a6f7cb&is=659482cb&hm=0b11ecc531424334f9cb8be7676a5ca71883f0661903cf9c18aa66048feb0a52&
21:40:48FromDiscord<Phil> That's with ORC https://media.discordapp.net/attachments/371759389889003532/1191858660519989298/message.txt?ex=65a6f7e0&is=659482e0&hm=1d1915a14037c6198408054bbde28766deb009aa18ff308e7d07ac73dde98435&
21:41:17FromDiscord<leorize> do you mind linking your code here?
21:43:09FromDiscord<Phil> sent a long message, see <!doctype html>
21:46:27FromDiscord<Phil> erm...
21:46:45FromDiscord<leorize> ok, try compiling with this added `--passC:-fno-omit-frame-pointer` and `--passC:-mno-omit-leaf-frame-pointer`
21:47:08FromDiscord<leorize> I see that your direct leak comes from creating a hub
21:47:28FromDiscord<leorize> but I'm not seeing Nim's main proc
21:47:44FromDiscord<Phil> Okay so I tried this again with `distrobox enter fedora` , inside of which I ran `sudo dnf install clang` which finally enabled me to compile again in that distrobox.↵Ran the same command and get less information now. Likely me using the tooling wrong https://media.discordapp.net/attachments/371759389889003532/1191860404335411300/message.txt?ex=65a6f980&is=65948480&hm=72031e028e12eb153166a8dd13594cf746e0c398942e2d375acd10d61fb45c4f&
21:49:08FromDiscord<leorize> do a `sudo dnf install llvm` and re-run your code
21:49:32FromDiscord<leorize> without `llvm-symbolizer` in `PATH` address sanitizer won't be able to turn offsets into symbols
21:50:17FromDiscord<Phil> that grants me the exact same looking output as I had on arch
21:50:42FromDiscord<Phil> sent a code paste, see https://play.nim-lang.org/#ix=html>
21:52:12FromDiscord<Phil> Do you see differences? Or do you just use valgrind and kcachegrind and thus see different things?
21:52:15FromDiscord<Phil> look at
21:52:37FromDiscord<leorize> typically I use valgrind then move to asan to debug since its faster
21:53:04FromDiscord<leorize> (more specifically it's because disruptek's balls doesn't do asan)
21:53:31FromDiscord<Phil> Is the ticket to not have such a hassle-full experience with it all to just use balls?
21:54:23FromDiscord<leorize> it won't help you debug a leak, but it will help prevent the next one
21:56:24FromDiscord<Phil> Because parsing the tool output is still cryptic to me and the false flags left and right are starting to grate
21:56:30FromDiscord<Phil> (edit) "Because parsing the ... tooloutputs" added "various" | "output" => "outputs"
21:56:32FromDiscord<leorize> if the leak is reachable then it shouldn't error out like that
21:56:39FromDiscord<leorize> how many threads did you use?
21:57:16FromDiscord<Phil> The example spawns a second server that functions as backend, so 2
21:57:54FromDiscord<Phil> the main thread and the one in which the event-loop for `SERVER_THREAD` is running (defined in `threadButler.nim runServerLoop)
21:58:00FromDiscord<Phil> (edit) "runServerLoop)" => "runServerLoop`)"
21:58:14FromDiscord<Phil> (edit) "The example spawns a second ... server" added "thread with a"
21:58:48FromDiscord<leorize> then the traces doesn't add up
21:59:33FromDiscord<leorize> you have two indirect leaks from calling `getGlobalDispatcher`, which is probably from initializing it
21:59:51FromDiscord<Phil> Which nim does and nim manages so I assume those to be entirely false positives
22:00:05FromDiscord<leorize> but you also have one direct leak from an another get global dispatcher -\> newObj trace
22:01:05FromDiscord<leorize> I figured it out
22:01:27FromDiscord<leorize> it's a leak alright
22:01:45FromDiscord<Phil> sent a code paste, see https://play.nim-lang.org/#ix=html>
22:01:51FromDiscord<leorize> the leak comes from your butler thread
22:01:58FromDiscord<leorize> but it's not your fault
22:02:12FromDiscord<leorize> when that thread is destroyed, it did not destroy thread-local resources
22:02:29FromDiscord<Phil> ... what resources does that thread even have?
22:02:33FromDiscord<leorize> this is a known nim thing where globals are never destroyed
22:02:37FromDiscord<leorize> the event queue, it's per-thread
22:03:04FromDiscord<Phil> But... wait, because I use asyncdispatch once in one thread it now has a global dispatcher on every thread?
22:03:46FromDiscord<leorize> there's a dispatcher in any thread that you used asyncdispatch on
22:04:01FromDiscord<leorize> your indirect leaks are all from the same threda
22:04:16FromDiscord<Phil> Ohhhh right, the while-loop is the event-loop on the backend thread
22:04:23FromDiscord<Phil> Which is the one that leaks
22:04:29FromDiscord<michaelb.eth> each thread has to have its own event loop ("dispatcher"), otherwise it couldn't work
22:04:47FromDiscord<Phil> ... do you just disable reports of leaks about globals ?
22:05:12FromDiscord<leorize> maybe, but it does mean that you will always leak if you use short-lived threads in nim
22:05:20FromDiscord<leorize> which luckily you don't do
22:05:33FromDiscord<Phil> I honestly know of no approach that does
22:05:52FromDiscord<Phil> even the threadpool approaches are a fixed size threadpool, nobody spawns thread willy nilly
22:06:24FromDiscord<Phil> At least from the projects I've seen. It's all about spawning tasks on a fixed-size threadpool
22:06:46FromDiscord<leorize> are the threads torn down when not under pressure?
22:07:32FromDiscord<Phil> No, they just go to sleep for n miliseconds and run the loop again, which polls the message queue, finds nothing and either has an async-event (then it polls) or goes back to sleep
22:07:53FromDiscord<leorize> i meant the threadpools
22:08:09FromDiscord<Phil> I don't think so, let me triple check the status docs again
22:08:32FromDiscord<Phil> Note that this example does not have a threadpool, I ripped those out, users can create their own if they need them
22:08:51FromDiscord<leorize> but anyhow, globals in threads does look like a leaky faucet
22:08:53FromDiscord<Phil> > Resource-efficient. Threads spindown to save power, low memory use.↵Spin down sounds like "still exists but sleeping"
22:09:35FromDiscord<Phil> Source: https://github.com/status-im/nim-taskpools#taskpools
22:09:47FromDiscord<leorize> it's something that should be addressed by the language at least
22:10:21FromDiscord<Phil> Okay, first things first, I'm writing myself an obsidian note
22:10:32FromDiscord<leorize> you can do a suppression for getGlobalDispatcher to ignore those leaks
22:10:51FromDiscord<Phil> And while I may have sounded grumpy, thank you a ton.↵This was basically the first "win" I had when using these tools... ever.↵And I did at least half a dozen stabs at it
22:14:27FromDiscord<eilerolrikpottestepper> sent a code paste, see https://play.nim-lang.org/#ix=html>
22:14:36FromDiscord<eilerolrikpottestepper> (edit)
22:15:07FromDiscord<eilerolrikpottestepper> sent a code paste, see https://play.nim-lang.org/#ix=html>
22:15:14FromDiscord<Phil> Do you have a small code snippet I can plonk into a nim file and compile?
22:15:15FromDiscord<eilerolrikpottestepper> What am I doing wrong?
22:15:31FromDiscord<leorize> you should consider using this instead to avoid FFI\: https://nimble.directory/pkg/zippy
22:15:34FromDiscord<eilerolrikpottestepper> sent a long message, see <!doctype html>
22:15:55FromDiscord<eilerolrikpottestepper> sent a code paste, see https://play.nim-lang.org/#ix=html>
22:16:19FromDiscord<eilerolrikpottestepper> In reply to @leorize "you should consider using": FFI?
22:16:28FromDiscord<Phil> "Foreign Function Interface"
22:16:40FromDiscord<leorize> yea it does take some experience to start interpreting these things↵(@Phil)
22:17:01FromDiscord<Phil> What he means is that zipfiles does not implement how to unzip itself, it calls to a C-library in the background using "FFI"
22:18:12FromDiscord<Phil> sent a long message, see <!doctype html>
22:19:32FromDiscord<Elegantbeef> Well 'a' is not always true
22:19:41FromDiscord<Elegantbeef> Some C libraries are shipped inside Nim packages
22:19:57FromDiscord<eilerolrikpottestepper> sent a code paste, see https://play.nim-lang.org/#ix=html>
22:20:00FromDiscord<Elegantbeef> Also you're unlikely to be able to use zippy at CT, but idk
22:20:30FromDiscord<Phil> sent a code paste, see https://play.nim-lang.org/#ix=html>
22:20:53FromDiscord<eilerolrikpottestepper> Damn my webserver is not working
22:21:08FromDiscord<Phil> That is actually a hilarious way to find that one out
22:21:55FromDiscord<eilerolrikpottestepper> Does http://corvina.adora.dk:8054/liveries/Liveries.exe work? (just a self extracting archive from 7zip)
22:22:37FromDiscord<Phil> Literally the only reason I click on that exe link is because I'm on Linux so that ain't gonna run without wine
22:22:45FromDiscord<Phil> But yes, it does start downloading
22:22:53FromDiscord<eilerolrikpottestepper> Nice
22:23:38FromDiscord<Phil> In reply to @leorize "yea it does take": The usage of asan does mandate using `-d:useMalloc` right?
22:23:55FromDiscord<Phil> and --debugger:native I assume
22:24:21FromDiscord<leorize> only useMalloc is required
22:24:42FromDiscord<Phil> Ah, --debugger:native is only for valgrind stuff?
22:24:45FromDiscord<leorize> as long as at least frame pointers enabled, asan will work
22:25:04FromDiscord<leorize> and valgrind too tbf
22:25:33FromDiscord<leorize> debug info allows for dwarf-based unwinding by those tools which works in most case
22:26:12FromDiscord<leorize> but FPs are faster, esp. when you do call-graph profiling using `perf` or something
22:27:18FromDiscord<Phil> dwarf based unwinding is a way to generate a stacktrace?
22:27:39FromDiscord<Phil> of whatever those traces are called that get printed somewhere eventually
22:27:52FromDiscord<leorize> yea
22:28:17FromDiscord<leorize> you need to figure out where the stackframes are if you want to walk backwards and figure out which functions are in play
22:28:40FromDiscord<eilerolrikpottestepper> Is all the bots on the server
22:29:00FromDiscord<eilerolrikpottestepper> Is all the bots on the server discord-matrix bridges?
22:29:29FromDiscord<Phil (he/him)> Dang, they wisened up, I wanted to have some fun jumping to the fractal client \:-D
22:29:53FromDiscord<leorize> you should just have generated an answer using chatgpt to fool them
22:29:57FromDiscord<Phil> Most of them are matrix folks. We also have IRC
22:30:00FromDiscord<Phil> (edit) "Most of them are matrix folks. We also have IRC ... " added "bridged"
22:30:11FromDiscord<eilerolrikpottestepper> ok ty
22:33:57FromDiscord<Phil> In reply to @leorize "you can do a": Question, are thread-local variables (which kinda are also globals) also not memory collected?
22:34:28FromDiscord<leorize> yes
22:34:33FromDiscord<leorize> unfortunately
22:34:49FromDiscord<leorize> I don't know if anyone did a bug report for that
22:35:12FromDiscord<Phil> Jotting that down for now in my obsidian notes, might do a follow up in #internals which may result in a github issue
22:35:46FromDiscord<Phil> Those notes literally function as my second brain. Once it's in there the likelihood of me forgetting just drops by 80%
22:35:52FromDiscord<Phil> And for the other 20% I can reference them
22:36:30FromDiscord<leorize> now you have a solid base to interpret traces
22:36:52FromDiscord<leorize> asan have very low FP rate in my experience
22:37:10FromDiscord<Phil> Not fully, still need to google first how to ignore sth
22:37:10FromDiscord<leorize> I never got an FP from asan myself
22:37:36FromDiscord<leorize> https://github.com/google/sanitizers/wiki/AddressSanitizerLeakSanitizer#suppressions
22:38:17FromDiscord<Phil> The way to go here is the blacklist txt right?
22:38:37FromDiscord<leorize> yea, you should bookmark that wiki too
22:39:03FromDiscord<Phil> Way ahead https://media.discordapp.net/attachments/371759389889003532/1191873317087486110/image.png?ex=65a70586&is=65949086&hm=a92e73b8258e663c6a399bb3844a27a424aacc3331277ed55eae74cca367daab&
22:39:15FromDiscord<Phil> Still writing that out
22:39:24FromDiscord<Phil> Adding the link was basically just step 1
22:39:32FromDiscord<Phil> (edit) "Adding the link was basically just step 1 ... " added "of writing the section"
22:39:34FromDiscord<leorize> btw globals won't leak as far as asan is concerned
22:39:45FromDiscord<saint.___.> What editor is that @Phil ?
22:39:49FromDiscord<Phil> Obsidian
22:39:58FromDiscord<saint.___.> Gotcha
22:39:59FromDiscord<Phil> Specifically a markdown editor
22:40:03FromDiscord<leorize> because you could still "reach" those variables if your program is still running
22:40:04FromDiscord<saint.___.> Ya I use it too
22:40:10FromDiscord<saint.___.> Haven't seen the line numbers before though
22:40:49FromDiscord<Phil> In reply to @leorize "because you could still": Ahhh check
22:40:50FromDiscord<leorize> thread-local vars are leaky because once the thread is down you cannot access them anymore
22:42:12FromDiscord<Phil> Check, expanded the section
22:43:00FromDiscord<leorize> some other useful sanitizers to use are\: `undefined` and `thread`
22:43:05FromDiscord<leorize> the former deals with undefined behaviors in C
22:43:13FromDiscord<leorize> the latter is about data races
22:43:39FromDiscord<leorize> you can use multiple sanitizers at once by separating them using commas
22:46:24FromDiscord<Phil> I'll set up a note for those but likely not play around with that for now, it's been a 5h marathon post work and I'm dead
22:46:36FromDiscord<leorize> once you're out of leaks, use `thread` sanitizers to catch unguarded memory read/writes
22:46:39FromDiscord<leorize> or like, just use it whenever you have weird data corruption issues with threads
22:46:39FromDiscord<Phil> Just want to make sure I keep what I learned today
22:51:30FromDiscord<Phil> blacklist question
22:53:25*Guest79 joined #nim
22:53:27FromDiscord<Phil> sent a code paste, see https://play.nim-lang.org/#ix=html>
22:54:16FromDiscord<leorize> it won't because you're using the wrong syntax
22:54:33FromDiscord<leorize> ah wait you're not using suppression list
22:54:50FromDiscord<Phil> sent a code paste, see https://play.nim-lang.org/#ix=html>
22:55:03FromDiscord<Elegantbeef> sent a code paste, see https://play.nim-lang.org/#ix=html>
22:55:49*Guest79 quit (Client Quit)
22:55:49FromDiscord<Phil> sent a code paste, see https://play.nim-lang.org/#ix=html>
22:55:53FromDiscord<Phil> May cause confusion
22:56:11FromDiscord<Elegantbeef> Oh that was from when I just lazily made the error message
22:56:49FromDiscord<Phil> sent a long message, see <!doctype html>
22:56:56FromDiscord<Elegantbeef> Previously I did not report each on a line so there were like `doThing: (proc(...), proc(...))`
22:56:56FromDiscord<Phil> Ah, check
22:57:10FromDiscord<Phil> I really like the error message, just to reaffirm that
22:57:22FromDiscord<Phil> I love being told explicitly where I am dumb!
22:57:28FromDiscord<Phil> Allows me to improve!
22:57:40FromDiscord<Elegantbeef> I really like that hooks work, user defined types work, builtin types work
22:57:59FromDiscord<Elegantbeef> It's the runtime component to what Rust's Traits wish they could be
22:58:33FromDiscord<Phil> You've been giving me literally 2 libraries that I need to take for a spin sooner or later now beef
22:58:55FromDiscord<Phil> I need more time. Like a solid half year off work or sth
22:58:58FromDiscord<Elegantbeef> Might make a `StaticTrait[(X, Y, Z), Trait)` in the future that emits an object variant and all the proc calls, but that's iffy
23:00:19FromDiscord<leorize> i'm not sure why it doesn't work then. You can try it with a simple C program to tune it↵(@Phil)
23:00:37FromDiscord<Elegantbeef> So like you could do `StaticTrait[(Square, Rectangle, Circle), tuple[area: proc(_: Atom): int]]` though with the prospect of new case objects that is pretty bleh
23:08:16FromDiscord<Phil> In reply to @leorize "i'm not sure why": Saved myself the link to this site: https://clang.llvm.org/docs/AddressSanitizer.html#suppressing-errors-in-recompiled-code-ignorelist↵Far more examples
23:12:36FromDiscord<Phil> No luck yet though =/
23:12:44FromDiscord<Phil> I'll need to try around more tomorrow
23:54:10FromDiscord<ooogaboga> 955106.jpg https://media.discordapp.net/attachments/371759389889003532/1191892221247627415/955106.jpg?ex=65a71721&is=6594a221&hm=00e15ed7c3f033c9b28247291f1e2660b73c2c5b5c38a8c763937d73a94aaedb&
23:54:12FromDiscord<ooogaboga> 1000006280.mp4 https://media.discordapp.net/attachments/371759389889003532/1191892230294749264/1000006280.mp4?ex=65a71723&is=6594a223&hm=3b3b64019e5b647f8479ac87abc9e3853665574a2a65f997c3c72a711455044c&
23:54:21FromDiscord<ooogaboga> GMP\_U2F2ZUdIMDE=-1704208678419.gif https://media.discordapp.net/attachments/371759389889003532/1191892268127375472/GMP_U2F2ZUdIMDE-1704208678419.gif?ex=65a7172d&is=6594a22d&hm=12cc5d3fedbaa2c7ed7f5af009e605ecbf6a35dfb06c78e1f3b86143a2eaccb7&
23:54:30FromDiscord<ooogaboga> ima10499742337989439933-1704178625978.jpeg https://media.discordapp.net/attachments/371759389889003532/1191892303984464032/ima10499742337989439933-1704178625978.jpeg?ex=65a71735&is=6594a235&hm=144c996c45d45f7228187bdcb201dcba56178170cdccff21a68a09da45659cb6&
23:54:39FromDiscord<ooogaboga> IMG\_9776-1704178610271.jpeg https://media.discordapp.net/attachments/371759389889003532/1191892343800995911/IMG_9776-1704178610271.jpeg?ex=65a7173f&is=6594a23f&hm=2598375d2a530d7bdc09126e6f798d2c10629c82911416220622f5d16fe80672&
23:54:45FromDiscord<ooogaboga> photo\_2022-09-19\_18-10-15.jpg https://media.discordapp.net/attachments/371759389889003532/1191892367414935573/photo_2022-09-19_18-10-15.jpg?ex=65a71744&is=6594a244&hm=6dcfc326d1f9c6bf33e61288ce9041bd159908a10b10c1a34c8948cb105c50b3&
23:56:56FromDiscord<intellij_gamer> <@&371760044473319454>
23:57:54*flouer quit (Remote host closed the connection)
23:58:07*flouer_ joined #nim