<< 03-12-2023 >>

00:03:15Amun-Raok, something optimizes them away: https://dpaste.com/89BSE2Q4M
00:11:37Amun-RaN_LIB_PRIVATE N_CDECL(NCSTRING, __lsan_default_options)(void);
00:18:05Amun-Raand N_LIB_PRIVATE is __attribute__((visibility("hidden")))
00:18:10FromDiscord<ElegantBeef> Bridge dieded
00:18:18FromDiscord<ElegantBeef> `dynlib` is for ensuring it does not get DCE'd away
00:18:20Amun-RaI wonder why it's N_LIB_PRIVATE
00:19:01Amun-Racan I mark exportc function with dynlib?
00:19:06FromDiscord<ElegantBeef> Yes
00:19:14FromDiscord<Chronos [She/Her]> That's what you're supposed to do, no?
00:19:36FromDiscord<Chronos [She/Her]> No use adding dynlib to a proc if the calling convention is still Nim
00:19:38FromDiscord<ElegantBeef> `exportc, dynlib` pair should disable DCE on a procedure and ensure it compiles in
00:19:51FromDiscord<ElegantBeef> You can use `dynlib` on a `nimcall`
00:20:02Amun-Rawell, not strings works, but the whole thing sigsegvs
00:20:04FromDiscord<ElegantBeef> A symbol does not need to be cdecl to be usable across the ABI
00:20:05Amun-Ranpw*
00:20:08Amun-Ranow*
00:20:10FromDiscord<Chronos [She/Her]> Yeah but using it as a shared library wouldn't be great, no?
00:20:17FromDiscord<ElegantBeef> `exportc:"...", dynlib` should work
00:20:30FromDiscord<Chronos [She/Her]> Ah welp
00:20:51Amun-RaSegmentation fault
00:21:38FromDiscord<ElegantBeef> Can also try `extern` but that should not change anything
00:22:28Amun-Raboth are now marked N_LIB_EXPORT thanks to dynlib
00:22:49FromDiscord<ElegantBeef> You should also mark it `cdecl` but since you're on linux that's neither here no there 😄
00:23:37Amun-Rafound it
00:23:46Amun-Raproc lsan_default_suppressions*(): cstring {.exportc: "__lsan_default_suppressions", dynlib, stackTrace: off.} =
00:23:59Amun-Rastack trace was the culprit
00:26:22Amun-Ra-> https://dpaste.com/AFHUHT774
00:28:27Amun-Rathanks for the dynlib hint
00:33:34Amun-Rawell, it does run, but suppressions are ignored, lsan is very picky, emit won
00:42:42FromDiscord<Phil> Beef!↔Any thoughts on system/channel vs threading/channel vs GAsyncQueue?
00:43:35FromDiscord<bostonboston> "why would you ever need more than one thread" -beef probably
01:51:04FromDiscord<ElegantBeef> Bridge moment
01:51:49FromDiscord<ElegantBeef> @Phil I do wonder if you can use `GAsyncQueue` with `move(myRef)`
02:30:10FromDiscord<bostonboston> is there a mapIt for arrays
02:31:34FromDiscord<_nenc> i think there is a lib for it
02:31:55FromDiscord<_nenc> https://github.com/choltreppe/arrayutils
02:59:47*nmz quit (Remote host closed the connection)
03:03:03*nmz joined #nim
03:20:39NimEventerNew thread by Nlits: Errors within async are not being raised, see https://forum.nim-lang.org/t/10724
03:53:16*cm quit (Quit: Bye.)
04:02:13*cm joined #nim
04:08:03*rockcavera joined #nim
04:09:06*NunavuT joined #nim
04:15:41*NunavuT quit (Remote host closed the connection)
04:16:02*NunavuT joined #nim
05:02:11*NunavuT quit (Remote host closed the connection)
05:02:30*NunavuT joined #nim
05:11:31*NunavuT quit (Remote host closed the connection)
06:02:19*Nunavut_ joined #nim
06:02:35*Nunavut_ quit (Remote host closed the connection)
06:02:55*NunavuT joined #nim
06:34:55*azimut quit (Ping timeout: 240 seconds)
06:58:56*xaltsc quit (Ping timeout: 252 seconds)
07:14:51*Jjp137_ joined #nim
07:15:10*Jjp137 quit (Ping timeout: 245 seconds)
07:31:41*rockcavera quit (Remote host closed the connection)
07:59:21*junaid_ joined #nim
09:05:48FromDiscord<Phil> I think I'm being silly here somewhere
09:06:11FromDiscord<bostonboston> Not everywhere?
09:09:14FromDiscord<intellij_gamer> NimNode is the wrong return↔Returned untyped
09:09:23FromDiscord<Phil> sent a code paste, see https://paste.rs/YPbKf
09:09:27FromDiscord<intellij_gamer> (edit) "return↔Returned" => "return↔Return" | "return↔Returnuntyped ... " added "(or void)"
09:09:32FromDiscord<intellij_gamer> (edit) removed "(or void)"
09:09:40FromDiscord<Phil> Argh, when you least expect it, yeah that was it, thanks
09:10:23FromDiscord<Phil> sent a code paste, see https://paste.rs/h4X6r
09:11:19*junaid_ quit (Quit: Lost terminal)
09:29:40FromDiscord<Phil> Can you figure out from which file a NimNode comes from?
09:30:11FromDiscord<ringabout> in system.nim I suppose
09:30:20FromDiscord<ringabout> But you can search with `NimNode`
09:30:52FromDiscord<Phil> Not the type, I mean I have a NimNode that was "registered" with a macro from me and I want to know which file did that
09:31:27FromDiscord<Phil> Mostly for an error message along the lines of "A proc with that name was already registered, see <file that did that>. Please change the proc name"
09:32:10FromDiscord<ringabout> I think you can get a lineinfo or something, at least you can use `error` in a macro
09:32:37FromDiscord<ringabout> https://nim-lang.org/docs/macros.html#error%2Cstring%2CNimNode
09:32:59FromDiscord<Phil> Yeah the issue is more that in terms of order you have File A calling macro A, which is fine.↔Then File B calls macro A and it throws an error.↔Now the generated code from the macro is in File B, but I want the name of File A
09:36:56FromDiscord<Phil> In reply to @ringabout "https://nim-lang.org/docs/macros.html#error%2Cstrin": Hmm I think that's problematic because I have the combination of 2 locations that cause the issue, so I'd want to provide 2 NimNodes here
09:37:06FromDiscord<Phil> Similar to how the redeclaration error message does it
09:37:06FromDiscord<ringabout> Sounds complex, but I suppose you can store the registered information along with the file info somehow in a compile-time table
09:38:44FromDiscord<ringabout> In reply to @ringabout "Sounds complex, but I": You stored the registered NimNode in a compileTime table and call `error` on it when the new one is with the same name
09:39:32FromDiscord<ringabout> Or store lineinfo somewhere => https://nim-lang.org/docs/macros.html#lineInfo%2CNimNode
09:39:41FromDiscord<Phil> Can I get error to do line breaks without having to do them myself in the string?
09:40:03FromDiscord<Phil> In reply to @ringabout "You stored the registered": It might be way easier, I have the NimNode in a Cachetable, I can just extract the lineinfo directly from there, just wasn't aware of lineinfo
09:40:15FromDiscord<ringabout> Yeah
09:43:12FromDiscord<arathanis> I think std/macros also has a `hint` that functions like `error` but without the blowing things up
09:43:20FromDiscord<arathanis> `warning` too
09:44:13FromDiscord<Phil> Aye, still want to do line breaks though 😛
09:44:22FromDiscord<Phil> sent a code paste, see https://paste.rs/NFucQ
09:44:43FromDiscord<arathanis> like, you want multiple lines for the message?
09:45:08FromDiscord<Phil> Yes, the triple quote strings sadly carry over all their white spaces that I'd want to nice looking indentation in my source
09:45:54FromDiscord<arathanis> `strutils.dedent`
09:46:41FromDiscord<arathanis> https://media.discordapp.net/attachments/371759389889003532/1180807308482183218/image.png?ex=657ec380&is=656c4e80&hm=25f16d36bfc06518d2e5c31b879074b55bb6e2b3b0820d3ca84aeaf109e52730&
09:48:05FromDiscord<Phil> sent a code paste, see https://paste.rs/yj3gE
09:48:57FromDiscord<arathanis> that should do it, yeah?
09:49:46FromDiscord<arathanis> whats the 8 for?
09:49:56FromDiscord<Phil> number of whitespaces to remove
09:50:06FromDiscord<arathanis> if you omit it it will remove all common leading whitespace
09:50:09FromDiscord<arathanis> is that not what you want?
09:50:24FromDiscord<Phil> If I do that it removes none of the whitespaces 😄
09:50:36FromDiscord<Phil> And 8 is fine, leaves "otherProcLine" with some indentation which is neat
09:51:30FromDiscord<arathanis> mine removes all the common whitespace when omitted
09:51:35FromDiscord<arathanis> thats very weird
09:51:36FromDiscord<arathanis> like this:
09:51:38FromDiscord<Phil> sent a code paste, see https://paste.rs/1Pkc2
09:51:46FromDiscord<arathanis> https://media.discordapp.net/attachments/371759389889003532/1180808585404489738/image.png?ex=657ec4b1&is=656c4fb1&hm=9988553b042a38af0e614ecf9a9dc2f28bc9b46d832b32fa6249363e32dff43e&
09:51:52FromDiscord<arathanis> https://media.discordapp.net/attachments/371759389889003532/1180808611123953754/image.png?ex=657ec4b7&is=656c4fb7&hm=9ceb4f0dbe363dd365e6874c7c72037cc24aac9aefb156caa278a992b993a2ea&
09:52:28FromDiscord<arathanis> so it should still leave extra indentation on your otherProcLine section
09:52:40FromDiscord<arathanis> since its just finding the leading indent all lines have in common and removing it
09:52:51FromDiscord<arathanis> but if it really does not work w/o the 8 id be curious to find out why
10:04:46FromDiscord<intellij_gamer> Think cause Phil has the first line be on the opening """ so there is no common leading whitespace↔Should work without the 8 if put on a new line (So that it has common whitespace with the other lines)
10:05:01FromDiscord<arathanis> ahh you are right
10:05:29FromDiscord<arathanis> good call
10:06:37FromDiscord<arathanis> !e import std/[strformat, strutils]; echo dedent(&"{' '.repeat(4)}a\n{' '.repeat(5)}b\n{' '.repeat(6)}c\n")
10:06:50FromDiscord<arathanis> is that not working anymore or did I just forget how to do it
10:07:24FromDiscord<arathanis> sent a code paste, see https://paste.rs/5Mzr6
10:09:34FromDiscord<ringabout> sent a code paste, see https://paste.rs/54QSd
10:09:42FromDiscord<arathanis> (edit) "https://paste.rs/ySQtM" => "https://paste.rs/boqTz"
10:10:34FromDiscord<arathanis> In reply to @ringabout "You can also use": i think they explicitly want some newlines so you are just missing some `\n` in your exxample
10:10:37FromDiscord<arathanis> (edit) "exxample" => "example"
10:14:05FromDiscord<ringabout> Nice catch, I forgot to add `\n` for line breaks
10:14:20FromDiscord<Phil> don't the \n get printed as \n by error? They did whenever I tried
10:15:25FromDiscord<ringabout> Well, uses `\\n` or &"\n" I believe
10:18:55FromDiscord<Phil> \\n does not work for sure, why would `&"\n"` (concatenating a "\n" string) be any different than just having \n inside the string itself?
10:20:35FromDiscord<ringabout> What do you mean it didn't work? I remember similar cases worked for me
10:21:42FromDiscord<Phil> `{.error: "Potato\\nPotato".}`↔`Error: Potato\nPotato`
10:22:10FromDiscord<Phil> What the....
10:22:57FromDiscord<Phil> Oh damn it, it's the fact I'm in a fmt string
10:23:26FromDiscord<ringabout> Does't `{.error: "Potato\nPotato".}` work too
10:23:29FromDiscord<ringabout> (edit) "Does't" => "Doesn't"
10:24:31FromDiscord<ringabout> sent a code paste, see https://paste.rs/WFGgu
10:24:37FromDiscord<Phil> sent a code paste, see https://paste.rs/Nc0Pq
10:24:51FromDiscord<Phil> It does, but `{.error: """Potato\nPotato""".}` doesn't
10:25:03FromDiscord<Phil> And that's where I got caught up
10:25:25FromDiscord<Phil> Because while prototyping I didn't jump back from triple quote to single quote
10:27:09FromDiscord<that_dude.> In reply to @bostonboston "is there a mapIt": A bit roundabout, but you could use toSeq on arrays and then use everything else from sequtils
10:27:23FromDiscord<ringabout> Well, there is a workaround
10:29:24FromDiscord<ringabout> sent a code paste, see https://paste.rs/QYIVB
10:33:57NimEventerNew thread by Charles: Re.findBounds doesn't return all matches, see https://forum.nim-lang.org/t/10725
11:13:05FromDiscord<Phil> sent a code paste, see https://paste.rs/cABk5
11:16:11NimEventerNew thread by AntonioFS: Operators., see https://forum.nim-lang.org/t/10726
12:32:50FromDiscord<intellij_gamer> Could maybe have like a global variable `registered` that you set to true when `generateRoutingProc()` is called. Then have `clientRoute` error if that's true. So you get any errors if trying to register after everything is generated
12:33:43FromDiscord<intellij_gamer> Probably need to make the global be a macrocache thingy so that your code doesn't break with IC
12:47:58FromDiscord<pr0c_mm3r> is learning nim after learning python a good ideea
12:49:38FromDiscord<classid> hey guys, is nim a good language to learn. I do know some python
12:49:46FromDiscord<classid> Or should I know C already?
12:55:34FromDiscord<inventormatt> C is not necessary to learn nim and coming from python can be beneficial but you also need to learn how to utilize nim paradigms versus typical python paradigms
13:03:03FromDiscord<Phil> Given I've been programming in nim for 2 years by now and I'm just now even cursory dealing with C, you can get by just fine without
13:03:38FromDiscord<Phil> It starts becoming necessary when you get more into the weeds of things like writing bindings to GTK or the like, but that's something you wouldn't do in python either, you'd use a lib.
13:03:49FromDiscord<Phil> (edit) "lib." => "lib that does that for you."
13:08:40FromDiscord<rakgew> @classid \: I would second Phil. I am also coming from python and enjoyed learning nim right away. in contact with C I only got when dealing with not yet wrapped C-libraries.
13:28:35FromDiscord<piqueiras> oh wait nim 2 is already out of beta and everything
13:30:19FromDiscord<piqueiras> just came back to it for advent of code lmao
13:47:37FromDiscord<griffith1deadly> hi, i'm using ModernNet (a library) for reading data from a byte seq, but for some reason I'm getting incorrect behaviour on Windows, but correct behaviour on Linux? The code for the library is here: https://github.com/Nimberite-Development/ModernNet/blob/master/src/modernnet/buffer.nim#L112-L116↔↔example: my nickname by client is "griffith1deady", but on windows i get "griffith1deadyd", and on linux i get "griffith1deady"
13:49:16FromDiscord<Chronos [She/Her]> It's a very odd bug :p
13:50:15FromDiscord<griffith1deadly> (edit) "hi, i'm using ModernNet (a library) for reading data from" => "sent" | "byte seq, but for some reason I'm getting incorrect behaviour on Windows, but correct behaviour on Linux? The code for the library is here: https://github.com/Nimberite-Development/ModernNet/blob/master/src/modernnet/buffer.nim#L112-L116↔↔example: my nickname by client is "griffith1deady", but on windows i get "griffith1deadyd", and on linux i get
13:54:12FromDiscord<srabb> is the crown the nim mascot
13:54:15FromDiscord<srabb> or just the logo
13:54:26FromDiscord<srabb> or both
13:54:30FromDiscord<srabb> or neither
14:00:17NimEventerNew thread by LilKeet: Nimsuggest connection over sockets refused, see https://forum.nim-lang.org/t/10727
14:02:23*azimut joined #nim
14:07:10FromDiscord<Phil> My brain hurts over this a bit, but if you have a client and a server and you have a type "ClientMessage".↔What in your mind is that type for?
14:07:26FromDiscord<Phil> Like what's your interpretation?↔This is mostly about naming a variable
14:11:15FromDiscord<odexine> In reply to @isofruit "My brain hurts over": use "client reply" or "client response" or "client request" or w/e else
14:13:56FromDiscord<Chronos [She/Her]> In reply to @griffith1deadly "hi, i'm using ModernNet": This is truly baffling honestly-
14:18:37FromDiscord<Phil> And then I have a routing proc on the server for messages going server <= client↔And a routing proc on the client for messages going server => client↔↔And all of that naming has confused me so bad I just found at least 5 places where I mixed them up
14:19:21FromDiscord<Phil> sent a long message, see https://paste.rs/W4NNp
14:19:33FromDiscord<odexine> if you want, even though it really isnt one, you could call them broadcasts
14:19:45FromDiscord<odexine> since theyre non-request response
14:20:10FromDiscord<odexine> or take naming from pubsub too
14:20:11FromDiscord<odexine> idk
14:21:01FromDiscord<Phil> It's not that I don't have names for both parties in one message.↔↔It's that I have both parties and both parties take both roles (server/client, publisher/subscriber) to each other
14:21:41FromDiscord<Phil> (edit) "https://paste.rs/hsQT3" => "https://paste.rs/wb6fX"
14:21:47FromDiscord<Phil> And that naming gets very easy to mix up. So you need a name that distinguishes messages going A => B from equivalent messages going A <= B.
14:22:13FromDiscord<Phil> I mean it works now so I have my solution, but I'd love a better naming scheme
14:23:15FromDiscord<Phil> (edit) "https://paste.rs/udhez" => "https://paste.rs/69scm"
14:23:41FromDiscord<odexine> i mean
14:23:48FromDiscord<odexine> serverbroadcast clientbroadcast
14:23:52FromDiscord<odexine> serverpublish clientpublish
14:23:58FromDiscord<odexine> serverevent clientevent
14:26:16FromDiscord<Phil> Wait, still need different names for the things that get published.↔So still ServerMessage and ClientMessage, just that server publishes a ServerMessage instead of server sending a ServerMessage
14:27:21FromDiscord<Phil> sent a long message, see https://paste.rs/dkz93
14:33:53FromDiscord<Chronos [She/Her]> In reply to @griffith1deadly "hi, i'm using ModernNet": Should this be reported as a Nim bug then? Since, I see no reason why this should be happening
14:34:06FromDiscord<odexine> In reply to @isofruit "Wait, still need different": Then use the event one
14:36:06FromDiscord<Phil> I mean same thing. Is a serverEvent something that occurs on the server because it was pinged? Or is it omething that the server sends to the client to trigger something there?↔Seems similarly ambiguous as message to me right now, though that might be fatigue speaking
14:47:39FromDiscord<odexine> I don’t think you will ever find a terminology that would satisfy your criteria without literally putting “sent” in the type name
14:47:43FromDiscord<odexine> Server sent message
14:48:57FromDiscord<odexine> A server event to me is a message informing clients that an event has occurred for the server, in the context of messages
14:49:41FromDiscord<odexine> In general, I believe most people interpret subjects in type names as the sender and not the recipient
14:49:59FromDiscord<odexine> I should sleep I have not slept in 31 hours you go ask beef or something
15:23:37FromDiscord<Phil> ... can I tell the "noSideEffect" pragma to shut up same as gcSafe by casting?
15:23:56FromDiscord<Phil> Because I kinda want to be able to log the output of another thread but that is definitely not "noSideEffect", which a proc for `createThread` demands
15:24:06FromDiscord<Phil> (edit) "output of" => "what happens on"
15:28:28FromDiscord<Phil> sent a code paste, see https://paste.rs/Q0mRB
15:29:15FromDiscord<Phil> sent a code paste, see https://paste.rs/68gLR
15:33:50FromDiscord<Phil> Okay the problem seems to be the logger type, but why can't I have a seq of loggers, they're all the same datatype? Wth
15:35:43*azimut quit (Ping timeout: 240 seconds)
15:45:13FromDiscord<Phil> Argh, the fact I am logging at all is the problem, not the logger
15:47:24*krux02 joined #nim
16:07:11FromDiscord<Phil> Hmm when I'm inside of a proc and want to break out of a while-loop that is outside the proc, what are my options?
16:08:00FromDiscord<Chronos [She/Her]> In reply to @isofruit "Hmm when I'm inside": Return value :p
16:08:13FromDiscord<Chronos [She/Her]> `if breakTheLoopSomehowFromInside(): break`
16:08:21FromDiscord<Chronos [She/Her]> Just return a boolean and you're good
16:09:58FromDiscord<Phil> (edit) "Hmm when I'm inside of" => "sent" | "proc and want to break out of a while-loop that is outside the proc, what are my options?" => "code paste, see https://paste.rs/ua5n3"
16:10:14FromDiscord<Phil> Hmm I'm not sure I'm a massive fan of that, simply because the procs I'm calling are user-defined, aka I am the one providing the while-loop, the user the one providing the proc.↔If I base this on the return type of the proc, they can break the loop in every one of their procs, rather then when one specific proc gets called
16:11:42FromDiscord<Phil> I guess throwing a "kill"-exception would be another way but that feels also unclearn
16:11:44FromDiscord<Phil> (edit) "unclearn" => "unclean"
16:13:10FromDiscord<Phil> Wait, how am I like halfway to writing my own HTTP server when I just wanted to write a "Thread" server
16:13:10FromDiscord<Phil> the fuck
16:30:01*jmdaemon quit (Ping timeout: 255 seconds)
16:30:52*azimut joined #nim
16:44:55FromDiscord<rakgew> any aoc in nim this year?
16:46:35FromDiscord<Chronos [She/Her]> #aoc :p
16:48:43*rockcavera joined #nim
16:50:50FromDiscord<rakgew> is that a link or a reference to some platform?↔I found bostonbyboston twitch but none on yewtu.be - so I was wondering if they went somewhere else?
16:53:21FromDiscord<griffith1deadly> it reference to nim discord channel
16:55:41FromDiscord<rakgew> ah ok. @griffith1deadly\: thank you for the explanation.↔I am not using discord, but thanks for the link @Chronos [She/Her]
17:00:42*disso-peach joined #nim
17:04:03NimEventerNew thread by mantielero: FMU - C interop, see https://forum.nim-lang.org/t/10728
17:13:42FromDiscord<spotlightkid> rakgew\: you can also join via Matrix
17:13:47FromDiscord<Chronos [She/Her]> In reply to @rakgew "ah ok. <@620135501201932300>\: thank": Ah sorry didn't realise you were on Matrix
17:15:44FromDiscord<spotlightkid> https://git.0x20.eu/chris/adventofcode-2023↔My solutions so far. I'm not very experienced with Nim but i have been programmng Python for \>= 20 years. Probably shows in my Nim code 😀
17:17:51FromDiscord<spotlightkid> Argh, meant to post that in the AoC channel. Sorry.
17:20:00FromDiscord<rakgew> I did not realize the link on my end is actually a matrix link.
17:39:12FromDiscord<Phil> Just to be on the safe side:↔It is perfectly valid to assume that communication between threads is safe, right?↔I don't need to implement some kind of security protocol or the like?
17:40:00FromDiscord<Phil> (edit) "like?" => "like to prevent interaction with other (potentially malicious) processes/threads?"
17:41:04FromDiscord<Chronos [She/Her]> How would I copy a seq in Nim? This is my code and wondering how I'd make a copy of this to ensure safety `b.buf[b.pos..<(b.pos+length)]`
17:41:21FromDiscord<Phil> Have you considered that seqs are value-types in terms of semantics?
17:44:23FromDiscord<Phil> sent a code paste, see https://paste.rs/TFNrD
17:44:58FromDiscord<Phil> Yep, always the case for seqs
17:45:01FromDiscord<Phil> Same for string
17:45:06FromDiscord<Chronos [She/Her]> Would `result = cast[string](b.buf[b.pos..<(b.pos+length)])` this be acceptable then? :p
17:45:19FromDiscord<Phil> Which IIRC is why Araq is currently doing a new string thing
17:45:27FromDiscord<Chronos [She/Her]> Fair
17:45:54FromDiscord<Phil> I don't think it is, because you're not reassigning the seq itself, you're casting it first
17:45:57FromDiscord<Phil> That may screw you
17:46:00FromDiscord<Chronos [She/Her]> Ah
17:46:56FromDiscord<Chronos [She/Her]> sent a code paste, see https://paste.rs/PNPnT
17:50:50FromDiscord<saint.___.> why is it initTable but newSeq
17:51:19FromDiscord<saint.___.> shouldn't it be initSeq
17:54:26FromDiscord<Phil> IIRC new/init are based on where the memory is allocated.↔new = heap, init = stack↔The semantics of the type are a different discussion.
17:57:46FromDiscord<saint.___.> oh gotcha
17:57:49FromDiscord<saint.___.> Makes sense
17:58:19FromDiscord<treeform> I think it should be initSeq but for historical reasons it’s newSeq because it got the name before the convention
17:58:47FromDiscord<saint.___.> oh so newSeq puts it on the stack?
17:58:59FromDiscord<saint.___.> that's kinda confusing if true
17:59:16FromDiscord<saint.___.> There should be an alias at least then
17:59:23FromDiscord<Phil> Nope, seq is always on the stack. Always always
17:59:34FromDiscord<treeform> https://forum.nim-lang.org/t/9021#58827
17:59:44FromDiscord<treeform> Araq says so?
18:00:02FromDiscord<Phil> It's more that treeform is suggesting naming the proc after the semantics, not the allocation
18:00:36FromDiscord<Phil> And apparently Araq does as well, so I stand corrected regarding my statement that new/init are named based on allocation
18:01:46FromDiscord<saint.___.> Interesting thread
18:02:09*xet7 quit (Remote host closed the connection)
18:03:55FromDiscord<saint.___.> I guess every language is bound to have some quirls
18:03:57FromDiscord<saint.___.> (edit) "quirls" => "quirks"
18:04:10FromDiscord<saint.___.> I don't see the big deal in just aliasing initSeq to newSeq
18:16:14FromDiscord<System64 ~ Flandre Scarlet> Is there a fixed point number library?
18:16:22FromDiscord<System64 ~ Flandre Scarlet> (edit)
18:16:24FromDiscord<System64 ~ Flandre Scarlet> (edit) "library?" => "library please?"
18:19:25FromDiscord<Phil> sent a code paste, see https://paste.rs/RN194
18:49:44FromDiscord<Phil> Okay I kinda didn't expect when I wrote that post yesterday that I'd have half of a thread server done in a day
18:50:02FromDiscord<Phil> (edit) "wrote that post" => "learned" | "learnedyesterday ... that" added "about client-server architecture between threads"
18:59:14FromDiscord<treeform> In reply to @sys64 "hi! Is there a": I stared on one, but never finished
19:15:41*emery joined #nim
19:16:04*ehmry quit (Read error: Connection reset by peer)
19:26:07*PMunch joined #nim
19:35:42PMunchAoC stream day 3 is live! https://www.twitch.tv/pmunche https://www.youtube.com/watch?v=BdVnw0oWKy0
19:48:51*targz77 joined #nim
20:12:42*redj quit (Ping timeout: 252 seconds)
20:47:36*krux02 quit (Remote host closed the connection)
21:11:07FromDiscord<System64 ~ Flandre Scarlet> In reply to @treeform "I stared on one,": Oh alright↔Imo an Fixed Point Number library would be pretty useful, sometimes you want to avoid floats
21:15:53*PMunch quit (Remote host closed the connection)
21:19:48FromDiscord<inventormatt> There is this one https://gitlab.com/lbartoletti/fpn it's a few years old but it's likely to still work
21:38:54*NunavuT quit (Killed (NickServ (GHOST command used by Nunavut_)))
21:38:59*NunavuT joined #nim
21:48:33*NunavuT quit (Read error: Connection reset by peer)
21:53:34FromDiscord<nervecenter> In reply to @chronos.vitaqua "Would `result = cast[string](b.buf[b.pos..<(b.pos+l": Question, when would you need to do something like this? I've got a 30k line commercial CLI application I made that does lots of analysis and math on big arrays and I've never had to do a deep copy. Most of what I need to do can be handled with `map` and `filter`, or another custom function that returns a new array.
21:55:58*NunavuT joined #nim
21:56:07FromDiscord<Chronos [She/Her]> In reply to @nervecenter "Question, when would you": Minecraft networking aha, my library reads bytes from a buffer, and to read Minecraft strings, it's a string prefixed with a number
21:58:24FromDiscord<nervecenter> Yeugh, are you doing JVM interop?
22:06:52NimEventerNew thread by mantielero: Object variant - returning different types, see https://forum.nim-lang.org/t/10729
22:11:53FromDiscord<Chronos [She/Her]> In reply to @nervecenter "Yeugh, are you doing": Nope, reimplementation of the protocol aha
22:12:25FromDiscord<Chronos [She/Her]> Can be found at https://github.com/Nimberite-Development/ModernNet
22:13:10FromDiscord<Schelz> sent a code paste, see https://paste.rs/zlOBB
22:23:03*NunavuT quit (Quit: i3)
22:45:50FromDiscord<treeform> In reply to @sys64 "Oh alright Imo an": Instead of using fix point I used the determinism float point flags when compiling, and that was it.
22:45:59FromDiscord<bostonboston> In reply to @Schelz "Hi! How can i": `proc clear(number: uint32, pPos: static position, flags: uint32): int32 =` i think
22:47:05FromDiscord<bostonboston> if you just want immutability omitting `var` from your parameters achieves that
22:51:41*tiorock joined #nim
22:51:41*tiorock quit (Changing host)
22:51:41*tiorock joined #nim
22:51:41*rockcavera quit (Killed (iridium.libera.chat (Nickname regained by services)))
22:51:41*tiorock is now known as rockcavera
22:59:19FromDiscord<Elegantbeef> No that's C const not nim const
23:06:29*LuxuryMode joined #nim
23:07:18FromDiscord<Elegantbeef> Stack inheritance sequence is a no no
23:07:44FromDiscord<Phil> Stack discrimination1
23:07:46FromDiscord<Phil> (edit) "discrimination1" => "discrimination!"
23:08:18FromDiscord<Elegantbeef> Well it down casts to `NumVal` which is `sizeof(8)`
23:08:32FromDiscord<Elegantbeef> This is a bug that it allows `@[x, y]`
23:08:43FromDiscord<Phil> sent a code paste, see https://paste.rs/1149f
23:09:03FromDiscord<Phil> sent a code paste, see https://paste.rs/KyH5u
23:09:51FromDiscord<Elegantbeef> Since all the types are the same type
23:10:05FromDiscord<Elegantbeef> But this should likely still error
23:10:39FromDiscord<Phil> Unrelated sidenote (as I played around with this for the forum thread):↔How do we get around "extracting values" from object variants?↔I feel like I had this problem in the beginning as well, but somehow it just... stopped being one because I started using different patterns
23:10:55FromDiscord<Chronos [She/Her]> Is there a special 'type' for a parameter that's supposed to be an unused identifier? Like `definePacket(TypeName)`?
23:10:59FromDiscord<Phil> I just can't consciously remember what I changed in my code-structure that made "extracting values from object variants" a non-issue
23:11:51FromDiscord<Elegantbeef> sent a code paste, see https://paste.rs/dDVwv
23:11:54FromDiscord<Chronos [She/Her]> In reply to @chronos.vitaqua "Is there a special": I could use `untyped` but what if someone decides to do something like `definePacket(wah luigi)`?
23:13:32FromDiscord<griffith1deadly> In reply to @chronos.vitaqua "I could use `untyped`": you need to write macro
23:14:09FromDiscord<Elegantbeef> You use a case statement to delimit branches↔(@Phil)
23:14:20FromDiscord<Elegantbeef> It's required due to the fact you're branching flow control and typing
23:14:42FromDiscord<Phil> Yeah but having to do so often becomes annoying fast. I remember being annoyed by that in the beginning but nowadays it just... doesn't come up
23:15:16FromDiscord<Phil> Like I had to deal with channels only supporting one type.↔Well just generate an object variant and methods for each type you want to put in the object variant so that it's transparent for you, boom problem solved.
23:16:06FromDiscord<Phil> (edit) "methods" => "procs" | "procsfor each type you want to put in the object variant ... so" added "(to transform type => variant and send through the channel, as well as one for routing each variant to a specific "handler-proc" on the other thread)"
23:16:21FromDiscord<Phil> (edit) "type.↔Well" => "type per instance.↔Well"
23:38:55FromDiscord<System64 ~ Flandre Scarlet> In reply to @treeform "Instead of using fix": What is that?
23:53:19FromDiscord<System64 ~ Flandre Scarlet> Also↔Does it requires an FPU?
23:54:20FromDiscord<treeform> All cpus from like 1988 and after have an FPU
23:54:42FromDiscord<treeform> (edit) "All ... cpus" added "desktop"
23:58:25FromDiscord<treeform> Flags like ‘`-fno-fast-math -ffloat-store -fexcess-precision=standard’ help gcc generate non optimized but predictable float point math
23:59:13FromDiscord<treeform> They make float point operations slower, but still way faster then fixed point.