<< 24-08-2023 >>

00:26:07FromDiscord<heysokam> @ElegantBeouf damn this snippet is epic https://media.discordapp.net/attachments/371759389889003532/1144065063402094762/image.png
00:31:32FromDiscord<Elegantbeef> Cannot tell if sarcasm or not 😄
00:33:12FromDiscord<.maverk> ?? why is this ? https://media.discordapp.net/attachments/371759389889003532/1144066843431145632/test.PNG
00:33:32FromDiscord<Elegantbeef> Floating point impercision
00:34:01FromDiscord<.maverk> In reply to @Elegantbeef "Floating point impercision": why is it happening ?
00:34:22FromDiscord<steslos> If you look up how floating point numbers are stored, you'll see how they are approximate
00:34:23FromDiscord<Elegantbeef> Cause floats only have specific amount of bits
00:34:32FromDiscord<Elegantbeef> There is not a 2.35 inside of a 32bit float
00:35:28FromDiscord<.maverk> i understand now
00:35:49FromDiscord<.maverk> 32 is not enough to get the exact precision
00:36:06FromDiscord<.maverk> 0b . 0000000
00:36:26FromDiscord<Chronos [She/Her]> In reply to @Elegantbeef "There is not a": Oh wow
00:36:44FromDiscord<Chronos [She/Her]> That looks kinda painful ngl lol
00:37:06FromDiscord<Elegantbeef> That's why you format strings to what you want
00:37:21FromDiscord<.maverk> the nim compiler saved me papers and time
00:37:29FromDiscord<.maverk> i could calculate it manually
00:45:34FromDiscord<heysokam> In reply to @Elegantbeef "Cannot tell if sarcasm": ? why would that be sarcastic?
00:46:02FromDiscord<heysokam> i've wanted a damn todo tool in nim since forever, and you wrote it. thats just epic
00:47:07FromDiscord<Elegantbeef> Now modify it for `unimplemented`
00:49:27FromDiscord<heysokam> In reply to @Elegantbeef "Now modify it for": whats the difference?
00:49:53FromDiscord<Elegantbeef> unimplemented is sugar for `doassert false, msghere`
00:49:55FromDiscord<heysokam> i always use `{.error: "msg".}` for that
00:49:59FromDiscord<Elegantbeef> But also should produce a warning
00:50:17FromDiscord<Elegantbeef> Unimplemented is for marking code that's unimplemented as fatal, but not that you do not want to run
00:50:25FromDiscord<Elegantbeef> It's only for disabling code paths at runtime, not statically
00:50:48FromDiscord<heysokam> not following
00:52:57FromDiscord<Elegantbeef> sent a code paste, see https://play.nim-lang.org/#ix=4Em6
00:53:32FromDiscord<Elegantbeef> You do not want the compiler to stop compilation, you want the program to stop when it hits code that is unimplemented
00:55:42FromDiscord<acornes> hello, i am new to nim and recently wanted to find the pid of a process by using its executable name. i did some research and could only find answers pointing to using psutil-nim but that was made in the case that the pid is already known, is there a way of doing it simply in nim or are there no options?
00:55:59FromDiscord<acornes> In reply to @acornes "hello, i am new": specifically for windows
00:56:39FromDiscord<Elegantbeef> Did you search "Windows find pid by name"
00:56:39FromDiscord<Elegantbeef> Without Nim, but with C or C++
00:57:48FromDiscord<heysokam> In reply to @Elegantbeef "You do not want": i was thinking about something like this, but for the `unreachable` idea from Zig
00:58:06FromDiscord<acornes> In reply to @Elegantbeef "Did you search "Windows": i just did but im not used to c or c++ so im not understanding a lot of it
00:58:26FromDiscord<acornes> it also cuts of the includes so i dont know what theyre using
00:58:33FromDiscord<acornes> (edit) "of" => "off"
00:58:51FromDiscord<heysokam> sent a code paste, see https://play.nim-lang.org/#ix=4Em9
01:10:17FromDiscord<.maverk> is ``result`` still supported ? https://media.discordapp.net/attachments/371759389889003532/1144076178836168814/tst.PNG
01:10:41FromDiscord<heysokam> In reply to @.maverk "is ``result`` still supported": yes, but add is not valid for int
01:10:53FromDiscord<heysokam> result += i
01:10:56FromDiscord<heysokam> (edit) "result" => "`result" | "i" => "i`"
01:11:04FromDiscord<.maverk> i will try
01:11:49FromDiscord<.maverk> https://media.discordapp.net/attachments/371759389889003532/1144076566087868507/test42.PNG
01:11:52FromDiscord<.maverk> not working either
01:12:09FromDiscord<heysokam> In reply to @.maverk "i will try": you are not using the result
01:12:26FromDiscord<heysokam> `echo iterate()`↵or `discard iterate()`
01:12:47FromDiscord<.maverk> should i initialize it or what ?
01:12:49FromDiscord<heysokam> or `proc iterate() :int {.discardable.}= ....`
01:13:01FromDiscord<heysokam> In reply to @.maverk "should i initialize it": initialize?
01:13:35FromDiscord<heysokam> sent a code paste, see https://play.nim-lang.org/#ix=4Emd
01:14:14FromDiscord<heysokam> (edit) "https://play.nim-lang.org/#ix=4Emd" => "https://play.nim-lang.org/#ix=4Eme"
01:14:39FromDiscord<.maverk> sent a code paste, see https://play.nim-lang.org/#ix=4Emf
01:14:42FromDiscord<heysokam> point is that you need to be explicit. things don't just vanish behind your back like in other langs (like C or python)
01:15:01FromDiscord<heysokam> In reply to @.maverk "what does discard do": like `(void)thing` in C. it marks it explicitely as not being used
01:15:58FromDiscord<.maverk> In reply to @heysokam "like `(void)thing` in C.": but returns value !!!!
01:16:44FromDiscord<heysokam> In reply to @.maverk "but returns value !!!!": then use it !!!!
01:17:07FromDiscord<heysokam> you are not using it, so its crashing because it doesn't know what to do with what you are returning
01:18:43FromDiscord<acornes> sent a code paste, see https://play.nim-lang.org/#ix=4Emg
01:18:55FromDiscord<.maverk> but
01:19:03FromDiscord<.maverk> there is something confused me
01:19:52FromDiscord<.maverk> sent a code paste, see https://play.nim-lang.org/#ix=4Emh
01:19:58FromDiscord<.maverk> why does it require int ?
01:20:20FromDiscord<.maverk> i know int is either 32 or 64 depending on the system architecture type
01:23:41*lucasta_ joined #nim
01:24:18FromDiscord<.maverk> now i understand
01:24:29FromDiscord<.maverk> i fixed it
01:24:30FromDiscord<.maverk> sent a code paste, see https://play.nim-lang.org/#ix=4Emi
01:25:00FromDiscord<.maverk> for loop assigns the values to the architecture type by default
01:25:50FromDiscord<Elegantbeef> Or just `for i in 1u32..10u32`
01:26:00FromDiscord<Elegantbeef> Whoops `1i32..10i32`
01:26:01FromDiscord<.maverk> hhhh no i get the idea
01:26:10FromDiscord<.maverk> (edit) "no" => "now"
01:26:35FromDiscord<.maverk> In reply to @Elegantbeef "Or just `for i": what is u ?
01:26:42FromDiscord<.maverk> i am following a great book
01:26:49FromDiscord<.maverk> it makes nim amusing
01:30:06FromDiscord<heysokam> In reply to @.maverk "what is u ?": `u : unsigned int`↵`i : signed int`↵`f : float`
01:30:43FromDiscord<.maverk> In reply to @heysokam "`u : unsigned int`": prefixes and suffixes like c
01:31:12FromDiscord<heysokam> sent a code paste, see https://play.nim-lang.org/#ix=4Eml
01:31:57FromDiscord<heysokam> In reply to @.maverk "prefixes and suffixes like": more like math, really
01:32:12FromDiscord<.maverk> In reply to @heysokam "more like math, really": very interesting
01:33:56FromDiscord<Elegantbeef> You do not need the static block consts are implicitly static
01:38:47FromDiscord<heysokam> ty worked
01:45:11FromDiscord<Elegantbeef> My code snippets are already working, this is grand! 😄
01:49:58FromDiscord<.maverk> is ``result`` considered a keyword or an identifier in nim ?
01:50:35FromDiscord<Elegantbeef> It's an implicitly declared identifier
01:50:51FromDiscord<.maverk> In reply to @Elegantbeef "It's an implicitly declared": thanks bro
01:58:22FromDiscord<acornes> sent a code paste, see https://play.nim-lang.org/#ix=4Emu
02:00:04FromDiscord<acornes> this is isNumber:
02:00:11FromDiscord<Elegantbeef> Hard to say without more code
02:00:20FromDiscord<acornes> sent a code paste, see https://paste.rs/r4IMw
02:00:59FromDiscord<Elegantbeef> sent a code paste, see https://play.nim-lang.org/#ix=4Emv
02:01:03FromDiscord<Elegantbeef> Or whatever else you want in `except`
02:01:16FromDiscord<acornes> alright thank you
02:01:20FromDiscord<Elegantbeef> using parseutils you could even make a `tryparse`
02:02:44FromDiscord<acornes> but does this mean ill still have to write it 3 times?
02:02:49FromDiscord<acornes> for secondary and melee
02:03:19FromDiscord<Elegantbeef> sent a code paste, see https://play.nim-lang.org/#ix=4Emy
02:03:21FromDiscord<Elegantbeef> I mean yea you're doing 3 things
02:03:40FromDiscord<Elegantbeef> You could use an array and iterate over it instead
02:03:55FromDiscord<Elegantbeef> Especially since Nim has enum indexed arrays
02:04:17FromDiscord<acornes> ill try doing that then, thank you
02:05:33FromDiscord<Elegantbeef> sent a code paste, see https://play.nim-lang.org/#ix=4EmA
02:10:19FromDiscord<megaing> sent a code paste, see https://play.nim-lang.org/#ix=4EmB
02:14:46FromDiscord<Elegantbeef> Yea Nim's static generics are lackluster and generally require hacks to make work in cases
02:14:58FromDiscord<Elegantbeef> sent a code paste, see https://play.nim-lang.org/#ix=4EmE
02:15:28FromDiscord<Elegantbeef> sent a code paste, see https://play.nim-lang.org/#ix=4EmF
02:17:15FromDiscord<megaing> That last one doesn't work for me
02:17:31FromDiscord<Elegantbeef> Are you on Nim 2.0?
02:18:07FromDiscord<Elegantbeef> Actually it works all the way back to 1.0.0, so quit your lying, you liar!
02:20:58FromDiscord<megaing> The first back does work
02:22:07FromDiscord<megaing> Aha
02:22:27FromDiscord<megaing> The second one stops working if you use `Natural` instead of `int`, whereas the first works for both
02:24:14FromDiscord<megaing> My original syntax also works if I use `int` instead of `Natural`. I hadn't considered that mattering, so I didn't try that out
02:24:16FromDiscord<Elegantbeef> Yea generics are funky, the return type I think is generally checked before instantiation, which causes oddities
02:25:54FromDiscord<megaing> I guess I am going to use `int` instead of Natural. The fact that I use it as an array size will make it error anyway.
02:26:18FromDiscord<Elegantbeef> You'd think but `array[-1..-10, float]` is valid 😛
02:33:05FromDiscord<that_dude.> In reply to @acornes "i found out how": I know you found a solution, but have you looked at `winim`? I found this https://github.com/khchen/winim/blob/154d6c6ffb1f19fce684381cdba5e3f3a729053e/winim/inc/tlhelp32.nim#L117C13-L117C13
02:33:32FromDiscord<Elegantbeef> They have the C code, they should port it to Nim
02:33:54FromDiscord<Elegantbeef> It's like 25 loc they can surely port it
02:39:08FromDiscord<acornes> In reply to @that_dude. "I know you found": i did look at winim but couldn't find a straight forward way of solving my problem, ill try looking into it
02:40:03FromDiscord<Elegantbeef> It's literally the exact same as the C code in the end
02:40:49FromDiscord<that_dude.> There were a lot of C functions you used that are defined for nim use in the there
04:04:28FromDiscord<m4ul3r> Does {.inline.} set the attribute always_inline?
04:07:37FromDiscord<m4ul3r> sent a code paste, see https://play.nim-lang.org/#ix=4EmT
04:11:20FromDiscord<Elegantbeef> the inline pragma just emits whatever C does for inlining
04:27:42*ormiret_ joined #nim
04:28:00*LyndsySimon_ joined #nim
04:28:31*termer_ joined #nim
04:33:11FromDiscord<arathanis> "inline" is just a suggestion
04:34:19FromDiscord<m4ul3r> `static N_INLINE(void, mainmain_u14)(void)` Is what I see it doing, the N_INLINE is the suggestion then?
04:35:29*termer quit (*.net *.split)
04:35:29*ormiret quit (*.net *.split)
04:35:29*anddam quit (*.net *.split)
04:35:29*LyndsySimon quit (*.net *.split)
04:35:30*ormiret_ is now known as ormiret
04:35:31*LyndsySimon_ is now known as LyndsySimon
04:42:12*anddam joined #nim
04:43:01*termer_ is now known as termer
04:47:32FromDiscord<m4ul3r> I guess i can always inline with a template
04:47:56FromDiscord<m4ul3r> How do i return a value with template, I'm getting Error: no return type declared
04:48:10FromDiscord<Elegantbeef> You write an expression
04:48:44FromDiscord<m4ul3r> sent a code paste, see https://play.nim-lang.org/#ix=4En3
04:48:51FromDiscord<Elegantbeef> remove `return`
04:49:19FromDiscord<m4ul3r> If there are ints, just remove all returns?
04:49:23FromDiscord<m4ul3r> (edit) "ints," => "ifs,"
04:49:43FromDiscord<Elegantbeef> templates have to be expressions in that case
04:49:52FromDiscord<Elegantbeef> Though I still say just use a proc and annotate it inline
04:50:19FromDiscord<m4ul3r> wdym expressions?↵I've denoted inline and it's not inlining it
04:50:33FromDiscord<Elegantbeef> Did you make it a release build?
04:50:38FromDiscord<Elegantbeef> with `lto`?
04:51:06FromDiscord<Elegantbeef> sent a code paste, see https://play.nim-lang.org/#ix=4En4
04:52:24FromDiscord<m4ul3r> using -d:danger, lto optimizes the asm too much and breaks it
04:53:38FromDiscord<Elegantbeef> Lol
04:53:48FromDiscord<Elegantbeef> "I want it optimised but I do not want it optimised"
04:54:17termerjust remove functionality
04:54:23FromDiscord<m4ul3r> a dangerous balancing act i'm trying to do
04:54:23termerpeople don't talk about this enough
04:54:27termerif the loop is too slow, remove it
04:54:43termerIf the string logic is too slow, remove it
04:54:46FromDiscord<huantian> time to remove my entire program
04:54:53termerthat'll make it faster
04:54:55termerremove entire modules
04:54:56FromDiscord<Elegantbeef> Termer is on the good stuff tonight
04:54:57FromDiscord<Elegantbeef> Sleep
04:54:58FromDiscord<huantian> 'boutta `rm -rf /`
04:55:07FromDiscord<m4ul3r> sent a code paste, see https://paste.rs/aqhwk
04:55:10termerI actually had good sleep last night
04:55:21termerI'm the lowest stress level I've been in days
04:55:25FromDiscord<huantian> sent a code paste, see https://play.nim-lang.org/#ix=4En5
04:55:28FromDiscord<huantian> oh it didn't work
04:55:33FromDiscord<Elegantbeef> I just don't get the point of "I want it optimised but not fully optimised"
04:55:37termerfirst of all, don't rimraf
04:55:46termerthat's the end of list
04:55:48FromDiscord<m4ul3r> In reply to @Elegantbeef "I just don't get": PIC
04:55:48FromDiscord<Elegantbeef> Although I know someone was on some crypto shit of a "proved C compiler"
04:55:57termersay what
04:55:58FromDiscord<Elegantbeef> WSA!
04:56:04FromDiscord<Elegantbeef> I can should abbreviations aswell
04:56:07termerwhat's a "proved C compiler"
04:56:19termer"I can should"
04:56:27FromDiscord<Elegantbeef> Proofed\
04:56:30FromDiscord<Elegantbeef> shout
04:56:42termerso what's a proofed C compiler
04:56:52termeroptimization-proof?
04:56:54termerhehehe
04:56:57FromDiscord<Elegantbeef> Guaranteed to produce specific code
04:57:07termerSounds like you want a literal C compiler
04:57:27termerYou can get that with any C compiler by choosing the same options and the same version
04:57:29FromDiscord<Elegantbeef> I didnt get the point much myself, but it's about using code that is not optimised so there are no cryptographic explouts
04:57:39termerThat does make some sense
04:57:40FromDiscord<Elegantbeef> exploits
04:57:44termerI can understand that
04:57:47FromDiscord<Elegantbeef> Fuck who replaced my fingers with spaghetti
04:57:55termerBut I don't understand why you'd want to use C for that
04:58:02termerjust write the asm at that point
04:58:08termerNo extra steps and no speed penalty
04:58:20termerthe only speed penalty would be your own failure to optimize
04:58:54FromDiscord<Elegantbeef> https://hal.univ-lorraine.fr/hal-02975012
04:59:26*advesperacit joined #nim
04:59:55FromDiscord<Elegantbeef> Given I do not do anything crypto related, purposely slowing down your code is just asinine 😄
04:59:57termerInteresting description
05:00:21termerbut like I said, if you're worried about this, you should implement your algorithms in asm and export C symbols
05:00:34termerthat seems a lot more trivial than modifying a compiler
05:00:39FromDiscord<Elegantbeef> Just use Nim's inline asm 😄
05:01:00FromDiscord<Elegantbeef> Now why did m4uler here want to force inline code and care about the asm
05:02:31FromDiscord<Elegantbeef> Also of course after I say "I'll publish any code snippet that I write to a wiki" no one asks anything that requires code snippets
05:04:28FromDiscord<odexine> There is that MISRA compliant C compiler (AKA formally proven)
05:05:14*lucasta_ quit (Ping timeout: 258 seconds)
05:18:05*rockcavera quit (Remote host closed the connection)
05:20:26FromDiscord<m4ul3r> In reply to @Elegantbeef "Just use Nim's inline": ngl, nim's inline asm is just as powerful as c↵i like it- sometimes the compiler does things to it i don't like though
05:21:00FromDiscord<Elegantbeef> We're not talking about the same thing
05:21:07FromDiscord<Elegantbeef> inline asm is writing assembly in line
05:21:25FromDiscord<Elegantbeef> https://nim-lang.org/docs/manual.html#statements-and-expressions-assembler-statement
05:21:43FromDiscord<m4ul3r> that's what I'm talking about, i have that sprinkled in my code to do my jank
05:21:51FromDiscord<Elegantbeef> The hell are you doing
05:22:16FromDiscord<odexine> What
05:23:18FromDiscord<m4ul3r> https://media.discordapp.net/attachments/371759389889003532/1144139847695601816/7wr5z8.png
05:23:56FromDiscord<m4ul3r> position independent code for embedded device
05:35:29*xet7 joined #nim
05:37:20*xet7 quit (Remote host closed the connection)
05:37:40*xet7 joined #nim
05:56:06FromDiscord<terrygillis> Hi, is there anything in Nim resembling interfaces or rust dyn traits?
05:56:21FromDiscord<terrygillis> I checked concepts but theyre compile time only
05:56:26FromDiscord<Elegantbeef> iface and traitor
05:58:45FromDiscord<terrygillis> those libraries look great thanks
06:27:05*xet7 quit (Remote host closed the connection)
06:27:38*xet7 joined #nim
06:27:52*xet7 quit (Read error: Connection reset by peer)
06:28:01*termer quit (Ping timeout: 244 seconds)
06:29:14*xet7 joined #nim
06:29:33*xet7 quit (Remote host closed the connection)
06:30:28FromDiscord<arnetheduck> unittest2 getting a facelift: https://github.com/status-im/nim-unittest2/pull/31
06:31:48FromDiscord<arathanis> i thought they just recommended use testament
06:32:33FromDiscord<arathanis> this is lookin' pretty sweet tho
06:32:50FromDiscord<arathanis> using dots reminds me of pytest and I love pytest to death
06:33:52FromDiscord<Phil> In reply to @arnetheduck "unittest2 getting a facelift:": that is pretty sweet!
06:34:04FromDiscord<Elegantbeef> That build procedure is... yea 😄
06:34:43FromDiscord<arathanis> its building the compiler
06:35:30FromDiscord<arathanis> rip mac builds
06:35:41FromDiscord<Elegantbeef> Nah I'm just looking at the config.nims
06:38:27FromDiscord<Elegantbeef> Arne I do have to ask, how are the dots any better than `X: Passed, Y: Skipped, Z: Failed (time)`
06:39:30FromDiscord<arnetheduck> dots are printed while the tests are running to indicate progress
06:39:46FromDiscord<Elegantbeef> Right so just update the tests as they go
06:39:52FromDiscord<Elegantbeef> It's a bit more work, but more sane
06:40:22FromDiscord<Phil> But doesn't that spam your terminal with the string `X: Passed, Y: Skipped, Z: Failed (time)` a billion times?
06:40:42FromDiscord<Phil> In terms of information in the terminal displayed at once, a more compact dot format seems more... "pleasurable" to the eye?
06:41:19FromDiscord<arathanis> In reply to @isofruit "In terms of information": i agree with you
06:42:00FromDiscord<arnetheduck> In reply to @Elegantbeef "Right so just update": either requires capturing stdout or doing terminal wizardry far beyond its practical utility, but hey, write the PR and I'm happy to consider it
06:42:18FromDiscord<Phil> You can't edit a line in a terminal, right?
06:42:34FromDiscord<arathanis> you can with things like ncurses
06:42:34FromDiscord<arnetheduck> In reply to @isofruit "You can't edit a": you can, but it's an art, not a science
06:43:10FromDiscord<Phil> In reply to @arnetheduck "you can, but it's": In that case the "bang/buck" ratio seems to skew heavily in favour of dots, so makes sense
06:44:10*PMunch joined #nim
06:45:25FromDiscord<Phil> In reply to @arathanis "you can with things": And what does it do? Actually edit the line or do trickery ala writing a new line but hiding the old one by inserting 100 newline characters in between line-updates?
06:45:28FromDiscord<Elegantbeef> Yea Phil I was talking about writing over the terminal buffer
06:45:43FromDiscord<Elegantbeef> It uses control characters like it was an actual terminal
06:45:51FromDiscord<arathanis> In reply to @isofruit "And what does it": lets you write directly to any cell in the window
06:46:01FromDiscord<arathanis> disable normal echo and other terminal features
06:46:05FromDiscord<arathanis> you can use it to make TUIs
06:46:17FromDiscord<arathanis> (edit) "in" => "on" | "window" => "terminal"
06:46:18FromDiscord<Elegantbeef> Look at the windows user
06:47:30FromDiscord<arathanis> @Phil so ncurses lets you look up things like what is the width/height of the terminal in characters
06:47:38FromDiscord<arathanis> write directly to specific cells on that terminal
06:48:00FromDiscord<arathanis> it (or equivalent) is the underlying technology for traditional roguelikes
06:50:09FromDiscord<Elegantbeef> Anywho given it's just a status indicator, yea makes sense
06:50:29FromDiscord<Phil> I really should find some brainpower to wrap up my reactive lib.↵I want to do GUI, but I found having to set up keeping stuff in sync myself is annoying so I want observables
06:51:01FromDiscord<Elegantbeef> That's what elcritch is working on for figuro
06:51:24FromDiscord<Phil> @.elcritch You're working on observables?
06:51:47FromDiscord<Elegantbeef> I think slots/signals count for that
06:51:51FromDiscord<Elegantbeef> I might be too daft
06:53:21FromDiscord<Elegantbeef> https://www.youtube.com/watch?v=NsZyzbzHVMc a video demonstration of his current progress
06:54:09FromDiscord<arathanis> guh
06:54:13FromDiscord<arathanis> having to go to bed for work
06:54:15FromDiscord<arathanis> the curse
06:54:46FromDiscord<Elegantbeef> Couldn't be me
06:55:17FromDiscord<.elcritch> In reply to @isofruit "<@703717429230174229> You're working on": Yah, as @ElegantBeouf I'd guess signal / slots count as that
06:55:46FromDiscord<arathanis> In reply to @Elegantbeef "*Couldn't be me*": i just have to tell myself its ok cause i took friday off
06:55:49FromDiscord<arathanis> i have to survive one more day
06:56:47FromDiscord<Phil> In reply to @.elcritch "Yah, as <@145405730571288577> I'd": So basically you can register yourself to receive updates when a certain value gets updated and trigger a callback with the new value when it changes?
06:57:07FromDiscord<Phil> With the slot I'm assuming being the updateable value and the signal being the callback that gets executed?
06:58:20FromDiscord<arathanis> sounds like you need to read The Gang of Four
06:59:14FromDiscord<Phil> My dislike from stumbling over tons of OO mess made me hesitant on picking that one up in particularly since I've only ever heard it highly recommended from that crowd
06:59:42FromDiscord<arathanis> you can translate all its patterns outside OO
06:59:47FromDiscord<arathanis> its a great book
07:00:39FromDiscord<.elcritch> In reply to @isofruit "So basically you can": Yah, it's effectively that. Except it relies on ref object's, not generic types. Doing observables with non-ref types isn't really feasible. Still it'd be easy to do a `Wrapper[T]` and for any type. Here's the basics: https://github.com/elcritch/figuro/blob/main/tests/tslots.nim
07:01:24FromDiscord<Elegantbeef> Well it's feasible, but you just implicitly box it, so it's pointless
07:01:49FromDiscord<Elegantbeef> or you go full `pointer` and have 0 type safety
07:01:53FromDiscord<Elegantbeef> I'm sure Phil would love that
07:02:04FromDiscord<.elcritch> Yah, better to avoid such dark things 😉
07:02:32FromDiscord<.elcritch> Gang of Four is good, but 80% of the time you need to use one of the patterns is to work around OO stuff 🤣 Still it does have useful patterns
07:03:06FromDiscord<.elcritch> I was thinking of splitting out the slots / signals into their own thing too
07:03:16FromDiscord<Elegantbeef> My unlearned self just assumed gang of four was some fiction book
07:03:40FromDiscord<Elegantbeef> Then again no one should do OOP, so it probably is fiction
07:03:51FromDiscord<arathanis> In reply to @Elegantbeef "My unlearned self just": to be fair, it is not the actual name lol
07:03:57FromDiscord<arathanis> In reply to @Elegantbeef "Then again no one": OOP is perfectly fine
07:04:29FromDiscord<arathanis> ive seen people do the most heinous of things using every paradigm under the sun
07:04:43FromDiscord<Elegantbeef> "OOP is perfectly fine" No thank you
07:05:07FromDiscord<Elegantbeef> I will fight tooth an nail to avoid runtime dispatch
07:05:19FromDiscord<arathanis> hey, if you dont want to hear the truth nothin i can do ¯\_(ツ)_/¯
07:05:40FromDiscord<Elegantbeef> Oh I understand that OOP has it's places, but acting hyperbolic is like my thing
07:05:48FromDiscord<arathanis> haha for sure
07:05:52FromDiscord<arathanis> that is a very programmer thing to do
07:06:18FromDiscord<arathanis> i often find myself using procedural, OO, and functional in the same project
07:06:35FromDiscord<arathanis> that are just better suited for different things and I find combining them you get the most expressive maintainable code
07:06:41FromDiscord<arathanis> (edit) "that are just better suited for different things and I find combining them you get the most expressive maintainable code ... " added "basew"
07:06:43qwri've concluded, that OOP is probably perfectly fine for interpreted runtimes, like original OAK later known as java :)
07:06:43FromDiscord<arathanis> (edit) "basew" => "base"
07:07:44FromDiscord<.elcritch> In reply to @Elegantbeef "I will fight tooth": To quote you: "this hill I will die upon!"
07:08:29FromDiscord<arathanis> In reply to @Elegantbeef "I will fight tooth": which patch?
07:08:35qwr(there its kind of semidynamic compromise between performance and dynamic typing, of course the language frontend was pretty ugly in oak/java)
07:12:12qwrbut at language level, there is pretty few places, where OOP is the "perfect abstraction"
07:12:54qwrwhat you generally want is some kind of interfaces
07:12:58FromDiscord<Phil> In reply to @arathanis "which patch?": static vs. runtime dispatch
07:12:59FromDiscord<Elegantbeef> Inheritance is nice, but the whole other part of OOP is iffy
07:13:29FromDiscord<Elegantbeef> Personally i'd like to have some amount of row polymorphism where you can define types by a product of fields
07:13:32FromDiscord<Phil> Static dispatch is when the compiler knows for sure at compiletime that at this one place in your code you will definitely call this other proc from your code.↵It can hard-glue that together, it's faster.
07:13:44FromDiscord<arathanis> In reply to @isofruit "static vs. runtime dispatch": I was making a dis/this joke.
07:13:49FromDiscord<Phil> Ah check
07:13:55FromDiscord<arathanis> all good
07:14:03FromDiscord<arathanis> doesnt translate to text as well
07:15:07FromDiscord<Phil> In reply to @arathanis "OOP is perfectly fine": As for this:↵I find OOP just does not lead to decently readable code.↵Every time I see colleagues of mine wiring OOP concepts together with the goal of having as much "finished" code as possible where you only need to write new code to extend functionality via clever use of polymorphisms, it leads to mini-frameworks where you must grasp the entire thing at once to understand which 10 li
07:15:18FromDiscord<Elegantbeef> sent a code paste, see https://play.nim-lang.org/#ix=4Enp
07:15:32FromDiscord<Phil> It forces you to understand the entire system at once or have a manual that tells you "To add feature here, add new class there"
07:15:34FromDiscord<arathanis> In reply to @isofruit "As for this: I": This is misguided just-out-of-university thinking
07:15:43FromDiscord<arathanis> everyone creates cluster fucks that way
07:15:45qwrin most practical polymorphic code static dispatch can be achieved with monomorphisation, its tradeoff like most things
07:15:50FromDiscord<arathanis> and for some reason everyone starts there lol
07:15:51FromDiscord<Elegantbeef> Lol arath doesnt read the message....
07:15:59FromDiscord<Elegantbeef> Just instantly "Out of touched thinking"
07:16:23FromDiscord<arathanis> whatchu talkin' bout
07:16:30FromDiscord<arathanis> they are talking about polymorphism hell
07:16:47FromDiscord<arathanis> and inheritance abuse
07:17:02FromDiscord<Elegantbeef> Atleast here the message was instantly proceeded by your message
07:17:06FromDiscord<Phil> That, in fact, is a new word I haven't hear yet (polymorphism hell).
07:17:13FromDiscord<arathanis> ohhh that makes sense
07:17:21FromDiscord<Elegantbeef> Right qwr I use a ton of compile time polymorphism
07:17:22FromDiscord<arathanis> In reply to @isofruit "That, in fact, is": its a real thing lol
07:17:56FromDiscord<Phil> Inheritance abuse I'm not sure of. It's a single level of inheritance every-time and we make sure to keep it that way, and only really go there when interfaces don't make sense
07:18:17FromDiscord<arathanis> In reply to @isofruit "Inheritance abuse I'm not": that is at least sane, at most in rare cases you might have 2 levels of inheritance
07:18:24FromDiscord<arathanis> (edit) "have" => "need"
07:18:36FromDiscord<arathanis> beyond that is a path to chaos
07:18:47FromDiscord<Elegantbeef> This is why row polymorphism is cool, procedures are more like concepts so you do need to nest inheritances and call base methods
07:18:54FromDiscord<Elegantbeef> do not need to\
07:19:33FromDiscord<Elegantbeef> Though there is a whole runtime aspect to row polymorphism
07:19:55FromDiscord<Elegantbeef> Where you have structurally typed 'interfaces'
07:20:29FromDiscord<Phil> sent a long message, see http://ix.io/4Enr
07:20:29FromDiscord<Elegantbeef> So like `var a: seq[object[x, y: int]]` could take any object with `x, y: int` but it'd not lose it's type infromation
07:23:03FromDiscord<arathanis> In reply to @isofruit "But it leads to": see if I make something like this I just have the services noop on messages they dont care about
07:23:17FromDiscord<arathanis> having the publisher filter over the subscribers sounds... not fun
07:23:31FromDiscord<Phil> In reply to @arathanis "see if I make": I don't like the construct in general because I just lost the information what notifications get sent out where without doing in-depth research
07:23:33FromDiscord<arathanis> having the publisher open the firehose and let the subscribers decide if they care makes more sense to me
07:23:52FromDiscord<Phil> It's now implicit based on the injectable services in the environment
07:24:05FromDiscord<arathanis> just use kafka
07:24:12FromDiscord<arathanis> then you can tell everyone its "enterprise"
07:24:14FromDiscord<arathanis> cause you are using kafka
07:24:19FromDiscord<arathanis> (edit) ""enterprise"" => ""enterprise ready""
07:24:20FromDiscord<Phil> ActiveMQ
07:25:00FromDiscord<arathanis> In reply to @isofruit "I don't like the": well they got sent everywhere 😉
07:25:05FromDiscord<arathanis> everywhere just decided what they cared about
07:25:32FromDiscord<arathanis> unless you are firing it over a wire or network and not internally to something else that does that
07:25:46FromDiscord<arathanis> now we are falling into talking about architecture
07:25:54FromDiscord<arathanis> how do my wednesday nights always end this way????
07:26:03FromDiscord<Phil> In reply to @arathanis "well they got sent": That's what the code expresses, what the business need is "send a websocket notification when a message gets sent", and that just got obscured.↵And that shit gets obscured by OO is how I view most of it
07:26:53FromDiscord<Phil> (edit) "In reply to @arathanis "well they got sent": That's what the code expresses, what the business need ... is" added "is,"
07:28:10FromDiscord<arathanis> In reply to @isofruit "That's what the code": i feel like without actually seeing source code its hard
07:28:26FromDiscord<Phil> Note that my view is heavily coloured by webdev which I feel like is not a great fit for OO in general
07:28:27FromDiscord<arathanis> but ive worked with systems like this before and i did appreciate it when it was architected well
07:29:08FromDiscord<arathanis> In reply to @isofruit "Note that my view": so my personal opinion is that each pardigm shines in certain ways but people decide they have a One True Paradigm ™️ and force themselves to only use it
07:29:20FromDiscord<arathanis> (edit) "pardigm" => "paradigm"
07:29:29FromDiscord<arathanis> and then you get terrible bullshit
07:29:51FromDiscord<arathanis> most of my projects and applications are relatively equal parts procedural/object-oriented/functional
07:30:47FromDiscord<arathanis> what im trying to say is I feel for you @Phil
07:30:59FromDiscord<Phil> I think I'd need to see it to believe it
07:31:02FromDiscord<arathanis> I know the unnecessary complexity of which you speak
07:31:16FromDiscord<arathanis> I maintain a similar code base right now 🥲
07:31:30FromDiscord<Phil> I love learning and finding new ways of thinking, part of the reason why I'm at my current job because it taught me quite a bit in terms of new ways of structuring problems and approaches to problems
07:33:19FromDiscord<Phil> But at the same time the approaches I see not be nicely readable (which is basically what I value heavier than anything other than business requirements themselves) are almost always the OO ones.↵Maybe that's because I don't jive with them as well, I find that the control flow just becomes obscure and hard to follow (and thus: hard to debug)
07:33:39FromDiscord<arathanis> could be lack of exposure?
07:33:49FromDiscord<arathanis> i dont know. I do spend a lot of time ensuring all my code is easy to read and follow
07:34:27FromDiscord<arathanis> ive reached the point in my career that my approach to writing code is:↵> I want the next person who has to look at this to feel like I cared about them
07:34:54FromDiscord<Phil> That one I fully agree with
07:35:54FromDiscord<Phil> Not just agree with, it's pretty much my highest priority after the business requirements (or sometimes even before them, depending on if a small changes to the business requirements that does not sacrifice a lot improves the readability a lot)
07:36:21FromDiscord<Phil> (edit) removed "a"
07:39:55FromDiscord<arathanis> In reply to @isofruit "Not just agree with,": exaaaactly
07:40:02FromDiscord<arathanis> readability and maintainability first
07:41:04*xet7 joined #nim
07:41:55*xet7 quit (Remote host closed the connection)
07:52:56*xet7 joined #nim
08:24:39*PMunch quit (Quit: Leaving)
08:27:13*PMunch joined #nim
08:28:45*termer joined #nim
09:05:41FromDiscord<that_dude.> sent a code paste, see https://play.nim-lang.org/#ix=4EnO
09:06:45FromDiscord<Elegantbeef> Helps if you actually give generic parameters to the distinct types
09:07:30FromDiscord<Elegantbeef> sent a code paste, see https://play.nim-lang.org/#ix=4EnQ
09:07:50FromDiscord<that_dude.> Damn it's really that easy
09:08:15FromDiscord<that_dude.> I thought that it shouldn't matter if I'm don't actually care about what the generic parameters are holding
09:08:35FromDiscord<that_dude.> In the same way `proc delAll(c: var TimerContainer) =` is fine
09:12:52FromDiscord<that_dude.> Actually though, is there a reason that I can omit the `[T]` sometimes but not in this case?
09:18:58FromDiscord<Elegantbeef> Cause generic types need generic parameters
09:19:05FromDiscord<Elegantbeef> Inside a procedure it's a typeclass
09:19:28FromDiscord<Elegantbeef> `distinct EventContainer` is a generic alias so `MoveContainer` and `TimerContainer` were the same afaik
09:20:08FromDiscord<Elegantbeef> Well a generic without a parameter is a typeclass everywhere
09:21:05FromDiscord<Elegantbeef> sent a code paste, see https://play.nim-lang.org/#ix=4EnV
09:24:55FromDiscord<that_dude.> I'll need to chew on that for a bit. Does this mean that the compiler doesn't really understand the `distinct EventContainer[T]` part?
09:25:20FromDiscord<that_dude.> Because my train of thought is that, because they are assigned to different type names, there shouldn't be any confusion
09:25:48FromDiscord<that_dude.> When I use/request one of the two (move or timer)
09:26:21FromDiscord<that_dude.> Well `distinct EventContainer`
09:28:23FromDiscord<that_dude.> sent a code paste, see https://play.nim-lang.org/#ix=4EnW
09:29:21FromDiscord<Elegantbeef> Right `distinct seq` is just wrong
09:29:27FromDiscord<Elegantbeef> you can never specify the generic parameter
09:46:15*syl quit (Quit: C-x C-c)
09:48:03*syl joined #nim
10:14:27*azimut quit (Ping timeout: 246 seconds)
10:48:08*PMunch_ joined #nim
10:50:52*PMunch quit (Ping timeout: 248 seconds)
11:19:59*PMunch_ is now known as PMunch
12:43:17FromDiscord<.maverk> what am doing wrong ? https://media.discordapp.net/attachments/371759389889003532/1144250576159391754/tst.PNG
12:44:49FromDiscord<Phil> In reply to @.maverk "what am doing wrong": addr returns you a pointer.↵There is no stringification proc (`$`) for pointers
12:45:03FromDiscord<Phil> I take it you want the memory address?
12:45:09FromDiscord<.maverk> yes
12:45:13FromDiscord<.maverk> the memory address
12:47:35PMunchcast it to an integer
12:47:45PMunchAnd use `toHex` if you want a hex represantation
12:48:49FromDiscord<Phil> sent a code paste, see https://play.nim-lang.org/#ix=4EoD
12:48:55FromDiscord<Phil> (edit) "https://play.nim-lang.org/#ix=4EoD" => "https://play.nim-lang.org/#ix=4EoE"
12:49:04FromDiscord<Andreas> `cast[int]( name.addr )` and to just look at the pointer `addr(name).repr`
12:49:48FromDiscord<Phil> (edit) "https://play.nim-lang.org/#ix=4EoE" => "https://play.nim-lang.org/#ix=4EoG"
12:49:55FromDiscord<Phil> Wups had that still for ref types, you just wanted it to work with addr
12:58:08FromDiscord<.maverk> https://media.discordapp.net/attachments/371759389889003532/1144254313955348541/tst52.PNG
12:58:11FromDiscord<.maverk> guys it doesn't work
12:58:19FromDiscord<.maverk> 🙄
12:58:55FromDiscord<Phil> insert blinking gif here
12:58:56FromDiscord<odexine> ? Why are you casting to that
12:58:57FromDiscord<Phil> I need you to read your code
12:59:03FromDiscord<Phil> Very carefully
12:59:17FromDiscord<.maverk> In reply to @odexine "? Why are you": i want the memory address
12:59:28FromDiscord<odexine> Yes but what is myptra?
12:59:32FromDiscord<Andreas> `echo repr(myname.addr)`
12:59:42FromDiscord<.maverk> In reply to @odexine "Yes but what is": it stands for : my pointer address
12:59:44FromDiscord<odexine> You're supposed to cast to an integer right?
12:59:45FromDiscord<.maverk> so myptra
13:00:01FromDiscord<odexine> In reply to @.maverk "it stands for :": You dont cast into a variable, but a type
13:00:57FromDiscord<Phil> sent a long message, see http://ix.io/4EoJ
13:01:12FromDiscord<.maverk> https://media.discordapp.net/attachments/371759389889003532/1144255084994232380/52.PNG
13:01:13FromDiscord<Phil> (edit) "http://ix.io/4EoJ" => "http://ix.io/4EoK"
13:01:37FromDiscord<.maverk> i set the pointer to string
13:02:49FromDiscord<.maverk> https://media.discordapp.net/attachments/371759389889003532/1144255488041693184/31.PNG
13:03:00FromDiscord<Phil> That is, not what was suggested.↵Use `addr` to get the pointer.↵`cast[uint64]` to interpret that pointer as a number so you can print it to the terminal.
13:03:02FromDiscord<odexine> Don’t cast to a string
13:03:10FromDiscord<odexine> Cast to an integer
13:03:34FromDiscord<Phil> (edit) "is," => "is"
13:04:21FromDiscord<.maverk> aaah
13:04:23FromDiscord<.maverk> now works
13:04:28FromDiscord<Phil> sent a code paste, see https://play.nim-lang.org/#ix=4EoN
13:04:48FromDiscord<.maverk> https://media.discordapp.net/attachments/371759389889003532/1144255991920197722/42.PNG
13:05:31FromDiscord<odexine> Technically that’s wrong
13:05:44FromDiscord<Phil> I would highly suggest to use `uint64` unless you're on a 15 year old computer, then you may use `uint32`
13:06:10FromDiscord<odexine> In reply to @isofruit "I would highly suggest": Just use uint as is because it is pointer size
13:06:21FromDiscord<Phil> Fair
13:06:28FromDiscord<Phil> (edit) "Fair" => "Fair, forgot about that"
13:08:09FromDiscord<Phil> sent a long message, see http://ix.io/4EoQ
13:08:27FromDiscord<Phil> (edit) "http://ix.io/4EoQ" => "http://ix.io/4EoR"
13:09:01FromDiscord<.maverk> https://media.discordapp.net/attachments/371759389889003532/1144257051569168414/tst51.PNG
13:09:21FromDiscord<.maverk> this is the memory address what is it like this ?
13:09:28FromDiscord<.maverk> in decimal representation
13:09:35FromDiscord<odexine> That’s still technically wrong because you’re printing the address of the variable holding the address
13:10:07FromDiscord<odexine> Remove the second line (with myptr) and replace myptr with name on the third line
13:10:11FromDiscord<odexine> (edit) "Remove the second line (with ... myptr)" added "var"
13:11:13FromDiscord<.maverk> In reply to @odexine "Remove the second line": what should i remove ?
13:12:34FromDiscord<Andreas> try this https://zevv.nl/nim-memory/#_strings_and_seqs
13:16:40*lucasta joined #nim
13:16:53FromDiscord<.maverk> is addr a keyword in nim ?
13:17:50FromDiscord<odexine> Pretty much I think
13:18:08FromDiscord<odexine> (edit) "much" => "much,"
13:18:35FromDiscord<.maverk> In reply to @odexine "Pretty much, I think": thanks rika
13:19:25PMunchNot really: https://play.nim-lang.org/#ix=4EoS
13:19:31PMunchSeems like just another name to me
13:19:40PMunchBut most highlighters will highlight addr for you
13:25:23FromDiscord<.maverk> what is the library to work with memory addresses and pointers ?
13:26:15FromDiscord<nnsee> why would you need a library for that
13:26:26FromDiscord<nnsee> what would you even expect the library to do
13:26:58FromDiscord<.maverk> In reply to @nnsee "what would you even": i don't know to work with hex and octal numbers maybe
13:27:32FromDiscord<Andreas> thats only known to senior students - thats what i've heard
13:27:52FromDiscord<nnsee> hex and octal are just representations
13:28:01FromDiscord<.maverk> In reply to @nnsee "hex and octal are": yeah i know
13:28:07FromDiscord<nnsee> and the standard library has tools to represent numbers as hex or octal
13:28:13FromDiscord<.maverk> i thought maybe there should be a library
13:28:20FromDiscord<nnsee> you don't need a library for it
13:28:31FromDiscord<.maverk> what about the tohex function is it built-in in a library or the language itself ?
13:28:39FromDiscord<odexine> It’s in a library for Nim IIRC
13:28:50FromDiscord<.maverk> In reply to @odexine "It’s in a library": which library ?
13:29:00FromDiscord<heysokam> sent a long message, see http://ix.io/4EoU
13:29:29FromDiscord<heysokam> do it for learning, not stopping you. just making you aware in case you weren't
13:29:33FromDiscord<nnsee> In reply to @.maverk "which library ?": Google is your friend
13:29:37FromDiscord<nnsee> https://nim-lang.org/docs/strutils.html#toHex%2CT
13:29:50FromDiscord<heysokam> I also do stufflike that with --mm:none, but... its not the normal thing to do
13:30:13FromDiscord<heysokam> (edit) "http://ix.io/4EoU" => "http://ix.io/4EoV"
13:31:38FromDiscord<.maverk> In reply to @heysokam "In nim you usually": ref is a keyword ?
13:31:56FromDiscord<heysokam> In reply to @.maverk "ref is a keyword": yes
13:32:11FromDiscord<Andreas> maybe try this https://ramanlabs.in/static/blog/raw_memory_management_patterns_in_nim_language.html and sooner or later you become a senior-student.
13:32:42FromDiscord<m4ul3r> In reply to @.maverk "what is the library": The std lib is enough, you don’t really need another lib, but there’s one called ptrmath
13:33:51FromDiscord<heysokam> sent a code paste, see https://play.nim-lang.org/#ix=4EoW
13:34:10*rockcavera joined #nim
13:34:54FromDiscord<heysokam> `ref Type` is the way to go for 99.99% of the use cases
13:36:24FromDiscord<.maverk> In reply to @m4ul3r "The std lib is": https://media.discordapp.net/attachments/371759389889003532/1144263944433848380/tst.PNG
13:36:28FromDiscord<.maverk> stdlib doesn't exist
13:36:45FromDiscord<heysokam> In reply to @.maverk "stdlib doesn't exist": it exists as `system` and already imported by default
13:37:01FromDiscord<heysokam> then there are each `std/thename` separete modules
13:37:10FromDiscord<heysokam> (edit) "separete" => "separate"
13:38:39FromDiscord<m4ul3r> the standard lib is just everything in nim by default
13:38:45FromDiscord<.maverk> sent a long message, see http://ix.io/4EoY
13:40:44FromDiscord<nnsee> In reply to @.maverk "doesn't work ": where are you getting these names from?
13:40:54FromDiscord<nnsee> nobody ever mentioned `lib` or `stdlib`
13:41:18FromDiscord<nnsee> the `toHex` procedure can be found in `std/strutils`, just like the link I sent you says
13:41:49FromDiscord<Andreas> hey, when i was confused about smth, i often consulted https://learnxinyminutes.com/docs/nim/
13:42:24FromDiscord<.maverk> In reply to @nnsee "where are you getting": what about the ptrmath library
13:42:29FromDiscord<.maverk> how to import it ?
13:42:39FromDiscord<heysokam> In reply to @.maverk "doesn't work ": its either `system`, which exists and you cannot import↵or `std/os`, `std/strutils`, `std/strformat`, etc↵which you could also import like `import os`, `import strutils` and `import strformat`
13:43:14FromDiscord<.maverk> In reply to @heysokam "its either `system`, which": what about the ptrmath lib ?
13:43:15FromDiscord<heysokam> In reply to @.maverk "how to import it": you need to install them first with nimble
13:43:23FromDiscord<nnsee> In reply to @.maverk "what about the ptrmath": I don't know what that is
13:43:49FromDiscord<.maverk> In reply to @m4ul3r "The std lib is": .
13:43:53FromDiscord<heysokam> (edit) "In reply to @.maverk "how to import it": you need to install them first with nimble" => "sent a code paste, see https://play.nim-lang.org/#ix=4Ep1"
13:43:53FromDiscord<.maverk> he said ptrmath
13:44:18FromDiscord<heysokam> (edit) "https://play.nim-lang.org/#ix=4Ep1" => "https://play.nim-lang.org/#ix=4Ep2"
13:44:26FromDiscord<Andreas> its `ptr_math`
13:44:46FromDiscord<heysokam> tru
13:44:59FromDiscord<heysokam> (edit) "https://play.nim-lang.org/#ix=4Ep2" => "https://play.nim-lang.org/#ix=4Ep3"
13:45:06FromDiscord<.maverk> In reply to @Andreas "its `ptr_math`": that is true
13:45:13FromDiscord<.maverk> i am downloading it
13:45:36FromDiscord<.maverk> https://media.discordapp.net/attachments/371759389889003532/1144266262550151198/resr.PNG
13:46:25FromDiscord<nnsee> In reply to @.maverk "what about the ptrmath": please, do the bare minimum of reading the project's README before trying to use it :) https://github.com/kaushalmodi/ptr_math#installation
13:46:43FromDiscord<.maverk> In reply to @nnsee "please, do the bare": ok bro
13:48:03FromDiscord<heysokam> `ptr_math` seems to be outdated, btw↵ByteAddress is deprecated, and is no longer stored as an `int` in the background. So all this int math is outdated↵The internal representation of addresses should be `uint` to be correct↵https://github.com/kaushalmodi/ptr_math/blob/1ee3b7fe12f394edd5a1e2841491e8c2e9fd193b/src/ptr_math.nim#L63
13:48:32FromDiscord<heysokam> (edit) "is" => "adresses are" | "adresses areno longer ... storedoutdated" added "meant to be" | "outdated↵The" => "outdated (although it will work until its removed)↵The"
13:49:07FromDiscord<.maverk> wow it is amazing
13:49:15FromDiscord<.maverk> thanks guys
13:49:57*jmdaemon quit (Ping timeout: 245 seconds)
13:50:59FromDiscord<heysokam> this one is really helpful, lol. I wish I knew it existed!↵https://github.com/kaushalmodi/ptr_math/blob/1ee3b7fe12f394edd5a1e2841491e8c2e9fd193b/src/ptr_math.nim#L272
13:51:14FromDiscord<heysokam> unchecked arrays are a huge pain for interop with C
13:51:54NimEventerNew thread by Ariyo: New to nim... It looks interesting, but can it ... ?, see https://forum.nim-lang.org/t/10436
13:53:39*PMunch quit (Quit: Leaving)
14:10:14FromDiscord<Phil> In reply to @heysokam "unchecked arrays are a": Is an unchecked array basically "No idea how long, no idea how to check when it ends, good luck"?
14:13:26FromDiscord<heysokam> In reply to @isofruit "Is an unchecked array": yep. you need the adjacent `itemsCount` like it always happens in C
14:13:42FromDiscord<heysokam> in nim that field is internal, but in C you need to create it manually
14:13:44FromDiscord<Phil> adjacent as in you need to pass that in as an extra parameter=
14:13:47FromDiscord<Phil> (edit) "parameter=" => "parameter?"
14:13:48FromDiscord<heysokam> yeah
14:13:57FromDiscord<Phil> Why do C people hate themselves?
14:14:05FromDiscord<heysokam> i ask myself that everyday
14:14:10FromDiscord<heysokam> 😄 🙈
14:21:54FromDiscord<acornes> sent a code paste, see https://play.nim-lang.org/#ix=4Epa
14:22:42FromDiscord<Phil> Sounds like the code is on point, but either the path or the permissions to the file have changed
14:22:58FromDiscord<Phil> You execute the binary from exactly the same directory?
14:23:07FromDiscord<acornes> yea same directory
14:23:18FromDiscord<Phil> Have you checked the permissions to config.ini?
14:23:27FromDiscord<Phil> Like who has read-write permissions?
14:23:58FromDiscord<acornes> In reply to @isofruit "Have you checked the": well the thing is i originally did have a config.ini thru createConfigFile but i deleted it by accident
14:24:15FromDiscord<acornes> so i did used to have it and the code is still the same so i dont know why it no longer creates it
14:25:34FromDiscord<acornes> sent a code paste, see https://play.nim-lang.org/#ix=4Epc
14:26:45FromDiscord<Phil> How do you know it gets executed later?↵It gets executed on startup time so risky either way
14:27:25FromDiscord<odexine> What’s the code for write config
14:27:41*Phytolizer joined #nim
14:27:47FromDiscord<acornes> sent a long message, see http://ix.io/4Epe
14:27:55FromDiscord<Phil> That's part of parsecfg. You can in fact just run it if you copy-paste his 2 code-snippets into the same file (and delete the valorant part)
14:28:09FromDiscord<Phil> (edit) "his" => "their"
14:29:18FromDiscord<acornes> would it be better if createConfigFile is integrated within where it reads the config file and just hide createConfigFile from the main file
14:31:19FromDiscord<acornes> like this
14:31:20FromDiscord<acornes> sent a code paste, see https://play.nim-lang.org/#ix=4Epi
14:32:12FromDiscord<.maverk> In reply to @isofruit "Why do C people": because it is all about deprecation and old techniques
14:32:46FromDiscord<odexine> In reply to @.maverk "because it is all": Old behaviour
14:33:16FromDiscord<odexine> C code from maybe a few decades ago probably still works as is
14:33:25FromDiscord<odexine> Can’t say the same with many other languages including Nim
14:33:34FromDiscord<acornes> or to make the code in the main file to seem more consistent i modify createConfigFile to check if config.ini already exists and if it does not create the ini
14:33:46FromDiscord<acornes> so its still in the main file
14:39:42FromDiscord<.maverk> In reply to @odexine "Old behaviour": i worked with stdio.h
14:39:52FromDiscord<.maverk> especialy with tmpfile functions
14:39:54FromDiscord<.maverk> and setbuf
14:40:03FromDiscord<.maverk> i really dislike it
14:40:08FromDiscord<.maverk> old fashion
14:41:31FromDiscord<.maverk> did you guys check the mem i posted in #prog-memes
14:41:40FromDiscord<.maverk> 🤣
15:06:15*advesperacit quit ()
15:08:19NimEventerNew thread by SuaveSteve: Inferring type of zero-sized collection from usage, see https://forum.nim-lang.org/t/10437
15:30:37*advesperacit joined #nim
15:33:59*Phytolizer quit (Quit: Client closed)
16:03:52FromDiscord<treeform> In reply to @heysokam "me neither, but my": Gennie's goal was to port pixie and my other libs to python, C and C++ (they are different), as well as ruby, js, and even zig. And even back to Nim through DLL interface.
16:05:10FromDiscord<treeform> In reply to @isofruit "In fact treeform apparently": Yes I love WebSocks, why would any one use REST?
16:11:26*lucasta quit (Quit: Leaving)
16:14:22*krux02 joined #nim
16:20:09*arkanoid joined #nim
16:21:49arkanoidis there a workaround to get a set[int64]?
16:22:55arkanoidI have this C flags field which is mapped to an int64_t https://arrow.apache.org/docs/format/CDataInterface.html#c.ArrowSchema.flags
16:23:01qwrodexine: old C might work, and might not - a lot of undefined behaviour was once kind-of defined
16:24:09FromDiscord<odexine> In reply to @arkanoid "is there a workaround": A set of size 64 is not the same as a set[type of size 64]
16:24:37FromDiscord<odexine> use set[0..63] for what you want
16:25:00FromDiscord<odexine> Or 1..64 if that works better for your mental model
16:25:35arkanoidodexine, but what will that be mapped to, in C code?
16:25:43arkanoidI need ABI compatibility
16:27:21FromDiscord<odexine> The internal representation is not specified so it may change at any time so it is probably better to manually construct a bit field from the set instead of relying on casting it into an int64
16:27:39FromDiscord<odexine> But right now you can cast a set like that to an int64 and get the same behaviour
16:28:08FromDiscord<odexine> The first element of the type will set the first bit of the set’s internal representation
16:28:13arkanoidodexine, thanks. By "now" you mean is a new feature or something?
16:28:39FromDiscord<odexine> By now I mean right now, the internal representation could change in the future without warning
16:28:58FromDiscord<odexine> It’s been like this for a few years IIRC
16:35:36arkanoidodexine, thanks. I'm a bit confused on this subject as you can see
16:37:32arkanoidin this example https://nim-lang.org/1.4.0/manual.html#set-type-bit-fields MyFlag has sizeof(cint) which is 4, it means 32bits. If I do "set[cint]" I get Error: set is too large; use `std/sets` for ordinal types with more than 2^16 elements
16:38:13arkanoidwhy set[cint] doen't work, where set[MyFlag] does?
16:39:25arkanoidsizeof(MyFlag) == sizeof(cint)
17:14:10arkanoidI mean, this https://play.nim-lang.org/#ix=4EpU
17:20:27FromDiscord<.maverk> what is range[1..10] ????↵↵is it the same as doing 1..10 ???
17:39:14FromDiscord<odexine> In reply to @arkanoid "in this example https://nim-lang.org/1.4.0/manual.h": Sets don’t just care about the size of the element but also the amount of values
17:39:28FromDiscord<odexine> There are however many values in an integer of size 32 bits
17:39:43FromDiscord<odexine> And a set has to store all of those values, with one bit per value
17:39:58FromDiscord<odexine> That is a few kilobytes if not a few megabytes for one set
17:40:17FromDiscord<odexine> If you use the enum you only have a few values
17:41:00arkanoidodexine, I think I got it now, thanks
17:41:25arkanoidit's just this line I yet have to grasp "The first element of the type will set the first bit of the set’s internal representation"
17:42:05FromDiscord<dersnof> what's good resources to understand macros
17:42:33FromDiscord<odexine> Basically it doesn’t matter what value the first element of the type is, be it 0 (for the type 0..10) or 15 (for 15..25) they will both set the first bit in a set of that type
17:45:25FromDiscord<Phil> sent a long message, see http://ix.io/4EpZ
17:45:55FromDiscord<dersnof> hmm i dont understand anything explained in nim tutorial page lol 🤔 weird
17:56:32arkanoid"const void** buffers" would be "ptr UncheckedArray[pointer]" or just "UncheckedArray[pointer]" ?
17:57:49arkanoidI'd guess the first
18:05:17FromDiscord<odexine> First
18:07:08FromDiscord<Phil> sent a code paste, see https://play.nim-lang.org/#ix=4Eq3
18:07:40FromDiscord<Phil> (edit) "https://play.nim-lang.org/#ix=4Eq3" => "https://play.nim-lang.org/#ix=4Eq4"
18:08:58FromDiscord<dersnof> hmm
18:09:09arkanoidthanks
18:09:44*junaid_ joined #nim
18:10:23FromDiscord<Phil> It's all just patterns of NimNodes to replicate in the end, where the order of a very specific amalgamation of specific NimNode-kinds determines what something means.↵There are tools to make generating those easier, such as `quote do`, but imo it makes sense to first wrap your head around that it's all just NimNode patterns.
18:10:32FromDiscord<Phil> (edit) "patterns." => "patterns by dealing with NimNodes directly."
18:10:58FromDiscord<Phil> Though that's just my perspective, it's how learning macros worked for me
18:19:00FromDiscord<dersnof> where did you read tutorial btw
18:19:10FromDiscord<Phil> sent a long message, see http://ix.io/4Eq8
18:20:51FromDiscord<Phil> In reply to @dersnof "where did you read": I didn't actually read the macro part of the nim tutorial, I just chatted with beef and during those I understood a couple underlying principles, after which I read The starting paragraphs of https://nim-lang.org/docs/macros.html and it started clicking togehter
18:21:09FromDiscord<Phil> (edit) "In reply to @dersnof "where did you read": I didn't actually read the macro part of the nim tutorial, I just chatted with beef and during those ... Istarted" added "chats" | "understood" => "started to understand"
18:26:16FromDiscord<catnowblue> sent a code paste, see https://play.nim-lang.org/#ix=4Eqd
18:28:32FromDiscord<Phil> In reply to @catnowblue "I am getting an": What's your typedef for RevoltClient look like? Are any of the seq's you use here `auto`'d ?
18:28:38FromDiscord<catnowblue> yes
18:28:52FromDiscord<catnowblue> if I add generic type like a base class, it will throw like invalid type
18:29:20FromDiscord<Phil> How do you expect the compiler to figure out whether to fill that seq with `seq[int]` or `seq[string]` or `seq[Potato]` if all it gets is an empty-seq with now type definition 😄 ?
18:29:28FromDiscord<Phil> (edit) "now" => "no"
18:30:03FromDiscord<catnowblue> sent a code paste, see https://play.nim-lang.org/#ix=4Eqe
18:30:22FromDiscord<catnowblue> (edit) "https://play.nim-lang.org/#ix=4Eqe" => "https://play.nim-lang.org/#ix=4Eqf"
18:30:28FromDiscord<Phil> Your problem here is that the compiler never gets told "Well, this seq is a seq[Bla]".↵Just `seq` doesn't tell the compiler enoug, it must be able to figure out the specific type as necessary
18:31:23FromDiscord<catnowblue> here's an error
18:31:24FromDiscord<catnowblue> sent a code paste, see https://play.nim-lang.org/#ix=4Eqg
18:31:31FromDiscord<catnowblue> ReadyEvent is a child of a class
18:32:32FromDiscord<Phil> sent a code paste, see https://play.nim-lang.org/#ix=4Eqi
18:32:52FromDiscord<catnowblue> ooh
18:32:58FromDiscord<Phil> (edit) "https://play.nim-lang.org/#ix=4Eqi" => "https://play.nim-lang.org/#ix=4Eqj"
18:32:59FromDiscord<Phil> Generics are a lie
18:33:01FromDiscord<Phil> They are not real
18:33:10FromDiscord<Phil> They are just templates you hand to the compiler for copy pasting
18:33:15FromDiscord<catnowblue> damn I think tutorials never told me for this
18:33:42FromDiscord<Phil> It's one of those more fundamental principles that need to grok with you first but that imo aren't that "easy" to understand
18:35:21FromDiscord<Phil> sent a code paste, see https://play.nim-lang.org/#ix=4Eqm
18:35:33FromDiscord<Phil> (edit) "https://play.nim-lang.org/#ix=4Eqm" => "https://play.nim-lang.org/#ix=4Eqn"
18:36:01FromDiscord<catnowblue> isn't an union simply a solution for this? like how it goes in typescript?
18:36:02FromDiscord<Phil> The generic is used to generate new procs as needed.↵`proc x(y: auto): string = "Potato"` is just a shorthand for the `x[T](y: T): string` way of writing it
18:36:07FromDiscord<catnowblue> (edit) "isn't an union ... simply" added "type"
18:39:20FromDiscord<catnowblue> so how am I suppose to store array with exact same class except their method is a different type?
18:39:20FromDiscord<Phil> In reply to @catnowblue "isn't an union type": Nim, unlike typescript, has a limitation here:↵It must always generate fully typed code in the end - Typescript can weasel out of that in the end with any/unknown etc.). Nim can not. Nim may be able to use trickery or smart thinking to infer the type or use copy-paste instructions to generate explicit procs on the fly, but when everything is said and done everything in Nim must be comp
18:39:37FromDiscord<catnowblue> do I have to write every single event type just for that?
18:39:48FromDiscord<Phil> There's 2 ways:↵Either use Object variants or dynamic dispatch aka methods
18:39:55FromDiscord<Phil> (edit) "There's 2 ways:↵Either use Object variants or dynamic dispatch aka methods ... " added "and inheritance"
18:39:59FromDiscord<catnowblue> oh ok
18:40:14FromDiscord<catnowblue> I'm not sure what methods actually means
18:40:17FromDiscord<Phil> Object variants is the procedural way, polymorphism and inheritance the OO way.
18:41:06FromDiscord<Phil> Err that one goes a bit into a deeper subject of static dispatch vs. dynamic dispatch.
18:41:49FromDiscord<Phil> Which I'm not great at explaining because I'm only spending a fraction of my time dealing with it and basically only know enough that I know what to expect to happen at various points, but never had to do a deep dive.
18:41:56FromDiscord<_gumbercules> well, you can use parametric polymorphism in Nim without relying on inheritance
18:42:10FromDiscord<_gumbercules> parameteric polymorphism + concepts will get you a long way
18:42:21FromDiscord<catnowblue> what https://media.discordapp.net/attachments/371759389889003532/1144340938664202382/image.png
18:42:27FromDiscord<Phil> Note that the knowledge base you're working with here seems like typescript ^^
18:42:32FromDiscord<Phil> (edit) "^^" => "Gumb^^"
18:42:38FromDiscord<_gumbercules> mmm
18:42:44FromDiscord<catnowblue> In reply to @isofruit "Note that the knowledge": yes I am typescript
18:42:45FromDiscord<Chronos [She/Her]> Revolt? For revolt.chat? Just stuck out to me so I commented on it lol
18:42:47FromDiscord<_gumbercules> I'd advise against using `method`
18:42:52FromDiscord<catnowblue> In reply to @chronos.vitaqua "Revolt? For revolt.chat? Just": revolt.chat
18:42:55FromDiscord<_gumbercules> unless you really need to
18:43:14FromDiscord<Chronos [She/Her]> In reply to @catnowblue "revolt.chat": Eyyy
18:43:16FromDiscord<catnowblue> I attempt to write an API wrapper for Revolt.chat
18:43:20FromDiscord<catnowblue> written in Nim
18:43:30FromDiscord<catnowblue> currently I am stuck with event handlers, like things you know
18:43:48FromDiscord<Chronos [She/Her]> In reply to @catnowblue "what": Is there any reason why you can't use a proc here?
18:43:54FromDiscord<catnowblue> I know I could just do it untype, but the experience for other devs using my wrapper won't be good
18:44:04FromDiscord<Chronos [She/Her]> Untyped? What?
18:44:14FromDiscord<_gumbercules> Okay here's the fundamental difference - in object oriented languages you're associating methods with objects
18:44:22FromDiscord<catnowblue> In reply to @chronos.vitaqua "Untyped? What?": previous event handler I used doesn't use typed arguments
18:44:28FromDiscord<_gumbercules> and what method to invoke is determined at runtime dynamically - thus the dynamic dispatch
18:44:42FromDiscord<catnowblue> ooh
18:44:50FromDiscord<_gumbercules> this is because objects can inherit form one another and override the implementation of a method that's defined in the type they're inheriting from
18:45:11FromDiscord<_gumbercules> so if I have type A and type B inerhits from type A and they both define the proc `hello` - which `hello` do I invoke? A's or B's?
18:45:39FromDiscord<Phil> In reply to @catnowblue "what": Yeah the polymorphic way would be to not use generics at all and instead have explicit methods for each set of types you want to support in RevoltChat.↵The procedural way is pretty much object variants where a given object may be a limited set of N things at the same time and you need to deal with all of them everytime you want to use it
18:45:44FromDiscord<_gumbercules> now, procedural languages like C and Nim tend not to focus on objects or classes and instad focus on value types which are reperesnted as structs
18:45:54FromDiscord<_gumbercules> in C and just plain `object` in Nim
18:46:06FromDiscord<catnowblue> very interesing
18:46:10FromDiscord<_gumbercules> procs aren't like methods in that they're not associated with a givent ype or class
18:46:15FromDiscord<Chronos [She/Her]> sent a code paste, see https://play.nim-lang.org/#ix=4Eqr
18:46:26FromDiscord<_gumbercules> so there is no dynamism in terms of what procedure will be invoked
18:46:32FromDiscord<_gumbercules> bedcause objects can't inherit from one another
18:46:41FromDiscord<catnowblue> In reply to @chronos.vitaqua "Okay, so to pass": I'll check out that
18:46:49FromDiscord<_gumbercules> at least no tin the same way you can with `ref object`s in Nim
18:47:27FromDiscord<_gumbercules> to solve that lack of ability, people use generics or parametric polymorphism, object variants and concepts all which allow you to overcome certain aspects of this limitation
18:47:40FromDiscord<_gumbercules> generics or parametric polymorphism lets you define a procedure that can work wtih a number of types
18:47:42FromDiscord<Chronos [She/Her]> Because `typ` stores the exact type of event it is, you know what event it is exactly, and can use it as the appropriate type by using the enum to tell you which one it is
18:47:52FromDiscord<Chronos [She/Her]> In reply to @_gumbercules "to solve that lack": Generics also work for this yeah
18:48:00FromDiscord<_gumbercules> so something like `add[T](x, y: T): T)`
18:48:06FromDiscord<_gumbercules> (edit) "T)`" => "T`"
18:48:17FromDiscord<Phil> In reply to @chronos.vitaqua "Okay, so to pass": Minor correction:↵The enum ends in `Types` meanwhile the typ-type ends in `Type`
18:48:37FromDiscord<_gumbercules> concepts let you define an abstract type with certain constraints that each type which implements that abstract type will be checked for against
18:49:03*junaid_ quit (Remote host closed the connection)
18:49:21FromDiscord<Phil> (Honestly I'd leave concepts out of this one for now, the entire reasoning as to why doing dynamic-type-stuff in nim is hard is already throwing the book at them imo and requires some figuring out)
18:49:36FromDiscord<catnowblue> damn
18:49:36FromDiscord<_gumbercules> so I could have an abstract type named `Calculator` which could require that any implementation exhibit an `add` function - then I could have a `NumberCalculator` that has an `add` function that adds two numbers
18:49:43FromDiscord<catnowblue> anyway thanks you guys
18:49:48FromDiscord<_gumbercules> sure thing
18:50:37FromDiscord<Chronos [She/Her]> In reply to @isofruit "Minor correction: The enum": Ah sorry about that lol
18:51:51FromDiscord<Chronos [She/Her]> In reply to @catnowblue "anyway thanks you guys": Of course!
18:52:15FromDiscord<Chronos [She/Her]> In reply to @_gumbercules "concepts let you define": Yk I should really look into using concepts
18:52:47FromDiscord<Phil> sent a long message, see http://ix.io/4Equ
18:52:56FromDiscord<Chronos [She/Her]> Unrelated but I wonder if there's a library that makes async and threaded code play nicely together and why it would/wouldn't work great
18:53:09FromDiscord<Phil> (edit) "http://ix.io/4Equ" => "https://paste.rs/wNFcn"
18:53:18FromDiscord<catnowblue> I understand the actual typescript's typing
18:53:31FromDiscord<catnowblue> it exist only in the compiler, not in runtime
18:53:56FromDiscord<catnowblue> and to make it still enforce, you had to add third-party library like z to detect it
18:54:25FromDiscord<Phil> Yeh, that was folks adding typing back in to a dynamic language because it got really tiring checking that the input parameters were actually the type you needed ^^
18:55:16FromDiscord<Phil> Folks wanted to have the guarantees that static typing provides.↵The harder you are with your rules, the more guarantees you can give, but at the same time some stuff, particularly doing dynamic stuff, becomes harder in return
18:55:30FromDiscord<catnowblue> damn I see
18:56:45FromDiscord<Phil> And it is not like javascript doesn't, right before execution, needs to have figured out what type a thing will be.↵It's just that it isn't javascript that has to figure that stuff out, it's the engine that does, you shifted dealing with types basically into the so called "runtime" of javascript
18:57:13FromDiscord<Phil> (edit) "javascript" => "javascript, so that you never get to see it."
18:57:14FromDiscord<catnowblue> yeah
18:57:35FromDiscord<catnowblue> the easiest to discard is to add `any` or `unknown` anywhere
18:58:45FromDiscord<Phil> Nah I meant even ignoring typescript.↵When javascript instructs your CPU to add 5 and 9 together, somebody must have figured out somewhere that these are both numbers to add together
18:58:51FromDiscord<Phil> That somebody is the JS runtime.
18:58:58FromDiscord<Phil> (edit) "runtime." => "runtime (completely unrelated to typescript)."
18:59:03FromDiscord<Chronos [She/Her]> The JIT
18:59:22FromDiscord<Chronos [She/Her]> Oh I had someone argue that JS is a JIT language and not an interpreted language
18:59:27FromDiscord<Phil> Wait is my terminology crap there in calling the JIT a runtime?
18:59:41FromDiscord<Chronos [She/Her]> 🤷‍♀️
19:00:15FromDiscord<Chronos [She/Her]> Tbf we should be using JIT as an adjective and not as a noun too
19:00:30FromDiscord<Phil> In reply to @catnowblue "the easiest to discard": Anyway, back on topic:↵The JS has the JS runtime/JIT to deal with figuring out types and stuff for it - nim does not have this luxury as it deals with the CPU directly.
19:00:57FromDiscord<Phil> (edit) "In reply to @catnowblue "the easiest to discard": Anyway, back on topic:↵The JS has the JS runtime/JIT to deal with figuring out types and stuff for it ... -" added "before things get sent to the CPU for calculations"
19:01:40FromDiscord<Phil> (edit) "topic:↵The JS" => "topic:↵JS"
19:01:52arkanoiddamn, I'm failing to make sizeof set[MyFlags] == 8
19:03:06arkanoidhow can I tell nim compiler I want to OR up to 64 values, even if I have just 3 in MyFlags? it's for C interoperability
19:03:46Amun-Raset[] for C interop?
19:04:01*azimut joined #nim
19:04:42FromDiscord<Phil> In reply to @chronos.vitaqua "Tbf we should be": Shouldn't it be JITC?
19:04:47FromDiscord<Phil> just in time compiler?
19:05:04FromDiscord<Chronos [She/Her]> Yeah exactly
19:06:58FromDiscord<.maverk> In reply to @.maverk "what is range[1..10] ????": guys you didn't answer me
19:07:28FromDiscord<catnowblue> alright, this is the only viable response, just force typing into it no matter what anyway https://media.discordapp.net/attachments/371759389889003532/1144347257915838696/image.png
19:08:20FromDiscord<Phil> In reply to @catnowblue "alright, this is the": As stated, maybe object variants will also help you there if you need different types of fields on the object for different types of responses
19:08:33FromDiscord<Phil> But happy that you're finding your way forward slowly 😄
19:08:33FromDiscord<Chronos [She/Her]> In reply to @.maverk "guys you didn't answer": Ah sorry, no idea tbh
19:08:40FromDiscord<Chronos [She/Her]> Never used `range`
19:09:11FromDiscord<Chronos [She/Her]> In reply to @catnowblue "alright, this is the": Huh? Why can't your event handler dispatch the correct type?
19:10:14FromDiscord<Phil> sent a code paste, see https://play.nim-lang.org/#ix=4Eqy
19:10:38FromDiscord<Phil> (edit) "https://play.nim-lang.org/#ix=4Eqy" => "https://play.nim-lang.org/#ix=4Eqz"
19:10:40FromDiscord<Chronos [She/Her]> Tbh I should work on my own event handler library
19:11:04FromDiscord<Phil> (edit) "https://play.nim-lang.org/#ix=4Eqz" => "https://play.nim-lang.org/#ix=4EqA"
19:11:04FromDiscord<Chronos [She/Her]> Especially if I'm working on a chat app...but also, I feel like events will be very expensive to handle over time....
19:11:09FromDiscord<Chronos [She/Her]> Don't see a way around it though
19:11:39FromDiscord<catnowblue> In reply to @chronos.vitaqua "Tbh I should work": you could, with typed arguments and whatsoever
19:11:55FromDiscord<catnowblue> I've found one event handler library and it was directly imported from javascript
19:11:59FromDiscord<catnowblue> (edit) "javascript" => "nodejs"
19:12:17FromDiscord<Chronos [She/Her]> I actually have a synchronous event library that works, but the async parts were less great
19:12:20FromDiscord<Phil> Oh this is for compiling nim to JS?
19:12:23FromDiscord<Chronos [She/Her]> I can definitely fix that though
19:12:39FromDiscord<catnowblue> In reply to @isofruit "Oh this is for": I'm not compiling nim to js
19:12:45FromDiscord<catnowblue> compiling to C machine code
19:12:47FromDiscord<demotomohiro> @Arkanoid https://github.com/nim-lang/Nim/issues/21789
19:12:48FromDiscord<catnowblue> (edit) "compiling to C machine code ... " added "executable"
19:13:39FromDiscord<Phil> ... you can compile nim to C while importing libs from nodejs?
19:14:14FromDiscord<Chronos [She/Her]> In reply to @isofruit "... you can compile": That sounds painful and not great
19:14:23FromDiscord<Phil> I mean, if it even works
19:15:20FromDiscord<Phil> Like I have no concept on if it would work because the nodejs lib-code relies on having a runtime so somebody needs to provide that.↵Where that'd come from I have no clue, so my first assumption si that it doesn't work.↵But maybe some poor soul implemented some way to provide one in these scenarios? No idea
19:15:48FromDiscord<Chronos [She/Her]> https://github.com/Nimberite-Development/Trigger-Nim here is my event library rn, not super great, but I think I'll actually work on it right now-
19:16:13*azimut quit (Remote host closed the connection)
19:16:30*azimut joined #nim
19:17:55FromDiscord<Chronos [She/Her]> Was originally gonna be used for my MC server impl which I lost the energy for, for now aha
19:20:36FromDiscord<Chronos [She/Her]> Is it possible to accept a generic proc? That can have any arguments or return type?
19:32:21FromDiscord<Phil> In reply to @chronos.vitaqua "Is it possible to": Accept in what sense?
19:33:52FromDiscord<Phil> Note that generic procs aren't real, they're only there to generate "real" procs.↵You can of course accept procs of a specific type and have those be a generic parameter, such as ↵`proc myProc[T](otherProc: proc(x: T))`, but that's less accepting a specific other generic proc and more you having a generic proc yourself that in general accepts procs of the type that your first generic proc can generate.
19:34:27FromDiscord<Chronos [She/Her]> In reply to @isofruit "Accept in what sense?": Using it as a required type, like uhhh `type A[T: proc] = object` so that `T` has to be a proc of some kind
19:39:11FromDiscord<Phil> In reply to @chronos.vitaqua "Using it as a": Wait, you want to accept literally any proc ?
19:39:37FromDiscord<Phil> Oh wait, no, you just want to be generic over procs, damn I'm tired
19:40:09FromDiscord<Phil> Honestly I'm not sure, you can be generic over `object` and `ref object`... what does the compiler say?
19:40:21FromDiscord<catnowblue> In reply to @catnowblue "alright, this is the": actually since the websocket accepts json, I'm just gonna use JsonNode and it can convert to any type with jsony
19:40:42FromDiscord<catnowblue> a bit more raw for API wrapper, but at least it works
19:41:27FromDiscord<Phil> sent a code paste, see https://play.nim-lang.org/#ix=4EqG
19:42:13FromDiscord<Phil> In reply to @catnowblue "actually since the websocket": I highly recommend just using jsony from the jump without going over JsonNode.↵2 reasons:↵1) It's faster to go JSON string => Nim type↵2) I don't like JsonNode and you don't have to deal with an object variant so that's also a plus
19:42:32FromDiscord<Phil> (edit) "In reply to @catnowblue "actually since the websocket": I highly recommend just using jsony from the jump without going over JsonNode.↵2 reasons:↵1) It's faster to go JSON string => Nim ... type↵2)" added "type rather than JSON string => JsonNode => Nim"
19:43:15FromDiscord<catnowblue> problem with jsony is that it omitted other values outside of accepted values in a class, as I described below
19:43:16FromDiscord<Phil> Ohhh wait, I didn't think this through, you want JSONNode to encode all kinds of types
19:43:19FromDiscord<demotomohiro> sent a code paste, see https://play.nim-lang.org/#ix=4EqH
19:43:23FromDiscord<catnowblue> yes
19:43:30FromDiscord<catnowblue> that's what I mean
19:43:52FromDiscord<catnowblue> (edit) "below" => "above"
19:43:54FromDiscord<Phil> Fair.↵Note that JsonNode is basically an object variant for all kinds of things.↵You can write your own object variant to only have to deal with the specific things you want to allow
19:43:59FromDiscord<Phil> Customize it a bit basically
19:44:07FromDiscord<catnowblue> interesing
19:44:30FromDiscord<Phil> It's not really hard to write your own Object variant for a list of the basic types and if you e.g. have no use for JObject and JArray you can just leave those out
19:46:10FromDiscord<Phil> sent a code paste, see https://play.nim-lang.org/#ix=4EqI
19:46:26FromDiscord<Phil> Names for everything are of course freely chooseable, the entire "Kind" thing is more convention than anything
19:47:01FromDiscord<Phil> The above variant will always be one of the three specified kinds and thus either have the fields (kind, myStr), (kind, myNum) or (kind, myFloat)
19:48:16FromDiscord<Phil> Note that accessing `myNum`on an object variant where the kind is `str` will result in an error (same for a JsonNode where you try to get its int value when it actually is of kind JStr etc.)
19:50:13FromDiscord<catnowblue> interesing
19:53:25FromDiscord<Chronos [She/Her]> sent a code paste, see https://play.nim-lang.org/#ix=4EqK
19:53:51FromDiscord<Chronos [She/Her]> sent a code paste, see https://play.nim-lang.org/#ix=4EqL
19:57:20FromDiscord<heysokam> sent a code paste, see https://play.nim-lang.org/#ix=4EqN
19:57:30FromDiscord<heysokam> its `case kind: MyKind of ....`
19:57:49FromDiscord<Phil> Oh god damn, literally mixed up case and of
19:57:56FromDiscord<heysokam> yep
19:58:20FromDiscord<Phil> sent a code paste, see https://play.nim-lang.org/#ix=4EqO
19:58:27FromDiscord<Phil> (For any future reader, not you sOkam!)
20:08:40FromDiscord<heysokam> why everyone else and not me, what have i done :sadge:
20:08:49FromDiscord<heysokam> 😄
20:14:00FromDiscord<Phil> You corrected me! How dare you! 😛
20:34:00NimEventerNew thread by iffy1: Circular imports for procs, see https://forum.nim-lang.org/t/10438
20:34:26*jmdaemon joined #nim
20:41:42*xet7_ joined #nim
20:45:38*xet7 quit (Ping timeout: 246 seconds)
20:50:43FromDiscord<firasuke> So is updating a project to Nim 2.0.0 just that seemless lol
21:06:02*xet7__ joined #nim
21:08:21*anddam left #nim (WeeChat 4.0.1)
21:09:36*xet7_ quit (Ping timeout: 260 seconds)
21:10:40*advesperacit quit ()
21:10:44FromDiscord<Phil> Depends:↵If you do webdev chances are you'll get fairly inconvenienced by the entire db_connector move
21:11:28FromDiscord<Elegantbeef> In most cases it's as simple as just recompiling, but given the features of Orc you likely should rewrite code to optimise or use the new hooks
21:13:58FromDiscord<Chronos [She/Her]> Question: Is there a way to do something like `unpackVarargs` but with a normal tuple?
21:14:18FromDiscord<Elegantbeef> Of course, but what are you doing
21:15:06FromDiscord<Elegantbeef> sent a code paste, see https://play.nim-lang.org/#ix=4Er8
21:15:27FromDiscord<Chronos [She/Her]> Event system that allows for firing events with any parameters given
21:16:00FromDiscord<Elegantbeef> sent a code paste, see https://play.nim-lang.org/#ix=4Er9
21:16:03FromDiscord<Elegantbeef> But go write your macro
21:16:22FromDiscord<Andreas> In reply to @Elegantbeef "In most cases it's": hiho, regarding `toOpenArray`, i found lots of infos from you on the channel - is it still true that a `var openArray` on the receiving-side is the recommende [ reference from may.23 ] https://discord.com/channels/371759389889003530/371759389889003532/1104910311141675030↵or would you know some doc/writeup on this topic ? or in your code-repos ?
21:16:26FromDiscord<Chronos [She/Her]> In reply to @Elegantbeef "Personally I'd just say": That's not exactly nice for users to define their system around imo lol, so yeah I'll probably just use a macro
21:39:32FromDiscord<Chronos [She/Her]> sent a code paste, see https://play.nim-lang.org/#ix=4Erc
21:39:33FromDiscord<Chronos [She/Her]> Gonna try it now
21:42:58FromDiscord<Chronos [She/Her]> sent a code paste, see https://play.nim-lang.org/#ix=4Ere
21:44:24*xet7__ is now known as xet7
21:44:55*xet7 quit (Quit: Leaving)
21:45:18*xet7 joined #nim
21:50:50FromDiscord<.maverk> https://media.discordapp.net/attachments/371759389889003532/1144388373474193478/423w.PNG
21:51:03FromDiscord<.maverk> can you guys give me a link to the ptr math library
21:51:06FromDiscord<.maverk> i cannot find it
21:51:18FromDiscord<Elegantbeef> There is no ptr math in the stdlib
21:51:28FromDiscord<.maverk> where is it then ?
21:52:28FromDiscord<Elegantbeef> https://nimble.directory/search?query=ptr+math
21:53:35FromDiscord<.maverk> i found it
21:54:39FromDiscord<Elegantbeef> I'd hope so
21:55:13FromDiscord<.maverk> https://media.discordapp.net/attachments/371759389889003532/1144389475569512448/eew.PNG
21:57:34FromDiscord<Andreas> good evening beef would you know how to import all nim-files from a directory ? - in all fairness - would'nt that be cool ? i guess i'd ask 'cos it was while since that came up 🙂 and @Mirai did'nt you install it that great `ptr_math` this afternoon ?
21:57:48FromDiscord<Andreas> (edit) removed "it"
21:58:08FromDiscord<.maverk> In reply to @Andreas "good evening beef would": yes
21:58:18FromDiscord<.maverk> and should look at the docs to learn it ?
21:58:19FromDiscord<Elegantbeef> There is no built in way you need to use a macro
21:58:52FromDiscord<.maverk> (edit) "and should ... look" added "not"
21:59:25FromDiscord<firasuke> In reply to @Elegantbeef "In most cases it's": Oh how would I make use of the new features
22:00:28FromDiscord<Andreas> In reply to @Elegantbeef "There is no built": sry, just kidding - but the `ptr_math`-lib to me is a bit like, giving your kids the key to the closet where you keep the adult-movies and then saying "don't try this with the neigbours' daughter".
22:02:43FromDiscord<ElegantBeouf> <@&371760044473319454> someone on matrix shared a very suspicously named file
22:03:13FromDiscord<ElegantBeouf> Comically I think that killed the matrix bridge
22:03:28FromDiscord<ElegantBeouf> In reply to @firasuke "Oh how would I": You'd implement hooks if you were manually doing RAII before, or annotate parameters as sink where applicable
22:03:55FromDiscord<Phil> Test
22:03:58FromDiscord<Phil> We're live
22:04:54FromDiscord<Elegantbeef> hmmm
22:04:54FromDiscord<Elegantbeef> The hell
22:04:54FromDiscord<Phil> It appears the bridge doesn't like you specifically beef
22:04:55FromDiscord<Phil> wait nevermind I'm locked out as well
22:04:55FromDiscord<Yepoleb> ☹️
22:04:59FromDiscord<Elegantbeef> There we go
22:05:20FromDiscord<Yepoleb> just bridge things
22:07:35FromDiscord<Elegantbeef> Anywho andreas `ptrmath` is just a more type unsafe `ptr UncheckedArray[T]`
22:07:36FromDiscord<Andreas> In reply to @.maverk "and should not look": reading the docs is a really a good idea, go on, but AFAIR that lib might not be nim-version-2-ready - so-to-say maybe u get in trouble.
22:07:53FromDiscord<Elegantbeef> Meh it just implements operators for `ptr T`
22:09:45FromDiscord<Andreas> In reply to @Elegantbeef "Meh it just implements": i was thinking maybe consulting the nim-manuals upfront, so to learn a bit about nimble and all the other stuff..
22:12:08FromDiscord<Elegantbeef> Hey I'm not going to say no to learning 😄
22:15:05FromDiscord<Andreas> In reply to @Elegantbeef "Hey I'm not going": leasrning - i learned from a CppCon-video with the honorable Herb Sutter, that he's from Canada. When he was asked, he responded "I'm from Canada - i am a Canakki" 🙂 do you spell 'canakki' like so ?
22:19:26FromDiscord<Elegantbeef> I don't even know what canakki is supposed to mean
22:23:49FromDiscord<Andreas> In reply to @Elegantbeef "I don't even know": well, i guess its a funny notion that somebody is a born canadian-citizen - i'm just asking as i was suprised about the term - we have a very similar word here in germany - here its a strong course-word against foreigners - i'd not recommend to use in public.
22:24:28FromDiscord<Elegantbeef> Wait what's so funny about being born here
22:26:03FromDiscord<Andreas> In reply to @Elegantbeef "Wait what's so funny": well, i can't tell - but the CppCon-audience was laughing when he self-described as a 'canaki', maybe ?
22:27:06FromDiscord<Elegantbeef> Got a timestamped video? 😄
22:28:33FromDiscord<Elegantbeef> Wait did he say "canuck"?
22:28:56FromDiscord<Andreas> In reply to @Elegantbeef "Got a timestamped video?": was one of his more-recent, where descibes his `cppfron`-project - which BTW to me is like - make C++ alike Nim in the 2020's.
22:29:37FromDiscord<Andreas> In reply to @Elegantbeef "Wait did he say": it was a video - he spoke and ive no idea how to spell it out..
22:30:12FromDiscord<Elegantbeef> https://dictionary.cambridge.org/us/pronunciation/english/canuck
22:30:20FromDiscord<Andreas> (edit) "In reply to @Elegantbeef "Wait did he say": it was a video - he spoke and ive no idea how to spell it out.. ... " added "- so maybe 'canuck' -> so thats along kayaking/boating.."
22:31:15FromDiscord<Elegantbeef> Canuck quite literally just means Canadian, but it has some comedic associations due to stereotypes
22:32:42FromDiscord<Andreas> In reply to @Elegantbeef "Canuck quite literally just": is the comocal-part, along the lines : "somebody with or in a canooe/kayak" ?
22:32:57FromDiscord<Andreas> (edit) "comocal-part," => "comical-part,"
22:33:32FromDiscord<Andreas> (edit) "In reply to @Elegantbeef "Canuck quite literally just": is the comical-part, along the lines : "somebody with or in a canooe/kayak" ? ... " added "or other stereotypes ?"
22:34:29FromDiscord<Elegantbeef> No
22:36:35FromDiscord<Elegantbeef> https://youtu.be/04u58ifxmRA is likely what most people think about when they hear "Canuck"
22:42:36FromDiscord<Elegantbeef> Without seeing the video it very likely is he said "I'm a Canuck, eh" and you merged the `Canuck` and `eh` together
22:43:06FromDiscord<Elegantbeef> More suspiciously named files @Phil @yepoleb
22:44:40FromDiscord<Elegantbeef> But there we go @Andreas we solved the riddle of what was funny, of course it takes a german to wring all the comedy out of it
22:47:18FromDiscord<Andreas> In reply to @Elegantbeef "https://youtu.be/04u58ifxmRA is likely what": thx, super-funny, a bit alike Beavis & Butthead, really like it, these dudes have some serious fun - and beer and its ingredients - 'cmon that a seroius matter around here, too 🙂
22:48:36FromDiscord<Elegantbeef> And phil make sure you report the user when you ban them
22:48:40FromDiscord<Elegantbeef> Even though they're using new users it atleast can get that account banned from the matrix home server
22:48:45FromDiscord<Andreas> (edit) "In reply to @Elegantbeef "https://youtu.be/04u58ifxmRA is likely what": thx, super-funny, a bit alike Beavis & Butthead, really like it, these dudes have some serious fun - and beer and its ingredients - 'cmon that a seroius matter around here, too 🙂 ... " added "- i need to look th Sutter-vid up in zotero"
22:49:58FromDiscord<Elegantbeef> I'm betting that in all likely hood he said what I said and falling into the Canadian stereotype is what caused laughter, but your German ear only heard a single word and missed the stereotype, no point searching for it!
23:01:01*xet7_ joined #nim
23:04:18*xet7 quit (Ping timeout: 246 seconds)
23:15:58FromDiscord<heysokam> Is there something I can read to understand nim methods?
23:15:59FromDiscord<firasuke> In reply to @elegantbeef "You'd implement hooks if": Oh ok thanks
23:16:25FromDiscord<firasuke> By the way did the nimble packages website receive an update, it looks much better now
23:16:32FromDiscord<Elegantbeef> It did
23:16:52FromDiscord<Elegantbeef> https://github.com/georgelemon was the one behind the redesign
23:18:45FromDiscord<Elegantbeef> sent a code paste, see https://play.nim-lang.org/#ix=4Ery
23:25:48FromDiscord<heysokam> @ElegantBeouf can you think of something that requires method and cannot be done with just procs? 🤔↵Struggling to think of a single use for the concept that cannot be done without them
23:26:05FromDiscord<Elegantbeef> Runtime polymorphism
23:26:37FromDiscord<heysokam> k, i will reword↵can you think of something (with an example) that...
23:26:55FromDiscord<Elegantbeef> sent a code paste, see https://play.nim-lang.org/#ix=4ErA
23:26:57FromDiscord<Elegantbeef> There you go an example and everything
23:27:20FromDiscord<heysokam> why can you store different types in an array?
23:27:21FromDiscord<Elegantbeef> Runtime polymorphism requires object variants to replace, but in that case it requires changing the variant every single time
23:27:33FromDiscord<Elegantbeef> Runtime polymorphism
23:27:34FromDiscord<Elegantbeef> Inheritance
23:27:38FromDiscord<Elegantbeef> That's like the entire point of it
23:27:53FromDiscord<heysokam> yeah but they are different types. i thought that wasn't legal in any case
23:28:14FromDiscord<Elegantbeef> `B` is implicitly converted to `A` since the array is `array[2, A]`
23:28:35FromDiscord<etra> nim get's to decided when to build a VT?
23:28:38FromDiscord<heysokam> ic
23:28:48FromDiscord<Elegantbeef> In Nim inheritance allows freely upcasting
23:29:03FromDiscord<Elegantbeef> > nim get's to decided when to build a VT?↵Now try english
23:29:33FromDiscord<etra> lmao
23:29:36FromDiscord<etra> can't type shit today
23:29:43FromDiscord<etra> nim gets to decide when to build a virtual table?
23:29:54FromDiscord<Elegantbeef> Nim doesnt use a vtable
23:29:59FromDiscord<Elegantbeef> Nim presently uses case statements
23:30:03FromDiscord<etra> huh, then how it does rtti
23:30:30FromDiscord<Elegantbeef> Use a case statement and hope the compiler optimises it into a jump table
23:30:57FromDiscord<Elegantbeef> https://github.com/nim-lang/Nim/pull/21342 ringabout did have this PR to add vtables
23:31:13FromDiscord<etra> > A↵> A
23:31:30FromDiscord<Elegantbeef> > B↵> B
23:31:47FromDiscord<etra> I guess to get B you should use method?
23:32:03FromDiscord<.maverk> does nim check everything at compile time ?
23:32:19FromDiscord<Elegantbeef> That is the point of dynamic dispatch and why I wrote that example
23:32:29FromDiscord<Elegantbeef> How else does a statically compiled language do things
23:33:01FromDiscord<.maverk> are you replying me ?
23:33:07FromDiscord<Elegantbeef> Yes
23:33:17FromDiscord<Elegantbeef> Well the second sentence was
23:33:21FromDiscord<Elegantbeef> The first sentence was to etra
23:33:38FromDiscord<etra> I'm fucking dumb
23:33:43FromDiscord<etra> he was asking of a counterexample of methods
23:33:45FromDiscord<etra> lmao
23:33:49FromDiscord<etra> need. more. coffee
23:33:50FromDiscord<Chronos [She/Her]> Haha I distracted myself from my original goal-
23:34:08FromDiscord<etra> (edit) "of" => "for"
23:34:36FromDiscord<.maverk> In reply to @Elegantbeef "Yes": i am just asking
23:34:46FromDiscord<.maverk> there are some hidden stuff
23:35:37FromDiscord<heysokam> also, talking about inheritance. is inheritance possible with --mm:none?↵does inheritance depend on the `object of` or on the `ref object` part of the declaration?↵I've always seen both used at the same time, so I assume they both must be there. But wonder if there is only the need for the `of` 🤔
23:37:07FromDiscord<Chronos [She/Her]> sent a code paste, see https://play.nim-lang.org/#ix=4ErC
23:37:24FromDiscord<Chronos [She/Her]> All my code actually fits within 2000 chars as well as the error, shocking-
23:41:34FromDiscord<Elegantbeef> Why make a small repro when you can make two files and keep things that do work in!
23:42:00FromDiscord<Chronos [She/Her]> It's structured in a Nimble project aha-
23:42:11FromDiscord<Elegantbeef> And on top of it share code that compiles and runs
23:42:25FromDiscord<Chronos [She/Her]> Oh I can do that easily
23:42:28FromDiscord<Chronos [She/Her]> Hold on
23:42:30FromDiscord<Elegantbeef> Whoops nvm that's on me
23:44:35FromDiscord<etra> what's the function of the colon when setting the types?
23:44:47FromDiscord<etra> i.e. in here: `eventSystem.fire[:ListenerProc, (int,)]((2,))`
23:44:58FromDiscord<Elegantbeef> https://nim-lang.org/docs/manual.html#templates-limitations-of-the-method-call-syntax
23:45:10FromDiscord<Chronos [She/Her]> https://play.nim-lang.org/#ix=4ErD
23:46:36FromDiscord<Chronos [She/Her]> In reply to @etra "i.e. in here: `eventSystem.fire[:ListenerProc,": Here it's actually completely redundant lol and I did it just to show that the types line up and stuff
23:47:10FromDiscord<Elegantbeef> args doesnt have a length it's just a symbol
23:47:26FromDiscord<Chronos [She/Her]> Ah-
23:48:04FromDiscord<Elegantbeef> https://play.nim-lang.org/#ix=4ErE
23:48:06FromDiscord<Elegantbeef> Works fine
23:49:09FromDiscord<Chronos [She/Her]> `newlit` meaning a new literal I'd guess
23:49:31FromDiscord<Elegantbeef> Right, it can be used for any type emitting the nim literal equivlent
23:49:36FromDiscord<Chronos [She/Her]> Why would I need the bracket expression btw?
23:49:50FromDiscord<Elegantbeef> Cause that's how you access tuple fields
23:49:58FromDiscord<Chronos [She/Her]> Aah okay that makes sense
23:50:08FromDiscord<Chronos [She/Her]> I just yanked this from the code for unpacking varargs lol
23:50:11FromDiscord<Chronos [She/Her]> Thanks beef!
23:51:25FromDiscord<Elegantbeef> Well that's what you get for plagarizing
23:51:29FromDiscord<Elegantbeef> Think with your head not your copy paste
23:52:12FromDiscord<Chronos [She/Her]> sent a code paste, see https://play.nim-lang.org/#ix=4ErF
23:52:16FromDiscord<Chronos [She/Her]> In reply to @Elegantbeef "Well that's what you": Imagine using your head :p
23:52:36FromDiscord<Elegantbeef> What's line 8
23:54:12FromDiscord<Chronos [She/Her]> `var eventSystem = EventSystem[ListenerProc].new()` but line 38 on the code sent back from you is literally the same
23:54:32FromDiscord<Elegantbeef> Termux bug perhaps
23:54:52FromDiscord<Elegantbeef> Time to minimize to see if you can reproduce
23:55:03FromDiscord<Elegantbeef> You did change your `new` proc right?
23:55:08FromDiscord<Elegantbeef> So it actually allocated
23:55:09FromDiscord<Elegantbeef> Right....
23:56:10FromDiscord<Chronos [She/Her]> Wait
23:56:12FromDiscord<Chronos [She/Her]> Uh
23:56:22FromDiscord<Chronos [She/Her]> That was a change I read over-
23:56:25FromDiscord<Chronos [She/Her]> Aha
23:56:28FromDiscord<Chronos [She/Her]> Damn-
23:56:51FromDiscord<Elegantbeef> This kids is why you always use expressions when you can
23:57:36FromDiscord<Chronos [She/Her]> In my defense it is 12\:57
23:57:49FromDiscord<Elegantbeef> That's lunchtime
23:58:18FromDiscord<Chronos [She/Her]> Yeah that works aha
23:58:23FromDiscord<Chronos [She/Her]> In reply to @chronos.vitaqua "In my defense it": AM
23:58:35FromDiscord<Chronos [She/Her]> Now time to make it work with async-
23:59:44FromDiscord<Chronos [She/Her]> `asyncCheck` or `await`... I think using `asyncCheck` would be better because it'd let my code run at the same time as other events while also letting me catch the errors to log them without crashing the entire program
23:59:53FromDiscord<Chronos [She/Her]> Unless it's a defect which in that case you're fucked-