<< 27-02-2024 >>

00:27:21*proaxis joined #nim
00:58:19*rockcavera quit (Remote host closed the connection)
01:52:05FromDiscord<girvo> sent a long message, see https://pasty.ee/UAmlmLxTqdKs
01:56:46FromDiscord<girvo> I was trying to use `winim/clr` to work with it, but I can't create a `System.Management.EventArrivedEventHandler` it seems. I
02:04:26*Mister_Magister quit (Ping timeout: 252 seconds)
02:05:54FromDiscord<Elegantbeef> @girvo Generally the solution is the good ol' `proc(..., userData: pointer) {.cdecl.}` callback πŸ˜„
02:07:08FromDiscord<girvo> Yeah thats what I was thinking haha
02:07:29FromDiscord<girvo> Though I managed to get it to work by `compile()`-ing some C# via winim/clr to work around the difficulties I was having setting callbacks
02:07:31FromDiscord<girvo> sent a long message, see https://pasty.ee/nWfQQbshvHPD
02:07:40FromDiscord<girvo> That actually worked, interestingly!
02:08:57FromDiscord<girvo> https://pastebin.com/TFUK5jBT
02:09:07*Mister_Magister joined #nim
02:12:47FromDiscord<girvo> Now to work out how to debounce the handler
02:26:26FromDiscord<girvo> Oh lmao. WMI is just polling it based on the query anyway. So this is all useless, I might as well just call the `usbipd.exe state` directly in a 1 second loop
02:29:28*def- quit (Quit: -)
02:33:23*def- joined #nim
02:36:27*def- quit (Client Quit)
02:44:45*krux02 quit (Remote host closed the connection)
02:44:56NimEventerNew Nimble package! simplestatsdclient - Pure nim interface library to send data to any StatsD compatible daemon, see https://github.com/Q-Master/statsdclient.nim
02:52:17*smlckz joined #nim
02:53:06smlckzHi. How to cast seq[byte] to openArray[char] or equivalent?
02:53:33FromDiscord<Elegantbeef> You don't it already is convertible to it
02:53:43FromDiscord<Elegantbeef> Oh wait you said `openArray[char]`
02:54:12FromDiscord<Elegantbeef> I misread you can do `cast[seq[char]](myByteSeq)`
02:54:28FromDiscord<Elegantbeef> There sadly is not a safe operation for byte -\> char openArray
02:55:10*def- joined #nim
02:58:29*def- quit (Client Quit)
02:59:59*def- joined #nim
03:02:48FromDiscord<girvo> If I'm doing a desktop GUI app, with wNim, and it uses threadpool for spawning worker threads, but threadpool is deprecated: what should I be using instead? weave? taskpools? They all seem built for actual fan-out fan-in parallelism, rather than "worker thread that runs forever" spawns?
03:03:35FromDiscord<girvo> I don't really care about the returned value from the spawned task, as the task/thread/whatever won't ever return
03:11:15*rockcavera joined #nim
03:11:38*def- quit (Quit: -)
03:13:19*def- joined #nim
03:24:14FromDiscord<im__cynical> https://raw.githubusercontent.com/byt3bl33d3r/OffensiveNim/master/src/self_delete_bin.nim This code worked perfectly fine a few months ago, and now it gives me a buffer overflow when I try it
03:24:37FromDiscord<im__cynical> the code itself didnt change at all
03:25:11FromDiscord<␀ Array πŸ‡΅πŸ‡Έ πŸ‰> does downgrading nim fixes it?↡(@imcynical)
03:36:41*def- quit (Quit: -)
03:37:27FromDiscord<niggerblaster9005> @room
03:37:35FromDiscord<niggerblaster9005> Kill niggers
03:37:41FromDiscord<niggerblaster9005> Fuck all niggers
03:37:44FromDiscord<niggerblaster9005> Shoot kills
03:37:55*def- joined #nim
03:37:57FromDiscord<niggerblaster9005> Nigger nigger nigger
03:38:03FromDiscord<niggerblaster9005> Nigger
03:38:04FromDiscord<ElegantBeef> <@&371760044473319454>
03:38:09FromDiscord<niggerblaster9005> Nigger
03:38:11FromDiscord<niggerblaster9005> @ElegantBeef\:
03:38:14FromDiscord<niggerblaster9005> @ElegantBeef\:
03:38:16FromDiscord<niggerblaster9005> Nigger
03:38:20FromDiscord<Elegantbeef> @girvo probably want createThread
03:38:20FromDiscord<niggerblaster9005> Nigger
03:38:25FromDiscord<Elegantbeef> Damn you really are low effort troll
03:38:35FromDiscord<niggerblaster9005> 1000039228.jpg https://media.discordapp.net/attachments/371759389889003532/1211880029861187645/1000039228.jpg?ex=65efce3a&is=65dd593a&hm=05760e995f45059345f21211e30ac306cb3d1b19d2daa3f8bf6cd66f6ab34e78&
03:38:42FromDiscord<graveflo> why bother. like who cares
03:38:59FromDiscord<graveflo> just going to get banned anyway
03:39:05FromDiscord<niggerblaster9005> 1000039010.jpg https://media.discordapp.net/attachments/371759389889003532/1211880154968625162/1000039010.jpg?ex=65efce58&is=65dd5958&hm=b33478c881eba7af4ff30b5e8aa608b89a917f484b005b845f9721cd37ff0501&
03:39:24FromDiscord<niggerblaster9005> @room nigger
03:39:30FromDiscord<niggerblaster9005> @room nigger
03:39:32FromDiscord<niggerblaster9005> @room nigger
03:39:34FromDiscord<niggerblaster9005> @room nigger
03:39:39FromDiscord<niggerblaster9005> @room nigger
03:40:34FromDiscord<Elegantbeef> It's always a confounding thing
03:40:41FromDiscord<girvo> In reply to @Elegantbeef "<@823468778704076810> probably want createThread": Ah yep good call
03:40:59FromDiscord<girvo> Yeah I never understand. Must be something deeply wrong with them
03:40:59FromDiscord<Elegantbeef> sorry for the awful ping timing, just seen the message on discord
03:41:20FromDiscord<girvo> Lmao it’s all good
03:41:46FromDiscord<niggerblaster9005> @room nigger
03:41:47FromDiscord<niggerblaster9005> @room nigger
03:42:56FromDiscord<niggerblaster9005> 1000002174.gif https://media.discordapp.net/attachments/371759389889003532/1211881125870313513/1000002174.gif?ex=65efcf40&is=65dd5a40&hm=0a2880c1e43c3e76d4bb811522210b0d9af11c9a27e88d83b80f7d3dbfd4f412&
03:42:56FromDiscord<niggerblaster9005> 1000002177.jpg https://media.discordapp.net/attachments/371759389889003532/1211881127799816212/1000002177.jpg?ex=65efcf40&is=65dd5a40&hm=19a2982a7bdfd45e2662aaf52969321cd4dd5d495ee02a740d36e02a1aa89a88&
03:42:58FromDiscord<niggerblaster9005> 1000002178.jpg https://media.discordapp.net/attachments/371759389889003532/1211881134884130887/1000002178.jpg?ex=65efcf42&is=65dd5a42&hm=e93c6f69797c92825780d2236705d000124baeb51820c2c72214a4292231c316&
03:44:49*def- quit (Quit: -)
03:45:32*rockcavera quit (Remote host closed the connection)
03:45:41*def- joined #nim
03:48:49FromDiscord<odexine> wow what a pleasant discussion
03:49:07*def- quit (Client Quit)
03:52:41*def- joined #nim
04:03:00FromDiscord<im__cynical> In reply to @niggerblaster9005 "1000039228.jpg": least closeted anti furry
04:06:08*def- quit (Quit: -)
04:08:02*def- joined #nim
04:11:03*def- quit (Client Quit)
04:11:30termercool posting
04:16:36FromDiscord<huantian> In reply to @im__cynical "least closeted anti furry": does that mean that they proclaim to be an anti furry, but are actually barely closeted?
04:16:56FromDiscord<girvo> least most closeted anti-anti-furry
04:17:04FromDiscord<huantian> that makes more sense
04:17:10FromDiscord<girvo> πŸ˜„
04:17:46FromDiscord<Elegantbeef> Whatever the case I'd have assumed the overlap of racists and furries would've been an empty set
04:22:14FromDiscord<odexine> unfortunately theres a small bit
04:28:14*azimut quit (Ping timeout: 255 seconds)
04:31:46FromDiscord<girvo> In reply to @odexine "unfortunately theres a small": For real, I've never understood it but theres genuinely a weird racist/fascist subset of furries. bonkers to me
04:31:58FromDiscord<girvo> tiny, ofc. but the fact it exists at all is wild
04:33:26FromDiscord<odexine> its the same with any kind of society id say, like a strange combination like those racist to their own race or w/e
04:38:13FromDiscord<im__cynical> sent a code paste, see https://play.nim-lang.org/#pasty=DkYRYTczsAAy
04:38:28FromDiscord<im__cynical> I allocate 8 to the buffer, and I write 8 bytes↡I dont see how this can result in an overflow
04:38:45FromDiscord<Elegantbeef> `sizeof(lpwStream)` is 8
04:39:28FromDiscord<im__cynical> In reply to @Elegantbeef "`sizeof(lpwStream)` is 8": Yes, it is
04:39:39FromDiscord<Elegantbeef> You want `len` but really `":wtfbbq".len`
04:40:18FromDiscord<Elegantbeef> Windows really is atrocious to interact with though
04:40:45FromDiscord<im__cynical> 😭 ik
04:40:55FromDiscord<im__cynical> there are so so so many different types
04:41:06FromDiscord<Elegantbeef> Well they use utf16
04:41:11FromDiscord<Elegantbeef> So they're really out in the boonies of stupidity
04:41:26FromDiscord<im__cynical> ulonglong is a type
04:41:59FromDiscord<im__cynical> anyways, I can't use len() or .len on a wide cstring
04:42:03FromDiscord<Elegantbeef> But yea you want sizeof(uint16) \ myStr.len
04:42:07FromDiscord<Elegantbeef> You can use it
04:42:18FromDiscord<Elegantbeef> It's defined in the `std/widestrs` module
04:43:45FromDiscord<im__cynical> sent a code paste, see https://play.nim-lang.org/#pasty=NqwMVwwuGRac
04:43:55FromDiscord<im__cynical> sent a long message, see https://pasty.ee/OMOuTLlzEWTp
04:44:00FromDiscord<im__cynical> (edit) "https://pasty.ee/sElTBTqSDbOw" => "https://pasty.ee/lHIGZWPRoHjj"
04:44:14FromDiscord<Elegantbeef> Right use std/widestr's constructor
04:47:58*def- joined #nim
04:48:02*azimut joined #nim
04:48:19FromDiscord<im__cynical> sent a code paste, see https://play.nim-lang.org/#pasty=vuxyjaitDYVU
04:49:14FromDiscord<Elegantbeef> The size of lpFileInformation, in bytes.
04:49:21FromDiscord<Elegantbeef> The last parameter of that procedure
04:50:51FromDiscord<im__cynical> If you're referring to cast[DWORD](sizeof(fRename) + len(lpwStream)), the size of that is 31
04:51:03FromDiscord<im__cynical> (edit) "size" => "value"
04:53:47FromDiscord<im__cynical> In reply to @Elegantbeef "The size of lpFileInformation,": the size of fRename is 24
04:54:04FromDiscord<Elegantbeef> The length of the string does not change the side of the struct does it?
04:54:26FromDiscord<Elegantbeef> You're copying to `fRename.FileName` but that's not allocated memory
04:54:51FromDiscord<Elegantbeef> `fRename` is statically allocated to a size you do not do any allocating
04:55:43FromDiscord<Elegantbeef> To do what you're doing you need to allocate `FILE_RENAME_INFO` yourself
04:56:09FromDiscord<im__cynical> sent a code paste, see https://play.nim-lang.org/#pasty=SyfPapNuCrYN
04:56:11FromDiscord<Elegantbeef> ` WCHAR FileName[1];` is the definition of `FileName` which means you have no space to copy to when this is stack allocated
04:56:15*Guest21 joined #nim
04:56:56*Guest21 quit (Client Quit)
04:57:02FromDiscord<Elegantbeef> No `let resizeInfo = cast[ptr FileNameInfo](alloc(sizeof(FileNameInfo) + myWideStr.len))`
04:57:43FromDiscord<Elegantbeef> IIRC MSVC does not support `WChar FileName[]` so it uses `1` which means it allows you to stack allocate
05:08:49FromDiscord<im__cynical> Well, now it doesn't overflow
05:08:55FromDiscord<im__cynical> but it still doesn't function as expected
05:09:18FromDiscord<im__cynical> sent a code paste, see https://play.nim-lang.org/#pasty=aTqPlgllDkyc
05:09:54FromDiscord<Elegantbeef> you're still passing the wrong data
05:10:15FromDiscord<Elegantbeef> `DWord(sizeof(resizeInfo) + myWideStr.len sizeof(uint16))`
05:10:38FromDiscord<Elegantbeef> `sizeof(FileRenameInfo)` not resizeInfo
05:13:28FromDiscord<im__cynical> sent a code paste, see https://play.nim-lang.org/#pasty=IpEYsuzRsTzc
05:13:50FromDiscord<Elegantbeef> Whoops same thing on line 4
05:14:02FromDiscord<Elegantbeef> `lpwStream.len` is in uint16s
05:14:05FromDiscord<Elegantbeef> So multiply there aswell
05:15:20FromDiscord<im__cynical> sent a code paste, see https://play.nim-lang.org/#pasty=dJjDvppeUIam
05:16:19FromDiscord<Elegantbeef> Lol I misread it
05:16:27FromDiscord<Elegantbeef> That's setfileinformation
05:16:40FromDiscord<girvo> In reply to @Elegantbeef "Windows really is atrocious": As someone whos spent the last few days trying to understand COM, WMI, Win32 in general and more: that is a complete and utter understatement!
05:16:41FromDiscord<Elegantbeef> Can utf16 die in a hole though... thanks
05:16:54FromDiscord<girvo> In reply to @Elegantbeef "Can utf16 die in": Dying in a hole isn't violent enough for UTF-16
05:18:02FromDiscord<Elegantbeef> Ah luckily it's the same thing but that is supposed to be `cast[ptr FileRenameInfo]` at line 4
05:18:09FromDiscord<Elegantbeef> Lol girvo it is just the worst
05:19:08FromDiscord<Elegantbeef> If that doesn't work I suggest purging windows and installing linux, mac, a BSD or anything \nix based
05:19:11FromDiscord<im__cynical> In reply to @Elegantbeef "Ah luckily it's the": Changing this did nothing, same output as before
05:19:16FromDiscord<im__cynical> In reply to @Elegantbeef "If that doesn't work": πŸ’€
05:19:48FromDiscord<girvo> Btw, I wonder if nim-sys will eventually tackle `std/locks` at all, or is that too low level/needs too much magic? init/deinitLock makes me sad, but then I guess they're kind of global anyway so destructors kind of don't make that much semantic sense for them?
05:19:57FromDiscord<Elegantbeef> It won't change anything but you should deallocate the widestring after the copymem πŸ˜„
05:20:11FromDiscord<Elegantbeef> Well the init is silly
05:20:18FromDiscord<Elegantbeef> It should be `var myLock = Lock.init()`
05:20:29FromDiscord<girvo> that I absolutely agree with
05:20:33FromDiscord<Elegantbeef> The deinit should be handled by a destructor anywho
05:20:39FromDiscord<girvo> (and then `RwLock.init()` and so on)
05:20:43FromDiscord<Elegantbeef> Globals still have destructors
05:20:49FromDiscord<girvo> Cool πŸ™‚
05:21:31FromDiscord<Elegantbeef> Next you'll talk about streams needing to have `close` and I'll joyfully exclaim "Traitor's streams exist!" πŸ˜„
05:21:38FromDiscord<girvo> I might have a crack at it, as I've been implementing Lock-style interfaces for the FreeRTOS mutex primitives
05:21:48FromDiscord<girvo> In reply to @Elegantbeef "Next you'll talk about": oh god what have I done hahaha
05:22:00FromDiscord<Elegantbeef> Luckily you can always just do `type Lock = distinct locks.Lock` and implement your operations
05:22:14FromDiscord<girvo> In reply to @Elegantbeef "Luckily you can always": Yep pretty much exactly what I've done
05:22:34FromDiscord<Elegantbeef> Hey I need to shill Traitor until someone tries it and makes an issue
05:23:27FromDiscord<Elegantbeef> I'm at least dog fooding it with my shitty toy language to generate wasm byte code
05:24:10FromDiscord<girvo> I've not actually tried traitor yet. I keep thinking it'd be worth doing to have "easier" stubbing of dependencies for various modules, or something. But then I feel like I'm implementing dependency injection, and I feel gross and stop
05:24:27FromDiscord<girvo> Traitor isn't quite what I want though (as its runtime)
05:24:35FromDiscord<Elegantbeef> It's not though
05:24:40FromDiscord<Elegantbeef> It supports runtime and static dispatch
05:24:43FromDiscord<girvo> Its not? I thought it was for runtime dispatch
05:24:44FromDiscord<girvo> ooooh
05:24:54FromDiscord<Elegantbeef> https://github.com/beef331/traitor/blob/master/tests/tstreams.nim
05:25:08FromDiscord<sirolaf> In reply to @Elegantbeef "It's defined in the": The brave may also use winim/winstr https://khchen.github.io/winim/winstr.html
05:25:11FromDiscord<Elegantbeef> You use `StaticTraitor[Trait]` for static
05:25:22FromDiscord<girvo> Okay I'm definitely going to have a play with it then
05:26:01FromDiscord<Elegantbeef> You still need `implTrait MyTrait` cause I cheat and just do `StaticTrait[T] = concept type st; st.toTrait(T)` πŸ˜„
05:26:10FromDiscord<girvo> Being able to override, say, the Nesper parts and run them with stubs in our tests would be so nice
05:26:20FromDiscord<girvo> In reply to @Elegantbeef "You still need `implTrait": hah, thats not that big a deal though
05:26:48FromDiscord<Elegantbeef> https://github.com/beef331/traitor/blob/master/traitor/streams.nim#L103-L151 is pretty succinct
05:27:11FromDiscord<girvo> I was just reading through that
05:27:12FromDiscord<Elegantbeef> You of course should use `AnyTraitor[T]` if you want to work with runtime and static dispatch
05:27:26FromDiscord<girvo> tbh for our purposes _only_ static dispatch is best
05:27:43FromDiscord<girvo> paying runtime pointer chasing costs on embedded is ick
05:27:51FromDiscord<Elegantbeef> Right, I was just mentioning it before you make your own `AnyTraitor` πŸ˜›
05:27:56FromDiscord<girvo> No worries πŸ˜›
05:28:01FromDiscord<Elegantbeef> Yea I still need to figure out how to optimise it further
05:28:26FromDiscord<Elegantbeef> I ditched the idea of a single vtable per type as it's actually slower due to cache thrashing
05:28:41FromDiscord<Elegantbeef> Atleast when you are operating on many types
05:29:22FromDiscord<girvo> ah interesting, but I guess that makes sense
05:29:46FromDiscord<girvo> if it's static, whats the runtime overhead, if any?
05:30:00FromDiscord<Elegantbeef> So you save memory for each instance but lose some amount of dispatch speed
05:30:01FromDiscord<Elegantbeef> On a single type it's practically the same speed
05:30:22FromDiscord<girvo> Sweet
05:30:24FromDiscord<Elegantbeef> It's the same as a generic proc
05:30:31FromDiscord<girvo> Yeah perfect, that was my assumption
05:30:54FromDiscord<Elegantbeef> In the static case it's just constrained by that aforementioned concept
05:31:32FromDiscord<Elegantbeef> One thing I will note is you likely should have a `proc ensureCompiles() {.used, gensym.} = myRealProc(Traitor[Trait](), ...)` for any procs
05:31:34FromDiscord<girvo> Yeah perfect. its pretty much what I'd started doing with concepts and a static param to the procs lol
05:31:37FromDiscord<girvo> Just, yknow, nicer
05:31:56FromDiscord<Elegantbeef> This gives you a compile time error without having to instantiate the proc later on
05:32:01FromDiscord<girvo> Ahhhh nice!
05:33:03FromDiscord<Elegantbeef> It'll of course get DCE'd but it forces Nim to actually generate an instance of the proc and should ensure it compiles without any other implementions as Nim does unchecked generics even with concepts
05:33:06FromDiscord<girvo> I really do think "interface-like" stuff/stubbing is a missing piece in the testing workflow for Nim for real applications, at least with the embedded land constraints of "we can't just make 10000 tiny procs and hope they get optimised away" -- though I guess one can always `{.inline.}` them all lol
05:33:45FromDiscord<girvo> In reply to @Elegantbeef "It'll of course get": Okay thats nice. I think that idea is something I was missing when I was trying to build something similar myself
05:34:24FromDiscord<Elegantbeef> Yea that `Traitor[T]` being there and passing `StaticTraitor[T]` is a joyful accident
05:35:12FromDiscord<Elegantbeef> Similar to that is the `joinTraits` macro not needing `converter` cause the new type works in `AnyTraitor[Child]` https://github.com/beef331/traitor/blob/master/tests/tjointhem.nim
05:35:40FromDiscord<Elegantbeef> I thought it was going to require converters and shit to get that code to work and be able to call `print` but nope... you can just use the code directly without any issue πŸ˜›
05:35:54FromDiscord<girvo> haha happy accidents indeed
05:36:24FromDiscord<Elegantbeef> This does of course fall if you have overloads and the technique I do there with `_: typedesc[T or void]` is fantastic to allow you to call the specific implementation you want
05:36:33FromDiscord<Elegantbeef> Stopping the diamond problem in it's tracks
05:37:56FromDiscord<girvo> Yeah its a neat approach I think, and reads quite nicely
05:38:30FromDiscord<Elegantbeef> To ramble about the implementation a bit further, having an existential type really is the trick, other attempts I took resulted in having to convert from the "Trait"s to a number stored inside of a static parameter of an instance
05:38:43FromDiscord<girvo> beats the massively overloaded someFunc<Now, We, Pass, Lots, Of, Generics> when doing stuff like this back in Typescript/Flow land (back in the day anyway) -- and even then you'd get type erasure still if you weren't careful
05:39:05FromDiscord<girvo> In reply to @Elegantbeef "To ramble about the": Hah that has as name: "brands" I believe its called
05:39:13FromDiscord<Elegantbeef> But doing `type Atom = distinct void` and using that `Atom` in place of 'Self' really makes life so much better since everything is proper types
05:39:58FromDiscord<girvo> https://www.cl.cam.ac.uk/~jdy22/papers/lightweight-higher-kinded-polymorphism.pdf
05:40:09FromDiscord<Elegantbeef> It does kinda suck there is no way of doing `MyType[C]` where `C` is a `concept`
05:40:25FromDiscord<girvo> Basically having a tag or otherwise specific existential "thing" that you use as the identifier/pivot point
05:40:33FromDiscord<girvo> In reply to @Elegantbeef "It does kinda suck": Yeah 😦
05:40:34FromDiscord<Elegantbeef> My uneducated brain will process that like my stomach does corn
05:40:49FromDiscord<girvo> In reply to @Elegantbeef "My uneducated brain will": I promise its less complex than it seems haha
05:41:08*nmz left #nim (Ploop)
05:42:57FromDiscord<Elegantbeef> Given I don't know haskell or ocaml are you sure about that?
05:43:18FromDiscord<girvo> https://github.com/gcanti/fp-ts (and previous to that, https://github.com/gcanti/flow-static-land) are built off that paper haha
05:43:40FromDiscord<girvo> In reply to @Elegantbeef "Given I don't know": Ocaml is easy πŸ˜› haskell less so
05:44:40FromDiscord<girvo> sent a long message, see https://pasty.ee/sjGHMlpmrAwC
05:46:17FromDiscord<girvo> I should honestly take a crack at implementing it in Nim some time, based on the paper. Lets you get proper higher kinded types even in type systems that aren't that powerful -- and Nims is decently powerful, so it should work quite welsl
05:46:19FromDiscord<girvo> well
05:47:20FromDiscord<Elegantbeef> Well if you need any meta-programming secrets tuples are the most magical Nim type
05:47:33FromDiscord<girvo> Structural typing? No wonder πŸ˜›
05:47:43FromDiscord<ipumpbuh4> Fuck niggers?
05:47:54FromDiscord<Elegantbeef> Phil (he/him) it's back
05:48:11FromDiscord<ipumpbuh4> 1000039246.jpg https://media.discordapp.net/attachments/371759389889003532/1211912644328685568/1000039246.jpg?ex=65efec9a&is=65dd779a&hm=cab83f9dd1683d595cdef553a1f78fa56552b4c653e19daf4c97917366553438&
05:48:13FromDiscord<ipumpbuh4> Problem?
05:48:30FromDiscord<ipumpbuh4> I made a nim library called fuckNiggers
05:48:39FromDiscord<Elegantbeef> @girvo Moreso that they're incapable of being variants, they're capable of being anonymous and you can iterate them
05:49:06FromDiscord<ipumpbuh4> Does anyone1here want to try my fuckNiggers library
05:49:09FromDiscord<ipumpbuh4> @room
05:51:04FromDiscord<ipumpbuh4> If you want to beta test fuckNiggers that would be helpful
05:51:13FromDiscord<ipumpbuh4> I never use it outside my machine
05:51:25FromDiscord<girvo> In reply to @Elegantbeef "<@823468778704076810> Moreso that they're": They really do seem like magic haha. Nothing else works like that hey
05:51:42FromDiscord<ipumpbuh4> @girvo\: want to beta test fuckNiggers?
05:51:57FromDiscord<Elegantbeef> They're a nice control varadic generic equivlency
05:52:49FromDiscord<djazz> <@&371760044473319454>
05:52:51FromDiscord<Elegantbeef> controlled\
05:53:09FromDiscord<Elegantbeef> I was hoping phil was still here, but he probably left
05:53:14FromDiscord<girvo> https://drawson.medium.com/higher-kinds-in-kotlin-cdb6904c2fdb you might find this more straightforward than the paper, but it uses the same idea
05:53:23*FromDiscord quit (Remote host closed the connection)
05:53:41*FromDiscord joined #nim
05:54:06FromDiscord<girvo> _waves at @djazz_
05:54:29FromDiscord<djazz> Aah its gone nice
05:54:59FromDiscord<Elegantbeef> I'll never understand that behaviour, must require driving a railroad spike through your skull
05:55:30FromDiscord<girvo> I have to assume they're truly broken people hey
05:56:10FromDiscord<girvo> But yeah that paper was huge in the "typed functional programming in languages not really made for it" space haha
05:56:49FromDiscord<huantian> In reply to @girvo "https://drawson.medium.com/higher-kinds-in-kotlin-c": this looks cool but i have not the patience to comsume it rn i will save this mayhaps
05:57:09FromDiscord<Elegantbeef> No huan that wasn't for you spit it otu
05:57:09FromDiscord<Elegantbeef> out\
05:57:14FromDiscord<girvo> hahaha
05:57:55FromDiscord<Elegantbeef> Aint this mostly describing `concept`?
05:58:00FromDiscord<girvo> Sort of πŸ™‚
05:59:01FromDiscord<Elegantbeef> Though anything like `a.map is Mappable[T]` is not really representable in concepts directly
06:00:24FromDiscord<girvo> Yeah it allows for higher kinded type expressions which I'm pretty sure concepts still struggle with
06:01:12FromDiscord<Elegantbeef> Yea concepts cannot be deeply recursive think technically they can only recurse 100 times
06:02:03FromDiscord<girvo> Tbf neither can brands, as most impls sort of limit it to.. I think 10 times? Because the developer has to write them all out lol. ↡↡Oh actually I think its 5! times? So 120 times, because of how ap1 through ap5 work togehter
06:03:03FromDiscord<Elegantbeef> Wait a bloody minute https://nim-lang.org/docs/manual_experimental.html#concepts-concept-refinement
06:03:41FromDiscord<girvo> ooooooooh
06:03:44FromDiscord<girvo> ooooh
06:03:45FromDiscord<girvo> okay
06:03:47FromDiscord<girvo> thats useful
06:04:04FromDiscord<Elegantbeef> I somehow have never seen this before...
06:04:40FromDiscord<djazz> Yo dawg we put concepts in your concepts
06:04:54FromDiscord<girvo> If it works the way it says, that would genuinely allow for HKTs to just "work" for the most part
06:05:10FromDiscord<Elegantbeef> Fastest segfault ever
06:05:11FromDiscord<Elegantbeef> Time!
06:05:13FromDiscord<Elegantbeef> https://play.nim-lang.org/#pasty=NJOOieSSPhLD
06:05:14FromDiscord<girvo> hahaha
06:05:34FromDiscord<djazz> Lool
06:05:47FromDiscord<Elegantbeef> I do want to take a look at these now cause this solves row typing
06:05:59FromDiscord<girvo> Yeah this would be super useful
06:06:01FromDiscord<Elegantbeef> If this works rowtyping just fucking works
06:06:10FromDiscord<girvo> I wonder what the limitation is thats causing that segfault
06:06:18FromDiscord<morgan> so im very confused
06:06:23FromDiscord<morgan> i'm using sokol
06:06:32FromDiscord<morgan> and trying to debug a crash when setting up textures
06:06:43FromDiscord<morgan> but i've commented out most of it, and force building every time
06:07:16FromDiscord<morgan> and it seems like the line that changes whether it gives errors (that there's no texture bound) or not with its crash, has nothing to do with it
06:08:09FromDiscord<morgan> sent a code paste, see https://play.nim-lang.org/#pasty=eMsKXHxbXEAI
06:08:28FromDiscord<morgan> commenting out the imagedesc line has no effect
06:09:12FromDiscord<morgan> defining an array causes it to crash
06:09:19FromDiscord<morgan> and i am so confused
06:10:14FromDiscord<morgan> even without the textures set up in the shader
06:10:53FromDiscord<morgan> commenting that in causes it to crash, when it otherwise would run (and draw stuff wrong, that's a whole other problem, i want the textures to see what it's doing better)
06:11:00FromDiscord<Elegantbeef> What's the error?
06:11:03FromDiscord<morgan> nim doesn't complain
06:11:39FromDiscord<demotomohiro> In reply to @morganalyssa "i'm using sokol": If that large array is defined in proc, it might causes stack overflow.
06:11:50FromDiscord<morgan> sent a code paste, see https://play.nim-lang.org/#pasty=pUJWnpIfjwGG
06:12:08FromDiscord<morgan> oh hm ok i'll try defining it outside it
06:12:58FromDiscord<morgan> oh huh yeah that did it
06:13:01FromDiscord<morgan> wack
06:19:26FromDiscord<sirolaf> sent a code paste, see https://play.nim-lang.org/#pasty=vsHiMMvoSGny
06:19:39FromDiscord<Elegantbeef> Yep
06:19:46FromDiscord<Elegantbeef> but doing `v is Vector2` works
06:19:52FromDiscord<Elegantbeef> So there is some refinement still
06:20:27FromDiscord<Elegantbeef> But it falls apart at Vector4
06:21:45FromDiscord<Elegantbeef> `concept of` also fails as a syntax
06:22:28FromDiscord<sirolaf> Adding generics produces infinite recursion and without it you got ambiguity it says
06:22:39FromDiscord<Elegantbeef> I noticed that
06:23:04FromDiscord<Elegantbeef> Ah I see how I think
06:27:29*azimut quit (Ping timeout: 255 seconds)
06:37:59FromDiscord<sirolaf> sent a code paste, see https://play.nim-lang.org/#pasty=AsGQlZkgAxbD
06:38:12FromDiscord<Elegantbeef> Yea except that doesn't work for row types
06:38:40FromDiscord<Elegantbeef> https://github.com/beef331/truss3d/blob/master/src/truss3D/mathtypes.nim I did this before πŸ˜„
06:40:29FromDiscord<sirolaf> All roads lead to rome I guess
06:40:31FromDiscord<sirolaf> So what is a row type
06:40:54FromDiscord<Elegantbeef> Row polymorphism is runtime and static polymorphism based off a type having specific fields
06:41:20FromDiscord<Elegantbeef> https://github.com/beef331/nimtrest/blob/master/rowed.nim#L257-L293
06:41:30FromDiscord<sirolaf> Good luck getting that to work in new style concepts, which are also abandoned from what I can tell 😼
06:41:42FromDiscord<Elegantbeef> Fuck new styled concepts
06:41:51FromDiscord<Elegantbeef> I have no need for them πŸ˜›
06:42:15FromDiscord<sirolaf> Are prs for old concepts still accepted you think?
06:42:24FromDiscord<Elegantbeef> Probably
06:42:30FromDiscord<Elegantbeef> I'd hope so since I use them so much
06:44:41FromDiscord<sirolaf> First step to making this work would probably be giving weight to concept conditions then
06:44:51FromDiscord<sirolaf> It looks like its just a binary matches: yes/no
06:45:02FromDiscord<Elegantbeef> It's not binary yes/no since there is refinement
06:45:12FromDiscord<sirolaf> The refinement is bad
06:45:16FromDiscord<Elegantbeef> If two concepts match refinement should work otherwise you need to step in
06:45:29FromDiscord<Elegantbeef> Sure refinement is bad, but concept conditions should not change match strength
06:45:33FromDiscord<Elegantbeef> More concepts is not more better
06:45:40FromDiscord<Elegantbeef> I mean more concept statements
06:46:10FromDiscord<Elegantbeef> Fixing refinement seems to just be making the tree relation work properly
06:46:26FromDiscord<Elegantbeef> Then in the case of ambiguity between two concepts that match you need a mechanism to specify "Match this type"
06:46:43FromDiscord<Elegantbeef> `v is Y` seems to sorta work
06:47:59FromDiscord<sirolaf> In this case it will always be ambiguous because Vector3 is a pure extension to Vector2
06:48:04FromDiscord<sirolaf> Thus it needs a weight
06:48:24FromDiscord<Elegantbeef> Right the weight is the inverse of the depth of the tree
06:48:40FromDiscord<Elegantbeef> The 0th node is the weakest the highest is the furthers from node
06:48:54FromDiscord<Elegantbeef> I thought you meant you needed weight per statement count
06:49:16FromDiscord<sirolaf> No, hadn't thought so deeply about it yet because there seem to be ambiguity traps everywhere
06:49:43FromDiscord<Elegantbeef> Right `nkConv(Concept,...)` should resolve that
06:50:04FromDiscord<Elegantbeef> You should be able to explicitly convert to a concept to prefer it but presently for obvious reasons a conversion to a concept is removed in dispatch
06:54:15FromDiscord<sirolaf> Now how would that tree depth interact with multiple "inheritance"
06:55:55FromDiscord<sirolaf> Naively I would probably collect all the leaf concepts and do a breadth first match on them until it's at the most specific it can satisfy
07:02:12*advesperacit joined #nim
07:16:47*systemdsucks quit (Ping timeout: 268 seconds)
07:17:01*systemdsucks joined #nim
07:39:18FromDiscord<sirolaf> Gonna play around with it, can probably solve it somewhere around `cmpCandidates`
08:01:15NimEventerNew thread by IanZhang: Recusion use a lot of memory, any idea why?, see https://forum.nim-lang.org/t/11094
08:22:41*redj quit (Quit: No Ping reply in 180 seconds.)
08:24:04*redj joined #nim
08:42:20*Epsilon quit (*.net *.split)
09:01:06FromDiscord<whisperecean> Is there a docu somewhere so I can fix issues like this? 'updateHandler (Async)' is not GC-safe as it calls 'genQuote'
09:03:25FromDiscord<nnsee> is genQuote your own code?
09:03:42FromDiscord<nnsee> mark it with the {.gcsafe.} pragma and fix any issues the compiler complains about
09:17:23FromDiscord<kiloneie> Why are there `{nnkVarTy, nnkConstTy}` node kinds but not a `nnkLetTy` ? Why can i only pass a `var` to a macro but not let and const ?
09:18:16FromDiscord<Elegantbeef> Cause the default parameter type is `let` and `static` is const
09:19:52FromDiscord<whisperecean> In reply to @nnsee "is genQuote your own": nope. repo project
09:20:08FromDiscord<whisperecean> wiht nim 1.4 in the nimble
09:24:33FromDiscord<sirolaf> sent a code paste, see https://play.nim-lang.org/#pasty=jpmYTnoTtKWv
09:24:55FromDiscord<Elegantbeef> Right cause it doesn't work presently πŸ˜„
09:25:05FromDiscord<Elegantbeef> `type V of X` does nothing afaict
09:25:25FromDiscord<Elegantbeef> Which makes me think it's unimplemented, as does `concept of T`
09:25:38FromDiscord<sirolaf> I added a type relation for it to identify subconcepts during overload resolution, but yeah stumbled upon this issue along the way while testing
09:26:39FromDiscord<sirolaf> Was hoping to rely on concept evaluation or whatever this is to work
09:26:55FromDiscord<Elegantbeef> The `x is T` does work
09:27:14FromDiscord<Elegantbeef> So you can test doing `x is OtherThing` for refinement to implement
09:28:51FromDiscord<sirolaf> sent a code paste, see https://play.nim-lang.org/#pasty=wfLfzhNYFeFi
09:29:05FromDiscord<Elegantbeef> Add `Vector4`
09:29:12FromDiscord<sirolaf> What should it be
09:29:30FromDiscord<Elegantbeef> sent a code paste, see https://play.nim-lang.org/#pasty=JsbICLyiLNlu
09:30:00FromDiscord<Elegantbeef> So wait refinement sorta actually works presently? πŸ˜„
09:30:10FromDiscord<Elegantbeef> But only sorta
09:30:48FromDiscord<sirolaf> sent a code paste, see https://play.nim-lang.org/#pasty=OGKeyEagrhPo
09:31:58FromDiscord<Elegantbeef> sent a code paste, see https://play.nim-lang.org/#pasty=VnYUklFEKBBX
09:33:17FromDiscord<sirolaf> Someone has to solve that issue, then this type relation would work
09:33:17FromDiscord<Elegantbeef> Oh the vector example works cause the refinement forces it to expand to `.w` only being the constraint
09:33:43FromDiscord<sirolaf> I think it should take the inherited constraints into account too
09:33:55FromDiscord<Elegantbeef> I can take a look at the refinement logic tomorrow if you want to work together on this πŸ˜„
09:34:14FromDiscord<sirolaf> Sure, on my side the basic refinements work, not sure about more complex ones
09:34:34FromDiscord<Elegantbeef> Well it might fail when we take into account the children, but we'll see
09:34:49FromDiscord<Elegantbeef> It's depth first matching presently though right?
09:35:00FromDiscord<Elegantbeef> Deepest type is the concept chosen
09:36:40FromDiscord<sirolaf> It does something even more naive, `typeRel` checks if the formal is a subconcept of the given one and if it is it gets penalized during `checkGeneric`. Sub concept here means the given value can be downgraded into it based on the inheritance relation
09:37:13FromDiscord<Elegantbeef> Nifty
09:37:49FromDiscord<Robyn [She/Her]> Hazbin Hotel reference /j
09:43:48FromDiscord<Elegantbeef> So olaf there is a `inherited` variable inside the semtypeclass and it gets built up but isn't used anywhere
09:44:42FromDiscord<sirolaf> It does kinda get used
09:45:19FromDiscord<Elegantbeef> Ah right I misread πŸ˜„
09:45:19FromDiscord<Elegantbeef> Nearly 3am brain
09:45:28FromDiscord<sirolaf> But it does not get added to the concept body or get checked anywhere
09:45:38FromDiscord<sirolaf> Just turned into the nodes I use for my type relation
09:45:42FromDiscord<Elegantbeef> It gets added to the type
09:47:40FromDiscord<sirolaf> Simplest fix would be throwing it into the body with `name is T`, but not sure how reliable that would be
09:47:57FromDiscord<Elegantbeef> I think we can do better
09:50:45FromDiscord<sirolaf> sent a code paste, see https://play.nim-lang.org/#pasty=TMlniUReCKAI
09:50:59FromDiscord<Elegantbeef> Right
09:51:05FromDiscord<Elegantbeef> But the type information is there
09:53:02FromDiscord<Elegantbeef> I think it makes more sense to just check each concept when you hit a concept with inheritance rather than expand the ast
09:53:47FromDiscord<sirolaf> I could expand the type relation to do that I guess
09:54:01FromDiscord<sirolaf> When one of the subconcepts doesn't match return isNone
09:54:19FromDiscord<Elegantbeef> Yep what I was trying for a test
09:54:23FromDiscord<sirolaf> Assuming I have access to that info
09:55:11FromDiscord<Elegantbeef> Should be like `for i in i..<concpt.len: conceptMatchLogic(a, concept[i])`
09:55:19FromDiscord<Elegantbeef> `0..` whoops πŸ˜„
10:00:37FromDiscord<sirolaf> `matchUserTypeClass` basically just turns the body into an expression as well
10:01:03FromDiscord<sirolaf> (edit) "an" => "a static true/false"
10:02:00FromDiscord<sirolaf> Good chance it'll work if you call it recursivel
10:02:02FromDiscord<sirolaf> (edit) "recursivel" => "recursively"
10:09:07FromDiscord<sirolaf> sent a code paste, see https://play.nim-lang.org/#pasty=AewCONbpzfnI
10:10:06FromDiscord<sirolaf> Combine those two and all examples sent so far work as expected
10:10:25FromDiscord<Elegantbeef> good job
10:10:40FromDiscord<Elegantbeef> I tried to make `type Bleh = concept of X` work but my brain is fried
10:11:19FromDiscord<Elegantbeef> https://play.nim-lang.org/#pasty=lRByigIUegMD the diff whilst I throw in the towel for now
10:11:45FromDiscord<sirolaf> How would you use that anyways
10:13:05FromDiscord<sirolaf> Maybe transforming it into this, but besides saving some keystrokes I don't see a purpose `Vector4 = concept type V of Vector3, WConcept`
10:14:09FromDiscord<Elegantbeef> I agree it was just in the docs
10:14:16FromDiscord<Elegantbeef> Was seeing if it could be piped
10:14:32FromDiscord<sirolaf> You're right, didn't see that one
10:14:59FromDiscord<sirolaf> I think you could fix that in the parser
10:16:41FromDiscord<sirolaf> The merged scope part of it doesn't actually work though from what I can tell
10:21:47FromDiscord<sirolaf> Oh yeah generics are also still broken, gotta look into those
10:23:16FromDiscord<Elegantbeef> My looking at generics seemed to cause issues with using the generic parameter more than once
10:24:25FromDiscord<Elegantbeef> sent a code paste, see https://play.nim-lang.org/#pasty=gkXeqLudqgUz
10:28:46FromDiscord<sirolaf> Causes segfaults actually
10:29:35FromDiscord<sirolaf> At least when you convert it into inheritance syntax
10:29:43FromDiscord<Elegantbeef> Ah
10:29:53FromDiscord<sirolaf> In this syntax it doesn't know how to resolve because I rely on that syntax
10:29:56FromDiscord<Elegantbeef> Probably the same thing for some reason it recursively attempts to replace T
10:30:24FromDiscord<sirolaf> No it passes nil during matchUserTypeClass with my code
10:31:14FromDiscord<sirolaf> Order is probably wrong and it doesn't know what's going on with T
10:32:45FromDiscord<whisperecean> @nnsee any more pointers? is it just about the annotations?
10:36:05FromDiscord<A2> Anyone have experience with the nim websockets packages? I'm looking at `treeform/ws` and `status-im/nim-websock`. I'm curious if someone has experience with these, and can tell which is preferable
10:47:34FromDiscord<vindaar> I've used treeform's `ws` several times and it's worked well for my simple use cases
10:48:43FromDiscord<theundername> Hi , How to use nim lang in c++?
11:02:00*jmdaemon quit (Ping timeout: 260 seconds)
11:34:53FromDiscord<A2> cool, thanks! I'll give `ws` a shot
11:37:08FromDiscord<A2> You can compile a `.so` file with the nim compiler, write a `.h` header file for the functions that you want to expose, and include that just like if it was a regular C library↡(@theundername)
11:37:57FromDiscord<A2> oh and you need to use the `exportc` pragma
11:38:19FromDiscord<A2> (on the functions that you want to call from your c++ project)
11:38:30FromDiscord<A2> (on the procs that you want to call from your c++ project)
12:12:29*xet7 quit (Remote host closed the connection)
12:24:29*rockcavera joined #nim
13:29:28*rockcavera quit (Remote host closed the connection)
13:32:07*xet7 joined #nim
14:17:39FromDiscord<fosster> hi all, do you know if nim can compile down to wasm?
14:49:11*azimut joined #nim
14:49:52*Epsilon joined #nim
14:51:36*krux02 joined #nim
15:17:49FromDiscord<nnsee> it can
15:24:53*tc424 quit (Ping timeout: 240 seconds)
15:25:17*ntat joined #nim
15:35:36FromDiscord<Robyn [She/Her]> In reply to @fosster "hi all, do you": It can yep, clang can emit WASM, so can `nlvm` (Nim but with a backend target LLVM instead of C), you can use `emcc` as a C compiler too
15:55:17*tc424 joined #nim
15:57:46*Epsilon quit (Ping timeout: 260 seconds)
16:00:52*Epsilon joined #nim
16:18:20FromDiscord<miragearchitect> how do you create and use bitfields?
16:28:33FromDiscord<im__cynical> sent a code paste, see https://play.nim-lang.org/#pasty=VpaRShWvRjJX
16:36:40FromDiscord<demotomohiro> In reply to @miragearchitect "how do you create": https://nim-lang.org/docs/manual.html#implementation-specific-pragmas-bitsize-pragma
16:40:53*rockcavera joined #nim
16:42:13*jmdaemon joined #nim
16:42:40FromDiscord<demotomohiro> sent a code paste, see https://play.nim-lang.org/#pasty=uewSyoOXEsoO
17:27:56*jmdaemon quit (Ping timeout: 260 seconds)
17:34:52*adigitoleo quit (Ping timeout: 258 seconds)
17:37:23*adigitoleo joined #nim
17:47:27*jmdaemon joined #nim
17:54:25*jmdaemon quit (Ping timeout: 264 seconds)
18:20:40*junaid_ joined #nim
18:23:34*adigitoleo quit (Ping timeout: 258 seconds)
18:24:52*adigitoleo joined #nim
18:35:03*junaid_ quit (Remote host closed the connection)
19:17:42*junaid_ joined #nim
19:22:30FromDiscord<ambient3332> Was cligen still the go-to library for creating command line tools?
19:22:52FromDiscord<ambient3332> I remember seeing some interesting alternatives
19:22:55Amun-Rahmm
19:52:40FromDiscord<fosster> it's weird that there so few resouces online about wasm on nim↡(@Robyn [She/Her])
19:53:15FromDiscord<Robyn [She/Her]> In reply to @fosster "it's weird that there": It's a niche usecase, to be fair
19:54:04FromDiscord<Robyn [She/Her]> Amun-Ra, did you use emcc to compile Nim 2.0.0 code to WASM?
19:55:46FromDiscord<awesome3434> sent a code paste, see https://play.nim-lang.org/#pasty=rfKzBFilPukz
20:07:42Amun-RaRobyn: yes, emcc
20:15:15Amun-Rathis is the part of my wasm nim.cfg (there's a room for optimization): https://play.nim-lang.org/#pasty=bScIvlZxlxtX
20:17:17Amun-Rathat requires per-project settings in config.nims
20:18:19Amun-Ralike this: https://play.nim-lang.org/#pasty=dUlVeeClmuhe
20:19:10Amun-RaI may write a kind of howto if anyone's interested
20:29:11*ntat quit (Quit: Leaving)
20:39:29FromDiscord<djazz> sent a code paste, see https://play.nim-lang.org/#pasty=EFzvfrchvhLE
20:39:37*junaid_ quit (Remote host closed the connection)
20:40:38FromDiscord<djazz> when echoing t i get `object` and t.flags `{tfFinal}`
20:41:41FromDiscord<djazz> echo debugging continues
20:43:20termerclassic Nim debugging
20:44:26FromDiscord<djazz> the PR introducing the bug is here as revealed by git blame <https://github.com/nim-lang/Nim/pull/15544>
20:44:39FromDiscord<djazz> a fix of another bug
20:44:48FromDiscord<djazz> but why is t.sym nil? hmmm
20:54:23FromDiscord<demotomohiro> In reply to @awesome3434 "Is there any way": https://nim-lang.org/docs/manual.html#implementation-specific-pragmas-codegendecl-pragma
21:03:13FromDiscord<Elegantbeef> @djazz genTypeInfov1... are you on refc?
21:03:24FromDiscord<djazz> no, arc
21:03:34FromDiscord<Elegantbeef> Weird
21:04:08FromDiscord<djazz> Hint: mm: arc
21:04:49FromDiscord<Elegantbeef> iirc TypeInfoV1 is for refc...
21:04:59FromDiscord<Elegantbeef> I guess I'm wrong
21:07:06FromDiscord<Elegantbeef> Djazz can you throw a `debug t` before that if?
21:07:07FromDiscord<awesome3434> In reply to @demotomohiro "https://nim-lang.org/docs/manual.html#implementatio": It's what I'm using now for my internal objects, though it doesn't seem to affect RootObj or closure objects in any way
21:12:24FromDiscord<Elegantbeef> I've gotta ask why do you want to change how those are generated?
21:13:55FromDiscord<djazz> sent a code paste, see https://play.nim-lang.org/#pasty=XmiGcfSuupgc
21:14:13FromDiscord<Elegantbeef> Yep works on AST and Types
21:14:20FromDiscord<awesome3434> In reply to @Elegantbeef "I've gotta ask why": The external library I'm working with requires to pass a custom attribute to any object associated with the scope and sadly I can't really ignore it
21:14:21FromDiscord<djazz> ah, macro magic
21:15:20FromDiscord<Elegantbeef> Not ideal but you could try using emit or codegendecl to create a type that wraps your type for this heinous interop πŸ˜„
21:15:34FromDiscord<Elegantbeef> Huh?↡(@djazz)
21:15:47FromDiscord<djazz> compiler magic
21:16:40FromDiscord<Elegantbeef> There is no ast associated with that type... odd
21:16:51FromDiscord<awesome3434> In reply to @Elegantbeef "Not ideal but you": Yeahh, I was more like trying to do it in a friendly Nim way with macros which seems to be handy for most of the time
21:16:58FromDiscord<Elegantbeef> Well actually it's an empty object
21:17:00FromDiscord<djazz> distinct object..
21:17:04FromDiscord<djazz> not a lot!
21:17:10FromDiscord<Elegantbeef> Do you have an empty object somewhere in your AST?
21:17:37FromDiscord<djazz> futhark generates them
21:17:41FromDiscord<Elegantbeef> Make a macro that consumes a typesection I guess↡(@awesome3434)
21:17:45FromDiscord<Elegantbeef> Ah
21:17:58FromDiscord<djazz> `type Altcpfunctions = distinct object`
21:18:06FromDiscord<djazz> I believe its this one causing the issue
21:18:19FromDiscord<djazz> its a field type on AltcpPcb
21:18:27FromDiscord<Elegantbeef> So seems it's a `tyPtr` of `tyObject` that lacks a symbol
21:18:28FromDiscord<djazz> `fns: ptr Altcpfunctions`
21:18:35FromDiscord<djazz> yeah
21:18:39FromDiscord<Elegantbeef> Right that's wrong
21:18:45FromDiscord<Elegantbeef> `distinct object` is a generic constraint
21:18:47FromDiscord<djazz> i had issue with ptr to distinct object before crashing the compiler
21:18:59FromDiscord<Elegantbeef> That should just be `object`
21:19:01FromDiscord<djazz> unable to get the size etc
21:19:36FromDiscord<djazz> "If a type is not fully declared in your C headers but is still required for your project Futhark will generate a `type SomeType = distinct object` dummy type for it."
21:19:40FromDiscord<Elegantbeef> `distinct object` is for `proc doStuff(a, b: distinct object)` it allows you to use a typeclass in multiple places but bind to multiple times
21:19:56FromDiscord<Elegantbeef> That should just be `object`
21:20:00FromDiscord<Elegantbeef> Objects are already distinct
21:20:04FromDiscord<djazz> yeah
21:20:50FromDiscord<Elegantbeef> Fixing futhark should resolve that issue, but then there is the compiler issue that `distinct object` should be considered a generic type and error in usage anywhere that's not a parameter
21:22:17FromDiscord<djazz> changing distinct object to object for that type makes code compile and work!
21:22:24FromDiscord<djazz> @pmunch
21:22:41FromDiscord<Elegantbeef> Cmon djazz make an issue or PR πŸ˜›
21:22:49FromDiscord<djazz> so ptr to distinct object should be invalid?
21:23:01FromDiscord<Elegantbeef> `ptr distinct object` makes no sense
21:23:05FromDiscord<djazz> indeed
21:23:25FromDiscord<Elegantbeef> `type MyType = distinct object` is an alias not a new type
21:23:25FromDiscord<djazz> I can make PR to futhark but no idea how to fix it in nim compiler
21:23:41FromDiscord<djazz> make it error
21:23:44FromDiscord<djazz> and not crash
21:24:04FromDiscord<Elegantbeef> Right just make a min repro and an issue I might have a look later
21:25:16FromDiscord<Elegantbeef> Weird `distinct object` seems to not be an alias
21:25:20FromDiscord<Elegantbeef> Wild
21:25:37FromDiscord<djazz> thing is, distinct object is valid and does only crash under very specific circumstances
21:25:40FromDiscord<Elegantbeef> sent a code paste, see https://play.nim-lang.org/#pasty=aeazIEzCCzuV
21:25:47FromDiscord<djazz> as i only hit it while doing crazy stuff
21:26:05FromDiscord<Elegantbeef> Right but it should be disallowed as an instantiated type
21:27:03FromDiscord<Elegantbeef> sent a code paste, see https://play.nim-lang.org/#pasty=cbzSmOkdbWwj
21:27:17FromDiscord<djazz> I see
21:27:27FromDiscord<djazz> so in generics, not as a type
21:27:38FromDiscord<djazz> well, actual type
21:27:44FromDiscord<Elegantbeef> `distinct typeclass` is a generic parameter that allows you to provide multiple values for a single type since typeclasses are bound to their first usage
21:28:04FromDiscord<Elegantbeef> like `proc(v: SomeNumber): SomeNumber = assert v is typeof(result)`
21:28:39FromDiscord<Elegantbeef> All typeclasses are bound to their first usage in an instantiation as syntax sugar
21:28:57FromDiscord<Elegantbeef> So yea it should be disallowed anywhere that `object` is not allowed
21:29:31FromDiscord<Elegantbeef> sent a code paste, see https://play.nim-lang.org/#pasty=GrGaSInMRzDd
21:30:15FromDiscord<Elegantbeef> I assume what happens is that the `distinct` typesection does not know how to handle typeclasses so just emits a `distinct T`
21:31:10FromDiscord<Elegantbeef> sent a code paste, see https://play.nim-lang.org/#pasty=ATmMDjcMMowk
21:31:17*jmdaemon joined #nim
21:32:19FromDiscord<djazz> distinct object is special, it lacks fields and symbols apparently
21:35:11FromDiscord<djazz> so in futhark should it be {.incompleteStruct.} = object instead?
21:35:54FromDiscord<Elegantbeef> It should be `object` no?
21:36:18FromDiscord<djazz> nim cant know the size but C can
21:36:21FromDiscord<djazz> idk
21:36:34FromDiscord<Elegantbeef> I don't see why it wouldn't just be `object`
21:36:39FromDiscord<Elegantbeef> 0 sized objects are a mistake πŸ˜„
21:36:51FromDiscord<djazz> "The incompleteStruct pragma tells the compiler to not use the underlying C struct in a sizeof expression"
21:37:15FromDiscord<Elegantbeef> In what place is that needed with futhark?
21:38:13FromDiscord<Elegantbeef> An empty struct is 1 byte in Nim but 0 in C so I guess that's an issue
21:39:49FromDiscord<awesome3434> sent a code paste, see https://play.nim-lang.org/#pasty=NiZMPDICsUpb
21:40:10FromDiscord<djazz> in C header its just `struct altcp_functions;` and then the actual fields are in the C file
21:40:16FromDiscord<Elegantbeef> You're not going to be able to change how Nim generates closures
21:40:46FromDiscord<awesome3434> In reply to @Elegantbeef "You're not going to": Uhh, doesn't sound good
21:41:14FromDiscord<Elegantbeef> Well then make your own closure generator πŸ˜›
21:41:36FromDiscord<Elegantbeef> Then yea if there are no fields for the struct I guess incomplete struct makes sense↡(@djazz)
21:44:42FromDiscord<leorize> you can also just `= ptr object` it \:p
21:44:42FromDiscord<leorize> though that probably doesn't do what I think it would
21:48:43FromDiscord<djazz> I love it when nimble uses an old version of package from pkgs instead of pkg2 because it wants to..
21:49:00FromDiscord<djazz> I was like wtf why is it still generating with distinct...
21:49:51FromDiscord<djazz> nimble uninstall futhark doesnt remove it
21:49:59FromDiscord<djazz> because its not in pkgs2
21:50:01FromDiscord<Elegantbeef> That does make a new object which is a ptr type
21:50:02FromDiscord<Elegantbeef> So it's closer than distinct πŸ˜›
21:50:03FromDiscord<Elegantbeef> Unless that's to awesome
21:50:03FromDiscord<leorize> you don't get instantiation prevention, basically
21:50:03FromDiscord<leorize> not that it matters that much, I suppose
21:50:57FromDiscord<djazz> sent a code paste, see https://play.nim-lang.org/#pasty=qBpxfXDwBrkT
21:51:13FromDiscord<djazz> anonymous object
21:51:58FromDiscord<Elegantbeef> Just delete `pkgs` πŸ˜„
21:51:58FromDiscord<Elegantbeef> Or use atlas
21:52:00FromDiscord<leorize> it's not nimble fault really
21:52:02FromDiscord<leorize> it's actually the compiler's
21:52:03FromDiscord<leorize> nimble is not aware of pkgs anymore
21:52:10FromDiscord<leorize> in fact the only job nimble does is to download the deps, the compiler actually picks what to use, and it's shit at that
21:52:13FromDiscord<djazz> im too stupid for atlas
21:52:16FromDiscord<leorize> that can work with some macro magic
21:52:29FromDiscord<djazz> well, nimble works well _enough_
21:53:09FromDiscord<djazz> ah, you're right
21:53:37FromDiscord<djazz> piconim is calling nim intewrnally not nimble because checking deps 20 times when compiling took time
21:53:55FromDiscord<Elegantbeef> I've imagined that syntax djazz and I hate it
21:54:15FromDiscord<Elegantbeef> `proc doThing(val: typeof(MyType().a))` is awful
21:54:50FromDiscord<djazz> when you dont need the type. for whatever.
21:55:16FromDiscord<djazz> deleted old nimbledata.json, now it works
21:56:47FromDiscord<Elegantbeef> sent a code paste, see https://play.nim-lang.org/#pasty=LCriTyQxbyWW
21:56:54FromDiscord<Elegantbeef> There you go djazz terrible ness
21:57:18FromDiscord<djazz> omg
21:58:31FromDiscord<Elegantbeef> You of course cannot do `MyType(a: (300))` cause it's a distinct tuple
22:00:06FromDiscord<djazz> _"There's ~~an app~~ a macro for that!"_ What chatting with you feels like
22:00:11FromDiscord<djazz> πŸ˜„
22:00:26FromDiscord<Elegantbeef> We can go further
22:00:40FromDiscord<Elegantbeef> sent a code paste, see https://play.nim-lang.org/#pasty=zvoPVWNxLKfF
22:00:44FromDiscord<djazz> plss no, help me find a smaller example why the compiler crash insatead
22:00:49FromDiscord<djazz> aaaa
22:01:00FromDiscord<djazz> stoooppp
22:01:12FromDiscord<djazz> what have I done
22:01:16FromDiscord<leorize> compile with nin\_dbg and you should get an useful stacktrace
22:01:24FromDiscord<leorize> nim\_dbg, even
22:01:33FromDiscord<Elegantbeef> Let me buy the domain `arewezigyet.com`
22:01:42FromDiscord<user2m> Does anyone know how to bundle a python script into the nim executable? I'm using a python script with one of my NIM projects, and interoperating between the two with nimpy but I have to bring the python module into the same folder as the executable. I was wondering if there's a way to compile down to just the executable and how to lug around the python modules?
22:01:46FromDiscord<awesome3434> In reply to @Elegantbeef "Well then make your": And uh, is there any way to get the closure variables handled by the Nim compiler without having to deal with Nim closures? Accessing rawProc, rawEnv seems to spew the closure structure into C++ code nonetheless, if I'm not wrong
22:01:56FromDiscord<Elegantbeef> What's a NIM project?
22:02:02FromDiscord<user2m> nim
22:02:26FromDiscord<Elegantbeef> Nim closures expose none of the data of the environment to users
22:02:38FromDiscord<user2m> (edit) "how" => "not have"
22:02:39FromDiscord<Elegantbeef> So you need to make your own generator like the C++ lambda
22:02:42FromDiscord<awesome3434> Duhh
22:03:04FromDiscord<djazz> when using just rawProc/rawEnv and you not storing the actual closure proc anywhere makes it go out of scope and fail
22:03:09FromDiscord<djazz> I trie dit earlier today
22:03:29FromDiscord<djazz> so i just put the callback closure proc as it inside a ref object
22:04:03FromDiscord<djazz> just in case you run in to that
22:04:19FromDiscord<djazz> working with C is a joy
22:04:36FromDiscord<djazz> when it's wrapped in Nim
22:04:47FromDiscord<awesome3434> In reply to @djazz "when using just rawProc/rawEnv": Alright, thanks for letting know about that
22:05:02FromDiscord<Elegantbeef> Yea I mean they expose the pointers to them but they're type erased sadly
22:05:02FromDiscord<awesome3434> I'll try to do something with it then
22:06:31FromDiscord<djazz> https://gist.github.com/daniel-j/3689d53d9c04dd5f5ac404be8c6d3d53
22:07:00FromDiscord<djazz> I tried to do a small example similar to my crashing code but i could just not get the nim compiler to crash like that
22:07:11FromDiscord<djazz> this code is clean from distinct objects tho
22:07:29FromDiscord<Elegantbeef> Probably best to do something like `createClosure(bycopy a, byRef b): ##code here` and generate a `tuple[env: (typeof(a), when b is ref: typeof(b) else: ptr typeof(b)), prc: proc(a: typeof(a), b: ....)....]`
22:08:19FromDiscord<Elegantbeef> Guess that should be `var typeof(a)` inside of the proc
22:08:40FromDiscord<djazz> the interesting things happen between lines L56-L66
22:08:53FromDiscord<djazz> @awesome3434
22:09:32FromDiscord<djazz> should be GC safe and leak free but i havent verified
22:10:21*arkanoid quit (Ping timeout: 256 seconds)
22:16:34FromDiscord<djazz> I'm just waiting for ElegantBeef to eat up my inelegant code
22:16:37FromDiscord<djazz> πŸ˜„
22:16:45FromDiscord<djazz> PR to Futhark submitted.
22:16:48FromDiscord<Elegantbeef> Wait you want me to insult it?!
22:17:01FromDiscord<djazz> Constructively
22:17:05FromDiscord<Elegantbeef> sent a code paste, see https://play.nim-lang.org/#pasty=wENzMQmTNDxP
22:17:09FromDiscord<Elegantbeef> Why `else`
22:17:23FromDiscord<djazz> I would use case but case isnt static
22:17:32FromDiscord<djazz> i know else isnt needed
22:17:35FromDiscord<Elegantbeef> when does not have to be exhaustive, and in the case you get a third type that should be `{.error: "Unimplemented: " & $T.}`
22:17:50FromDiscord<djazz> good idea
22:18:35FromDiscord<Elegantbeef> Should `CbState` just be a `ref object`?
22:18:43FromDiscord<Elegantbeef> You only use it as such afaict
22:19:05FromDiscord<djazz> ref object dont support GC_ref/unref
22:19:12FromDiscord<Elegantbeef> They do
22:19:15FromDiscord<djazz> hm
22:19:25FromDiscord<Elegantbeef> `new CbState` makes a `ref object`
22:19:32FromDiscord<Elegantbeef> all `ref` types support `GcRef` and `GcUnref`
22:20:03FromDiscord<Elegantbeef> Also at line 63 you could do `let state = (ref CbState)(cb: cb)` regardless
22:20:40FromDiscord<djazz> the error pragma didnt work, it is unexpected in that location
22:20:57FromDiscord<Elegantbeef> ref objects don't support destructors so you'd need to do `proc =destroy(cbState: typeof(CbState()[]))`
22:21:06FromDiscord<Elegantbeef> Did not expect that
22:21:16FromDiscord<djazz> oh yeah it was destructors i confused it with
22:21:51FromDiscord<djazz> pros of ref object vs object with ref in front?
22:22:02FromDiscord<Elegantbeef> They're literally the same
22:22:06FromDiscord<djazz> k
22:23:21FromDiscord<Elegantbeef> sent a code paste, see https://play.nim-lang.org/#pasty=hBDACXtVgrnt
22:23:21FromDiscord<Elegantbeef> Internally it emits a anonymous object type
22:23:21FromDiscord<djazz> ah good 2 know
22:23:57FromDiscord<Elegantbeef> Ok so instead of `error` you can do `void or void` it's not as helpful but it works
22:24:11FromDiscord<Elegantbeef> sent a code paste, see https://play.nim-lang.org/#pasty=rOtvGBVoSwXk
22:24:24FromDiscord<Elegantbeef> Though you could use a template for the type
22:25:44FromDiscord<djazz> invalid `let state = new(CbState)(cb: cb)`
22:25:51FromDiscord<Elegantbeef> https://play.nim-lang.org/#pasty=myrXlNjbEWQQ to not spam code here
22:26:00FromDiscord<Elegantbeef> To bring up a macro yet again https://github.com/beef331/nimtrest/blob/master/staticcases.nim#L59-L63
22:26:09FromDiscord<Elegantbeef> Right
22:26:17FromDiscord<Elegantbeef> `CbState(cb: cb)`
22:26:18FromDiscord<djazz> with ref object
22:26:39FromDiscord<Elegantbeef> `new(CbState)` returns a `ref CbState` instance `state(cb: cb)` is invalid code
22:26:54FromDiscord<Elegantbeef> If it's a ref object the constructor heap allocates
22:27:12FromDiscord<Elegantbeef> If it's a value object you need to do `(ref CbState)(cb: cb)` to use the constructor syntax
22:27:41FromDiscord<djazz> I removed GC_ref now and it still works huh
22:28:02FromDiscord<Elegantbeef> Likely just lacking 0'ing of memory
22:28:34FromDiscord<Elegantbeef> if you remove the ref do `reset(cbState.cb)` inside the destructor
22:32:54FromDiscord<djazz> ah yea, reset, thanks
22:34:15FromDiscord<djazz> how do i know if it really got GC'd?
22:34:54FromDiscord<Elegantbeef> I'd say use valgrind but you're in embedded
22:34:57FromDiscord<Elegantbeef> So uhhh
22:35:19FromDiscord<djazz> this code is running on host
22:35:27FromDiscord<djazz> its just a closure toy
22:35:28FromDiscord<Elegantbeef> Ah then valgrind it
22:36:39FromDiscord<Elegantbeef> make sure you use `-d:useMalloc --debugger:native`
22:41:01FromDiscord<djazz> seems like just putting a closure on an object makes it leak? im not calling any callback stuff yet
22:43:14FromDiscord<Elegantbeef> Are you using orc or arc?
22:43:19FromDiscord<djazz> orc
22:43:59FromDiscord<Elegantbeef> What's your code now?
22:45:26FromDiscord<djazz> `total heap usage: 23 allocs, 20 frees`
22:46:02FromDiscord<djazz> gist updated
22:47:24FromDiscord<Elegantbeef> Your destroy is not properly destroying
22:47:30FromDiscord<Elegantbeef> You're leaking cause you're not managing memory
22:47:57FromDiscord<djazz> what can the destructor do?
22:48:00FromDiscord<Elegantbeef> `reset(cbstate.cb)`
22:48:09FromDiscord<Elegantbeef> It needs to destroy resources
22:48:11FromDiscord<djazz> reset needs a var type
22:48:18FromDiscord<Elegantbeef> Actually sorry was moved needs to do it now
22:48:40FromDiscord<djazz> does MyType need a destroy too? it has a callback
22:49:03FromDiscord<Elegantbeef> make a wasMoved hook reset the values then inside the destructor `if not cbState.cb.isNil: =destroy(cbState.cb)`
22:49:20FromDiscord<Elegantbeef> You only need destructors if you want to override behaviour
22:49:31FromDiscord<Elegantbeef> You wrote that destructor so you have to manage memory
22:50:05FromDiscord<djazz> removing it does not change valgrind
22:51:33FromDiscord<djazz> Callback does not have a =destroy
22:52:17FromDiscord<Elegantbeef> It does but `=destroy` is silly in 2.0 transition
22:52:20FromDiscord<djazz> non-var atleast
22:52:41FromDiscord<djazz> no change in valgrind
22:52:47FromDiscord<djazz> with var destroy
22:53:17FromDiscord<djazz> can you make a closure on a ref object that doesnt leak?
22:53:50FromDiscord<djazz> wasmoved is never called
22:54:17FromDiscord<girvo> In reply to @Elegantbeef "all `ref` types support": In arc/orc land, they inc/dec ref counts I'm assuming? I haven't actually checked
22:54:24FromDiscord<Elegantbeef> I'm going to assume it's the top level closures just being silly
22:54:25FromDiscord<Elegantbeef> Yes
22:54:30FromDiscord<djazz> yes, simple counter
22:55:24FromDiscord<Elegantbeef> Ah we're silly
22:55:47FromDiscord<Elegantbeef> `GcRunOrc()`
22:55:57FromDiscord<Elegantbeef> Nim does not call orc on end of program it seems
22:56:06FromDiscord<djazz> oh right
22:56:09FromDiscord<djazz> no leaks now
22:56:12FromDiscord<girvo> On second thought, lets not go to Nim #main, 'tis a silly place.
22:56:18FromDiscord<girvo> In reply to @Elegantbeef "Nim does not call": wat
22:56:20FromDiscord<girvo> why
22:56:24FromDiscord<Elegantbeef> Add that destructor back djazz and leak again
22:56:37FromDiscord<girvo> I guess coz "well its freed coz the process exited"?
22:57:00FromDiscord<Elegantbeef> No clue why it doesn't Nim's missing alot of "close program" features
22:57:15FromDiscord<Elegantbeef> There is no way to properly deallocate a .so either
22:57:40FromDiscord<girvo> In reply to @Elegantbeef "No clue why it": Yeah that's been true for a long time haha. Not usually that much of a problem, but doesn't play nice with some external tooling
22:57:47FromDiscord<djazz> wasMoved did nothing
22:57:54FromDiscord<djazz> destroy needs to be var
22:58:07FromDiscord<djazz> worst Nim 2.0 change imo
22:58:13FromDiscord<djazz> to make it non var
22:58:25FromDiscord<girvo> wait destroy takes a non var param now?
22:58:34FromDiscord<girvo> (we haven't moved to 2.0 yet)
22:58:47FromDiscord<djazz> yeah, var is deprecated notice
22:59:10FromDiscord<girvo> Interesting. Though does that mean I can have destructors run on non vars then now?
22:59:15FromDiscord<djazz> im sure there's logic to it but makes old code give warnings
22:59:19FromDiscord<Elegantbeef> Well `=wasMoved` is supposed to reset the data to clear the destructor
22:59:28FromDiscord<Elegantbeef> the destructor is supposed to destroy
22:59:33FromDiscord<Elegantbeef> wasmove is supposed to 0
22:59:57FromDiscord<djazz> right
23:00:13FromDiscord<shruggingllama02> I made a library where can I share it
23:00:36FromDiscord<Elegantbeef> @Phil
23:00:39FromDiscord<djazz> gist updated and leak free
23:00:51FromDiscord<Elegantbeef> Shit phil is offline
23:00:55FromDiscord<shruggingllama02> It's called fuckNiggers
23:01:00FromDiscord<shruggingllama02> Where can I share it
23:01:05FromDiscord<ElegantBeef> <@&371760044473319454> we're going to need to block the nope.chat domain
23:01:16FromDiscord<girvo> In reply to @elegantbeef "<@&371760044473319454> we're going to": Yeah seems it
23:01:17FromDiscord<shruggingllama02> Does anyone want to use my fuckNiggers library
23:01:24FromDiscord<shruggingllama02> @room
23:01:35FromDiscord<shruggingllama02> Anyone want to beta test fuckNiggers
23:01:47FromDiscord<djazz> what are these bots
23:01:52FromDiscord<girvo> Its one person
23:01:54FromDiscord<Elegantbeef> These arent bots sadly
23:01:56FromDiscord<shruggingllama02> 1000000018.webm https://media.discordapp.net/attachments/371759389889003532/1212172797879787602/1000000018.webm?ex=65f0dee4&is=65de69e4&hm=d01b233f81bafb7c3d3940865da5689559cce1427183617f82c904fe91f785fb&
23:02:05FromDiscord<shruggingllama02> Flame on niggere
23:02:09FromDiscord<djazz> nope
23:02:09FromDiscord<shruggingllama02> Flame on
23:02:20FromDiscord<Elegantbeef> Someone purchased a matrix domain and is spamming inane bullshit cause they can
23:02:22*advesperacit quit ()
23:02:24FromDiscord<shruggingllama02> That's me on Friday nights
23:02:31FromDiscord<shruggingllama02> Why
23:02:35FromDiscord<djazz> thanks mod
23:03:29systemdsucksany suggestions on a nim written program that separates cli and library functions
23:03:40FromDiscord<djazz> replacing GCRunOrc with GC_fullCollect
23:03:42systemdsucksit's mainly for reading and learning
23:03:48FromDiscord<Elegantbeef> Though it seems nope.chat is a legit matrix server maybe
23:05:39FromDiscord<voorhis> @room fuck niggers
23:05:39FromDiscord<voorhis> @room fuck niggers
23:05:39FromDiscord<voorhis> @room fuck niggers
23:05:41FromDiscord<voorhis> @room fuck niggers
23:05:43FromDiscord<voorhis> @room fuck niggers
23:05:45FromDiscord<voorhis> @room fuck niggers
23:05:47FromDiscord<voorhis> @room fuck niggers
23:05:51FromDiscord<Elegantbeef> Yardanico it's back
23:05:56FromDiscord<Elegantbeef> Can you block matrix domains?
23:05:58FromDiscord<voorhis> @room fuck niggers
23:05:59FromDiscord<voorhis> @room fuck niggers
23:06:01FromDiscord<voorhis> @room fuck niggers
23:06:03FromDiscord<voorhis> @room fuck niggers
23:06:05FromDiscord<voorhis> @room fuck niggers
23:06:10FromDiscord<voorhis> @room fuck niggers
23:06:10FromDiscord<voorhis> @room fuck niggers
23:06:11FromDiscord<voorhis> @room fuck niggers
23:06:17FromDiscord<voorhis> @room fuck niggers
23:06:17FromDiscord<voorhis> @room fuck niggers
23:06:17FromDiscord<voorhis> @room fuck niggers
23:06:24FromDiscord<voorhis> @room fuck niggers
23:06:26FromDiscord<voorhis> @room fuck niggers
23:06:32FromDiscord<voorhis> @room fuck niggers
23:07:36FromDiscord<Yardanico> i don't think so
23:07:42FromDiscord<Yardanico> i don't even think element has such functionality, and besides I only have mod rights
23:07:47FromDiscord<djazz> Interesting, ARC does leak
23:07:58FromDiscord<djazz> i guess its cyclic
23:08:00FromDiscord<Elegantbeef> Right mjolinir does have that functionality
23:08:33FromDiscord<Yardanico> yeah, you have to run that separate mjolnir service
23:13:38FromDiscord<Elegantbeef> People with too much time really ruin decentralisation πŸ˜„
23:22:17FromDiscord<nasuray> In reply to @systemdsucks "any suggestions on a": do you just mean an example of a hybrid project or something more complex?
23:25:42*KhazAkar quit (Read error: Connection reset by peer)
23:30:33FromDiscord<djazz> thank you @ElegantBeef ❀️ so much cleaner now <https://github.com/daniel-j/picostdlib/commit/66715c2cbe94d219db6f0ac99035bbce1012e042>
23:30:58FromDiscord<djazz> except for the `typeof(Socket[SOCK_STREAM]()[])` in =destroy
23:31:03FromDiscord<djazz> that is ugly
23:31:17FromDiscord<djazz> since i changed to ref object
23:31:54systemdsucksmaybe not too complex nasuray
23:32:57FromDiscord<Elegantbeef> Cmon djazz still using a macro for `ptr2ref`
23:32:57FromDiscord<Elegantbeef> sent a code paste, see https://play.nim-lang.org/#pasty=CgOzqNgGKFIF
23:33:04FromDiscord<Elegantbeef> why isnt that just `proc ptr2ref(val: pointer, T: typedesc[ref]): T = cast[T](val)`?
23:35:10FromDiscord<nasuray> In reply to @systemdsucks "maybe not too complex": I have a cli for an ANSI colored string library I wrote https://github.com/daylinmorgan/bbansi (it's not really documented but there isn't much code) for `.nimble` it basically means defining `srcDir` and `bin`
23:35:22FromDiscord<nasuray> (edit) "code) for" => "code)....for"
23:36:06systemdsucksthanks nasuray
23:36:39FromDiscord<Elegantbeef> @djazz is there a specific reason you have that `string | openArray[char]`? I don't see any specialisation for `string`
23:36:40*jmdaemon quit (Ping timeout: 268 seconds)
23:36:46FromDiscord<djazz> In reply to @Elegantbeef "why isnt that just": Before it was making a tmp var to hold ptr so i could emulate var with a template
23:37:08FromDiscord<djazz> In reply to @Elegantbeef "<@81390960805675008> is there a": Right… string is same i forgot
23:37:20FromDiscord<Elegantbeef> You're also using a macro where a template suffices
23:38:10FromDiscord<Elegantbeef> Finally `owned` means nothing now
23:39:11FromDiscord<djazz> Yea saw that owned didnt change anything
23:39:19FromDiscord<djazz> Now that its a ref
23:41:19FromDiscord<djazz> Can you make it just a template? <https://github.com/daniel-j/picostdlib/blob/master/src/picostdlib/net/picosocket.nim#L13>
23:42:03FromDiscord<djazz> It evolved from that
23:42:20FromDiscord<Elegantbeef> yep
23:43:10FromDiscord<Elegantbeef> sent a code paste, see https://play.nim-lang.org/#pasty=UqUikmzCAfbL
23:43:16FromDiscord<Elegantbeef> s/macro/template
23:44:21FromDiscord<djazz> Its very useful when dealing with C callbacks
23:44:34FromDiscord<djazz> Going to put it in more places
23:45:01FromDiscord<djazz> Before i had a separate cdecl proc calling nim proc to get var
23:46:53FromDiscord<djazz> Night