<< 26-01-2023 >>

00:03:56*argonica joined #nim
00:10:38FromDiscord<Nilts> In reply to @not logged in "and just to get": Is this a "calling convention"?
00:11:08FromDiscord<Elegantbeef> it practically is
00:11:33FromDiscord<Elegantbeef> How you send variables to a function is what a calling convention is
00:12:03FromDiscord<demotomohiro> https://en.wikipedia.org/wiki/X86_calling_conventions
00:14:28FromDiscord<Nilts> How do i make sure the SET stuff in the def is not ran until it is called?
00:17:24FromDiscord<Elegantbeef> it shouldnt do anything untill called
00:18:29FromDiscord<pyolyokh> In reply to @not logged in "well, you don't run": ^^
00:18:58FromDiscord<Nilts> In reply to @Elegantbeef "it shouldnt do anything": Well the SET in the body would still run
00:19:02FromDiscord<pyolyokh> this person is extremely confused.
00:19:09FromDiscord<Nilts> In reply to @pyolyokh "this person is extremely": thanks
00:19:46FromDiscord<pyolyokh> if neither you nor the people talking to you realize that, it's never going to be cleared up.
00:20:24FromDiscord<pyolyokh> what is the 'first time around' where you think a function doesn't get run?
00:22:11FromDiscord<Nilts> sent a code paste, see https://play.nim-lang.org/#ix=4mcO
00:23:50FromDiscord<Nilts> Also, do i need a Scope enter and scope exit command?
00:24:33FromDiscord<Elegantbeef> your arg1 would be a reference and as such just works
00:25:13FromDiscord<Elegantbeef> arg2 is just "pop first value off stack"
00:25:18FromDiscord<Elegantbeef> i mean arg1
00:27:52FromDiscord<Nilts> In reply to @Elegantbeef "arg2 is just "pop": then it would pop the func obj off the stack and set it to arg1 and still run
00:29:32FromDiscord<Elegantbeef> sent a code paste, see https://play.nim-lang.org/#ix=4mcQ
00:30:14FromDiscord<Elegantbeef> sent a code paste, see https://play.nim-lang.org/#ix=4mcR
00:30:57FromDiscord<Elegantbeef> sent a code paste, see https://play.nim-lang.org/#ix=4mcT
00:32:06FromDiscord<Elegantbeef> https://en.wikipedia.org/wiki/X86_calling_conventions#Caller_clean-up and https://en.wikipedia.org/wiki/X86_calling_conventions#Callee_clean-up
00:32:08FromDiscord<Elegantbeef> Might help atleast
00:33:38FromDiscord<Nilts> sent a code paste, see https://play.nim-lang.org/#ix=4mcU
00:37:46FromDiscord<Nilts> In reply to @Elegantbeef "https://en.wikipedia.org/wiki/X86_calling_conventio": Where is the function declared in the assembly?
00:40:00FromDiscord<Nilts> i think im a little confused
00:42:24FromDiscord<pyolyokh> functions aren't declared in assembly. There are just addresses with code at them.
00:43:09FromDiscord<pyolyokh> the literal ` call callee ; call subroutine 'callee'` at that link still assumes that the assembler has some `callee:` label elsewhere
00:43:57FromDiscord<Nilts> In reply to @pyolyokh "the literal ` ": see, i need like a label system somewhere. But then there could only be global func
00:43:59FromDiscord<Nilts> (edit) "func" => "funcs"
00:44:41FromDiscord<Elegantbeef> Anonymous procedures and pointer procedures are the same
00:45:00FromDiscord<Elegantbeef> They just store an address to that procedure instead of directly using the label
00:45:34FromDiscord<Elegantbeef> So when you call one it implicitly dereferences a pointer
00:46:16FromDiscord<jtv> @Nilts Can take it to #offtopic but in general, function calls in byte code languages are done by SAVING the state of the caller, often on a stack, and pushing on the state of the function you're calling to, and transferring control to that address. You also save the address to return to, and the info you need to apply the right state.
00:47:27FromDiscord<jtv> Typically there's the "instruction pointer", the pointer to the instruction you're executing right now, and some pointer into a stack that contains info about local variables, etc. that allows you to distinguish between calling contexts
00:51:45FromDiscord<jtv> You will generally want symbol tables and to manage information about scopes in doing all that. Most intro to compilers books cover all of this reasonably well actually. Some of the more modern ones are really friendly
00:51:57FromDiscord<jtv> Someone posted one for you the other day that I skimmed and it looked good
00:52:28FromDiscord<Elegantbeef> Was it me with "crafting interpreters"
00:52:31FromDiscord<Elegantbeef> Or is there another one
00:54:08FromDiscord<Nilts> In reply to @jtv "<@910899642236043294> Can take it": what about #la`
00:54:14FromDiscord<Nilts> (edit) "#la`" => "#langdev"
00:56:15FromDiscord<Nilts> nvm
00:56:40FromDiscord<Elegantbeef> I mean given there isnt anything going on, here is likely fine
00:56:48FromDiscord<Elegantbeef> Not like Nim is the most active community
00:57:28FromDiscord<Nilts> ok, so is the semantic checker that makes the symbols supposed to connect to the bytecode?
00:58:56FromDiscord<Elegantbeef> You may want to `parse -> semantic check -> an intermediate representation -> codegen`
00:59:12FromDiscord<Elegantbeef> AST can be used for codegen, but it's not the most fun usage
00:59:46*argonica quit (Quit: Leaving)
00:59:50FromDiscord<Elegantbeef> But yes you should use the symbols generated from the AST to help with the bytecode
00:59:58FromDiscord<Elegantbeef> If your symbols are like Nim's that's sorta the point of them anyway
01:01:23FromDiscord<Nilts> hmmm, but i pop them
01:01:49FromDiscord<Elegantbeef> codegen should be a step before bytecode so popping them shouldnt do anything
01:01:56FromDiscord<Nilts> (edit) "them" => "them, and the symbol table gets destroyed."
01:02:00FromDiscord<Elegantbeef> well should be a step before interpretting
01:02:21FromDiscord<Elegantbeef> The symbol table should disappear after bytecode is generated
01:02:32FromDiscord<Elegantbeef> Though given JTV was helping you i probably should shush, might be competing designs
01:03:17FromDiscord<Nilts> In reply to @Elegantbeef "The symbol table *should*": no, im talking about during the semantic check. Here is the code if it helps: https://github.com/thatrandomperson5/JumpLang/blob/main/libjumplang/syms.nim
01:06:14FromDiscord<Nilts> In the file you can see that i have no good way of retrieving the sym tables.
01:40:21FromDiscord<voidwalker> What is your favourite library to work with sqlite ?
01:40:37FromDiscord<voidwalker> (edit) "What is your favourite library to work with sqlite ? ... " added "(except the stdlib one of course)"
01:40:38FromDiscord<Elegantbeef> The one that means i dont need a DB 😄
01:44:09FromDiscord<pyolyokh> the stdlib one is losing the -d:staticSqlite flag so my favorite will be the non-std replacement for that
01:45:05FromDiscord<pyolyokh> when backwards compatibility isn't necessary, using a much more modern sqlite than the system one can yield a pretty good speed increase in itself
01:53:26FromDiscord<voidwalker> I like the syntax in this one: https://github.com/ire4ever1190/ponairi
02:01:27FromDiscord<voidwalker> while this is the most starred: https://github.com/juancarlospaco/nim-gatabase
02:49:53*ltriant quit (Ping timeout: 252 seconds)
03:04:26*argonica joined #nim
03:08:58FromDiscord<amadan> Used to use https://github.com/itsumura-h/nim-allographer and found that quite nice
03:13:15*jmdaemon joined #nim
03:50:53*argonica quit (Remote host closed the connection)
03:53:27*ltriant joined #nim
03:58:27*ltriant quit (Ping timeout: 256 seconds)
04:02:13FromDiscord<jtv> Sorry @Nilts I was at a dinner now I'm headed to bed, but I'll be around more tomorrow
04:08:23FromDiscord<jtv> Generally scopes are hierarchical though, where if I can't find a variable on a use in the local scope I go searching parent scopes. Pushing and popping may or may not make sense depending on how you're dealing w/ your tree, but you can always stash a reference to the scope in the tree.
04:10:24FromDiscord<jtv> But yeah, the symbol table generally just helps you check and produce code, it doesn't live while you're running. Tho, for some kinds of interpreters, it might make more practical sense if you're going to do a lot of runtime type lookup stuff. There are cases where it can work
04:26:44*xet7 quit (Remote host closed the connection)
04:52:34*ltriant joined #nim
04:57:36*ltriant quit (Ping timeout: 248 seconds)
05:10:16*arkurious quit (Quit: Leaving)
05:57:17FromDiscord<sOkam!> How do you get the bit representation of a number?↵I feel like this should be an easy one, but I can't seem to find it no matter where i look 🤔
05:57:30FromDiscord<sOkam!> (edit) "number?↵I" => "number in nim?↵I"
05:58:48FromDiscord<sOkam!> (edit) "How" => "~~How" | "nim?↵I" => "nim?~~↵~~I" | "🤔" => "🤔~~↵nvm, found it by searching for tohex. it was right next to it"
06:27:11FromDiscord<Rika> Because you were using the wrong term yeah, it’s not bit representation it’s binary representation
06:31:36*argonica joined #nim
07:21:58*ltriant joined #nim
07:50:23FromDiscord<xoich (xoich)> hello, how do I create a ref seq[int]?
07:52:12FromDiscord<Elegantbeef> `var a = new seq[int]`
07:52:17FromDiscord<Elegantbeef> `a[] = @[10, 20, 30]`
07:55:22FromDiscord<Arathanis> !eval
07:55:28FromDiscord<Arathanis> !eval
07:55:31FromDiscord<Arathanis> (edit) "!eval" => "="
07:56:07FromDiscord<xoich (xoich)> thanks @elegantbeef\:matrix.org
07:56:35FromDiscord<Arathanis> sent a long message, see http://ix.io/4mdO
07:57:00FromDiscord<Arathanis> clearly i dont know how eval works
07:58:26FromDiscord<Elegantbeef> It only does single line since it's on irce
07:58:36FromDiscord<Arathanis> ohhh got it
07:59:28FromDiscord<Arathanis> !eval var mySeq = @[1, 2, 3]; echo mySeq; echo refMySeq[]; refMySeq[] = @[4, 5, 6, 7]; echo mySeq
07:59:31NimBotCompile failed: /usercode/in.nim(1, 42) Error: undeclared identifier: 'refMySeq'
07:59:53FromDiscord<Arathanis> !eval var mySeq = @[1, 2, 3]; var refMySeq = mySeq.addr; echo mySeq; echo refMySeq[]; refMySeq[] = @[4, 5, 6, 7]; echo mySeq
07:59:56NimBot@[1, 2, 3]↵@[1, 2, 3]↵@[4, 5, 6, 7]
08:00:13FromDiscord<Elegantbeef> That's also not a `ref seq` but a `ptr seq`
08:00:39FromDiscord<Arathanis> that makes sense
08:01:19FromDiscord<Arathanis> cause its unsafe and ptr is designed to be "unsafe"
08:01:26FromDiscord<Arathanis> whereas ref is not
08:01:36FromDiscord<Arathanis> so if you could just `.addr` any old thing to get a ref it would be
08:01:39FromDiscord<Arathanis> not great
08:01:51FromDiscord<Arathanis> but a ptr makes more sense
08:02:03FromDiscord<Elegantbeef> Not really
08:02:07FromDiscord<Elegantbeef> Since that's not what they asked
08:02:39FromDiscord<Arathanis> yes you are right, i was more messing around than anything else but in a mistaken way
08:02:42FromDiscord<Arathanis> i appreciate you correcting it
08:02:55FromDiscord<Arathanis> should have been ~~refMySeq~~ ptrMySeq
08:25:33*argonica quit (Quit: Leaving)
09:02:17*azimut quit (Ping timeout: 255 seconds)
09:19:51*PMunch joined #nim
09:20:14FromDiscord<System64 ~ Flandre Scarlet> can NimScript create a folder?
09:20:33FromDiscord<Elegantbeef> https://nim-lang.org/docs/nimscript.html#mkDir%2Cstring
09:21:37FromDiscord<System64 ~ Flandre Scarlet> perfect, thanks!
09:47:42FromDiscord<System64 ~ Flandre Scarlet> ``-O3 -I"./tilengine/includes" -L"tilengine/lib/wasm" -lz -lpng -lSDL2 -lTilengine``↵How can I pass it to the compiler please?
09:48:11FromDiscord<Elegantbeef> `--passL` or `--passC`
09:48:28FromDiscord<System64 ~ Flandre Scarlet> I need multiple passL / passC?
09:49:03FromDiscord<Elegantbeef> You can do it all in one
09:49:30FromDiscord<System64 ~ Flandre Scarlet> sent a code paste, see https://play.nim-lang.org/#ix=4mei
09:49:47FromDiscord<Elegantbeef> `switch("passL", "...")`
09:50:12FromDiscord<System64 ~ Flandre Scarlet> Something is incorrect?
09:50:22FromDiscord<Elegantbeef> Yes
09:50:32FromDiscord<Elegantbeef> `switch("leftHandHere", "rightHandHere")`
09:56:16*jmdaemon quit (Ping timeout: 248 seconds)
10:00:04FromDiscord<System64 ~ Flandre Scarlet> Let's gooo! https://media.discordapp.net/attachments/371759389889003532/1068108047450378250/image.png
10:08:56PMunchNice!
10:09:32Amun-Rasonic vibes
10:09:42PMunch@System64_~_Flandre_Scarlet, are you using the nim-tilengine wrapper?
10:20:40FromDiscord<System64 ~ Flandre Scarlet> In reply to @PMunch "@System64_~_Flandre_Scarlet, are you using": The one I did with Futhark
10:38:11FromDiscord<4zv4l> sent a code paste, see https://play.nim-lang.org/#ix=4mex
10:38:16FromDiscord<4zv4l> like keeping it anonymous
10:41:17FromDiscord<Rika> no
10:41:36FromDiscord<Rika> you have to make either an enum type for famille, demoiselle, etc
10:41:52FromDiscord<Rika> actually ig you can just use a massive if statement or whatever
10:41:59FromDiscord<Rika> ofc i assume you dont want that so
11:01:32PMunch@System64_~_Flandre_Scarlet, oh right, that's really cool!
11:01:53PMunchI don't remember, was there a particular reason why you don't use the existing bindings?
11:03:34PMunch@4zv4l, not entirely sure what you want to achieve here
11:18:04FromDiscord<4zv4l> well I saw a Python script doing something similar and I wanted to try doing it in Nim
11:18:12FromDiscord<4zv4l> precising as less the type as possible
11:23:14FromDiscord<4zv4l> sent a code paste, see https://play.nim-lang.org/#ix=4meH
11:23:47FromDiscord<4zv4l> oooh because it's a string and not the field ?
11:26:44FromDiscord<Rika> Yes
11:27:55FromDiscord<4zv4l> anything I can do about that ?
11:35:36FromDiscord<sOkam!> Is there something similar to `runnableExamples:` that can be used for tests, instead of for examples?
11:35:51FromDiscord<sOkam!> (edit) "for" => "doc"
11:36:27FromDiscord<sOkam!> (edit) "tests, instead of doc examples?" => "tests?"
11:38:23FromDiscord<Phil> Not that I'm aware of
11:38:32FromDiscord<Phil> runnableExamples are kind of mini-tests
11:54:16FromDiscord<sOkam!> sent a code paste, see https://play.nim-lang.org/#ix=4meN
11:54:59FromDiscord<sOkam!> (edit) "https://play.nim-lang.org/#ix=4meN" => "https://play.nim-lang.org/#ix=4meO"
11:55:18FromDiscord<sOkam!> (edit) "https://play.nim-lang.org/#ix=4meO" => "https://play.nim-lang.org/#ix=4meP"
11:55:22FromDiscord<Phil> sent a code paste, see https://play.nim-lang.org/#ix=4meQ
11:56:52FromDiscord<sOkam!> In reply to @Isofruit "You're looking for the": lifesaver, thenks!
12:22:21PMunchsOkam, as @Phil pointed out runnableExamlpes can be used as a sort of mini-test. Basically they are compiled and run during documentation generation, and if an example fails to compile or run then it throws an error. So if you instead of doing `echo someProc() # This prints 5` does `assert someProc() == "5"` then you will get an error if `someProc` no longer returns 5.
12:23:09FromDiscord<Phil> As a sidenote, that is oen of the reasons I adopted the habit of add a documentation-compilation pipeline to any new package I make
12:23:21FromDiscord<Phil> (edit) "oen" => "one"
12:26:55FromDiscord<System64 ~ Flandre Scarlet> In reply to @PMunch "I don't remember, was": I created thoses bindings before the new ones exist
12:27:10FromDiscord<System64 ~ Flandre Scarlet> Btw is there a way to do compile-time conditionnal imports?
12:27:30FromDiscord<System64 ~ Flandre Scarlet> sent a code paste, see https://play.nim-lang.org/#ix=4meV
12:39:52*xet7 joined #nim
12:43:19PMunch@System64_~_Flandre_Scarlet, `when not defined(emscripten)`
12:51:14FromDiscord<System64 ~ Flandre Scarlet> Oh alright, thanks!
12:52:21FromDiscord<Phil> I do not comprehend, why can't I compile the nimforum on 1.6.10?↵I just get completely random EOF Errors while compiling the forum nim file which, lo and behold, disappear when I compile on my nim2 compatibility branch
12:53:34FromDiscord<Phil> Which is like, what do you even do with that if you don't even get a stacktrace
13:02:22FromDiscord<Phil> Oh flopping hell it was because of a bad nimcache and I don't know where it's stored by default
13:09:02PMunch~/.cache/nim on Linux
13:17:34FromDiscord<Require Support> possible to write a kernel module in nim? 🤔
13:19:08FromDiscord<chmod222> Sure, why not
13:32:48PMunch@Require_Support, you could write your entire kernel in Nim if you wanted to
13:49:49FromDiscord<Require Support> https://tenor.com/view/possibilities-endless-possibilities-sponge-bob-rainbow-gif-12940820
14:17:04FromDiscord<Ntsékees> No matter which port of I try to open with `nimhttpd -p:▓▓▓▓`, it always yields ⟪Error: unhandled exception: Address already in use [OSError]⟫.↵Yet, when I check the status of the ports, they are listed as “closed”. 🤨
14:23:12FromDiscord<Ntsékees> Well, since the error comes from `oserr.nim(95)`, maybe this “address” is not the port…
14:24:07FromDiscord<Ntsékees> (edit) "`oserr.nim(95)`," => "`asyncfutures.nim(437) > oserr.nim(95)`,"
14:24:17FromDiscord<Ntsékees> (edit) "`asyncfutures.nim(437)" => "`asyncfutures.nim(437)`" | "oserr.nim(95)`," => "`oserr.nim(95)`,"
14:26:42FromDiscord<0xʎ> when writing enums what is the standard of naming variants? do you prefix them, or no prefix? Also what casing is used?
14:27:22FromDiscord<0xʎ> for example for my tokens enum I have them prefixed right now with `tk`, and in camelCase
14:27:46PMunch@0xʎ, typically no prefix, and either camelCase or PascalCase
14:28:01PMunchThe name of the enum kinda works like a prefix
14:28:20PMunche.g. Token.Secure for example instead of tkSecure.
14:28:46FromDiscord<Ntsékees> In reply to @Ntsékees "No matter which port": I've used `python -m http.server` instead of `nimhttpd` and it works correctly.
14:29:13PMunchOf course in most cases you don't need the `Token.` part at all, and it will make sense from context and procedure signature what `Secure` would mean
14:30:44PMunch@Ntsékees, hmm that sounds strange
14:31:39FromDiscord<Ntsékees> anyway, issue closed of sorts, as I've found a working replacement
14:31:48PMunchJust tried it here with port 2000 and it worked just fine
14:32:25PMunchCould you run `nimhttpd --version`?
14:32:31PMunchAnd what OS are you on?
14:32:56FromDiscord<Ntsékees> > ⎈ nimhttpd --version↵> 1.5.0
14:33:10PMunchHmm, that is the latest version
14:33:11FromDiscord<Ntsékees> Ubuntu Linux 22.10
14:33:29PMunchAnd a Linux system as well, same as me
14:36:53FromDiscord<0xʎ> what can I do if the variants collide with keywords
14:36:54FromDiscord<0xʎ> :/
14:37:23FromDiscord<0xʎ> I usually do `foo_` but it won't let me have the trailing underscore
14:37:42FromDiscord<Rika> What’s the whole context?
14:38:00FromDiscord<0xʎ> huh?
14:38:16FromDiscord<Rika> I don’t understand what you mean by the variants colliding with keywords
14:38:23FromDiscord<0xʎ> oh I mean enum variants
14:38:25FromDiscord<Rika> What do you mean variants? Object variants?
14:38:54FromDiscord<Rika> Well you don’t use the name, but I don’t know of any keywords that are camel case?
14:38:59FromDiscord<Rika> I don’t remember any at least
14:39:02FromDiscord<Rika> I mean Pascal case
14:39:12FromDiscord<0xʎ> I'm writing them using camelCase
14:39:46FromDiscord<0xʎ> is it more common to write them using PascalCase or camelCase
14:40:06FromDiscord<Rika> Usually it’s camel with the prefix or Pascal without, at least to me I would do such
14:40:41FromDiscord<Rika> Camel with has the keyword issue and sure there’s a workaround (I think using ` around the identifier works but it’s ugly)
14:41:05FromDiscord<0xʎ> oh ok
14:41:23FromDiscord<0xʎ> I'll just go with pascal
14:41:27FromDiscord<Rika> If you think it’s acceptable to you, wrap the enum with `
14:44:14FromDiscord<System64 ~ Flandre Scarlet> Is it normal it displays that when I try to load a JSON file? (I compiled to emscripten) https://media.discordapp.net/attachments/371759389889003532/1068179566016868402/image.png
14:45:05FromDiscord<System64 ~ Flandre Scarlet> sent a code paste, see https://play.nim-lang.org/#ix=4mfG
14:45:55FromDiscord<System64 ~ Flandre Scarlet> I also use std/json for json files
14:57:06FromDiscord<spooky> sent a code paste, see https://play.nim-lang.org/#ix=4mfK
14:58:52FromDiscord<spooky> (edit) "https://play.nim-lang.org/#ix=4mfK" => "https://play.nim-lang.org/#ix=4mfL"
14:59:37*azimut joined #nim
15:04:49*PMunch quit (Quit: Leaving)
15:06:03*azimut quit (Remote host closed the connection)
15:07:17*emery quit (Quit: https://quassel-irc.org - Chat comfortably. Anywhere.)
15:10:22*azimut joined #nim
15:22:42FromDiscord<New> sent a code paste, see https://play.nim-lang.org/#ix=4mg0
15:23:37FromDiscord<New> (edit) "https://play.nim-lang.org/#ix=4mg0" => "https://play.nim-lang.org/#ix=4mg1"
15:23:52FromDiscord<New> (edit) "https://play.nim-lang.org/#ix=4mg1" => "https://play.nim-lang.org/#ix=4mg2"
15:26:09*ehmry joined #nim
15:27:30FromDiscord<arkanoid> there so much information on the Nim chats that will be lost forever. if all the chat thing were forum posts, the community would feel much larger
15:28:10FromDiscord<Phil> On the one hand, yes, on the other: Often enough it's the 500th rendition on "How do I parse a string into an enum" ?
15:28:26FromDiscord<Phil> And the forum isn't really great for searchability either, SO imo is better there
15:28:58FromDiscord<Phil> Which is why I maintain my stance that for semi-complex questions that you couldn't find an answer to elsewhere, do a self answered SO question for the next person.
15:31:38FromDiscord<Phil> As for expect, I never used it, nor pexpect in python, so I'm not particularly familiar what ability is even looked for
15:31:53FromDiscord<New> In reply to @Isofruit "Which is why I": In fact, u right. Will go to SO then. Tnx.
15:33:01FromDiscord<Phil> In reply to @New "In fact, u right.": I mean, often times I find the answeres here, I just "document" them in SO questions 😄
15:37:08FromDiscord<ringabout> Feeding them to GPT or similar might help 😜
15:38:09FromDiscord<Phil> In reply to @New "In fact, u right.": https://github.com/Vindaar/shell↵> Some terminal commands will require user input. Starting from version v0.5.0, basic support for a expect / send feature is available. It allows for functionality similar to the =expect(1)= program.
15:39:59FromDiscord<Phil> So you could figure out how to use expect with that, write up an example and post it on SO 😄
15:42:25FromDiscord<New> In reply to @Isofruit "https://github.com/Vindaar/shell > Some terminal": i found that previously but not understand how to use <:PES2_Shrug:513352546341879808> ↵And not understand is it necessary to have `expect` at end machine or not <:PES2_Shrug:513352546341879808>
15:42:44FromDiscord<Phil> In that case, Vindaar your type is requested
15:43:06FromDiscord<Phil> Because I don't have the 5 mins to invest to figure it out myself, about to head out
15:45:28FromDiscord<Vindaar> you don't need expect anymore. expect would be some string that appears in the output e.g. some yes/no query. I added the to option to just send though, because @ShalokShalom asked for it recently. anyway, what's not clear about the Readme explaining how it works?
15:47:42FromDiscord<New> sent a code paste, see https://paste.rs/1LP
15:47:59FromDiscord<New> (edit) "https://play.nim-lang.org/#ix=4mga" => "https://play.nim-lang.org/#ix=4mg9"
15:48:35FromDiscord<New> (edit) "https://play.nim-lang.org/#ix=4mg9" => "https://play.nim-lang.org/#ix=4mgc"
15:49:38*Phytolizer joined #nim
15:51:33FromDiscord<Vindaar> yes, in principle (single ticks are not valid though, have to use " for strings) . but in this particular case I consider that a very bad idea. you really don't want to hardcode your password into a code snippet like that. set up an ssh key for passwordless ssh login (if that's encrypted of course you'd need a password for that too).
15:51:39*arkurious joined #nim
15:53:14FromDiscord<New> In reply to @Vindaar "you don't need expect": > anyway, what's not clear about the areadme explaining how it works↵Im just not smart. Peobably. Idk. Father told me that.
15:54:35FromDiscord<Vindaar> wasn't meant as criticism, but just maybe something could be improved. anyway, no need to dunk on yourself
15:56:06FromDiscord<New> In reply to @Vindaar "yes, in principle (single": i know what hardcoding password is very bad idea, but this is my task, i just writing code 🙂↵We tryed ssh2.nim library, tryed empty build for this fucking machine. nothing working. i even dot speak about openssl compiling xD↵_↵will try to use shell.nim then. something about 30 min and will try. big tnx
15:57:44FromDiscord<Phil> In reply to @New "i know what hardcoding": For a starting point it's not terrible, just don't check in that code 😛↵You can always read the password in later from a json file
15:57:51FromDiscord<Phil> parsing in JSON isn't that hard
15:57:57FromDiscord<Phil> As in, takes like 3-4 lines of code
16:00:35*jkl quit (Quit: Gone.)
16:00:45FromDiscord<New> Btw never speaking before with person, who create library for my future or current code xD
16:02:37FromDiscord<Phil> Happens
16:03:03*jkl joined #nim
16:15:46*Phytolizer quit (Remote host closed the connection)
16:21:44FromDiscord<Require Support> what is a good to import objects and functions from a C header file in nim?
16:21:59FromDiscord<Require Support> (edit) "what is a good ... to" added "way"
16:34:10FromDiscord<New> In reply to @New "So, is it correct:": it asking password and waiting my input 😦 @Vindaar
16:35:16FromDiscord<New> sent a code paste, see https://play.nim-lang.org/#ix=4mgq
16:35:29FromDiscord<New> (edit) "https://play.nim-lang.org/#ix=4mgq" => "https://play.nim-lang.org/#ix=4mgr"
16:39:54FromDiscord<Require Support> sorry im clueless when it comes to C, `#define MODULE_LICENSE(_license) MODULE_INFO(license, _license)` how to import this into nim
16:42:53FromDiscord<New> sent a code paste, see https://play.nim-lang.org/#ix=4mgt
16:43:13FromDiscord<New> 1/2 :KEKWiggle:
16:46:35FromDiscord<Phil> In reply to @Require Support "sorry im clueless when": Best I can do you is link you to demo's article about that
16:47:13FromDiscord<Phil> https://internet-of-tomohiro.netlify.app/nim/clibrary.en.html#use-header-only-library-from-nim
16:54:20FromDiscord<Vindaar> In reply to @New "it asking password and": ah, I'm not sure, but it's possible that password input doesn't work via stdin, but a different FD. never thought about that, you'd need to read up on that
16:54:31FromDiscord<Vindaar> I'll be away for most of the evening now
16:55:36FromDiscord<New> In reply to @Vindaar "ah, I'm not sure,": :hello: https://media.discordapp.net/attachments/371759389889003532/1068212619200184370/image.png
16:56:29FromDiscord<System64 ~ Flandre Scarlet> sent a code paste, see https://play.nim-lang.org/#ix=4mgx
16:56:56*clemens3 joined #nim
16:57:40FromDiscord<New> https://media.discordapp.net/attachments/371759389889003532/1068213142812885054/image.png
17:13:48FromDiscord<enthus1ast> @System64 ~ Flandre Scarlet\: c2nim translates it like so\:
17:14:01FromDiscord<enthus1ast> sent a code paste, see https://play.nim-lang.org/#ix=4mgH
17:14:42FromDiscord<System64 ~ Flandre Scarlet> sent a code paste, see https://play.nim-lang.org/#ix=4mgI
17:18:57*Evolver joined #nim
17:19:08EvolverDo yall have a US registered charity?
17:19:24Evolversorry, will ask in #nim-offtopic if that's better
17:33:06*nyeaa4928423 quit (Read error: Connection reset by peer)
17:33:54*nyeaa4928423 joined #nim
17:37:32FromDiscord<Leftbones> How do I deal with an ambiguous call when both `unicode` and `strutils` have an `align` proc?
17:37:46FromDiscord<Leftbones> doing `str.unicode.align(...)` was my first idea but that didn't work
17:38:04FromDiscord<enthus1ast> strutils.align()
17:38:16FromDiscord<Leftbones> Oh yeah I guess I can just call it that way huh
17:38:37FromDiscord<enthus1ast> so\: strutils.align(yourString, 3)
17:39:02FromDiscord<Leftbones> Yeah that did it lol, brain lapse.
17:39:21FromDiscord<Leftbones> Got so used to calling stuff the other way I forgot that was allowed
17:40:04FromDiscord<enthus1ast> yeah
17:40:16FromDiscord<Leftbones> Teaching myself Nim by remaking an old text editor of mine (which is how I like to learn new languages) and I'm working out how to offset the contents of the lines based on the buffer scrolling offsets
17:40:23FromDiscord<enthus1ast> another option is, if you do not use eg strutils.align
17:40:28FromDiscord<Leftbones> I got vertical offsets to work but horizontal offsets are giving me issues
17:40:31FromDiscord<enthus1ast> import strutils except align
17:40:39FromDiscord<Leftbones> In reply to @enthus1ast "import strutils except align": Didn't know this was an option, that's nice to know, thanks
17:45:03FromDiscord<Leftbones> Hm. Maybe typing this out will help me understand, or maybe someone else has an idea. I have a buffer that's a grid of cells (just characters for now) and a sequence of strings loaded from lines of a file. I'm scrolling the buffer vertically by writing the contents to the buffer cells offset by the vertical scroll amount. That works fine. But horizontal scrolling I can't offset the same way because I'm then working with a string, rather
17:46:10FromDiscord<Leftbones> https://media.discordapp.net/attachments/371759389889003532/1068225349525180497/Screen_Recording_2023-01-26_at_11.45.16_AM.mov
17:47:08FromDiscord<Leftbones> I'm figuring I need to just check if the x scroll offset is greater than the length of the string, then convert the string to a sequence and insert it into the buffer like that. Maybe that would work.
17:48:17FromDiscord<Leftbones> One problem is that converting the string line to a sequence removes all of the whitespace
17:51:11FromDiscord<Leftbones> Oh if I just skip converting the string to a sequence that works out fine. Empty discord debugging lol.
17:52:24*jmdaemon joined #nim
19:23:50*kenran joined #nim
19:30:06FromDiscord<Hourglass [She/Her]> sent a code paste, see https://play.nim-lang.org/#ix=4mhu
19:33:09FromDiscord<Elegantbeef> sent a code paste, see https://play.nim-lang.org/#ix=4mhv
19:33:10FromDiscord<Elegantbeef> This is probably more sensible than a table
19:41:08FromDiscord<Hourglass [She/Her]> And if it's none, then do something else? (For my other tokenizing code)
19:42:27FromDiscord<enthus1ast> or even omit the else, then you get warned (by error message) when you add another opKind but forgot to handle it somewhere
19:43:04FromDiscord<enthus1ast> in general i mean, idk about your current code
19:43:58FromDiscord<Hourglass [She/Her]> Yeah I have some more complex lexing rules that this rule is very important for xD
19:44:05FromDiscord<Hourglass [She/Her]> Thanks though Beef!
19:45:21FromDiscord<Elegantbeef> I mean either way you need to branch to the else
19:46:39FromDiscord<enthus1ast> yes, in this case it does not fit, but when operating on enums, this features catched some bugs in my code already
20:23:40FromDiscord<sOkam!> What does Nim do in the background to optimize int operations? Is simd used, or not at all?
20:24:55FromDiscord<Phil> I don't think simd is used because I've seen packages that explicitly mention it
20:25:19FromDiscord<Phil> But super big disclaimer that I have no idea what I'm talking about when it gets this low
20:25:33FromDiscord<Phil> https://github.com/guzba/nimsimd
20:55:02FromDiscord<sOkam!> sent a long message, see http://ix.io/4mhD
21:04:04FromDiscord<Hourglass [She/Her]> sent a code paste, see https://play.nim-lang.org/#ix=4mhH
21:04:29FromDiscord<Hourglass [She/Her]> sent a code paste, see https://play.nim-lang.org/#ix=4mhI
21:04:33FromDiscord<Elegantbeef> Simd can be implicitly added by the C compiler with flags, but it's best to do it explicitly↵(@Phil)
21:05:02FromDiscord<Hourglass [She/Her]> (Making a minimal reproducible example would be very, very much a pain and more effort than just cloning, unless there's a tool that merges Nim source files
21:05:06FromDiscord<Hourglass [She/Her]> (edit) "files" => "files)"
21:06:08FromDiscord<Elegantbeef> No to the first, the most specific version of the proc is used to the second.↵(@sOkam!)
21:09:19FromDiscord<djazz> I'm using a C lib called JPEGDEC (for embedded) but when run on my computer (linux, 64 bit) I get a SIGSEGV, I think it's trying to access some memory it's not allowed to. However, when running the executable with gdb, it runs fine and everything works. Any idea what might cause it?
21:09:54FromDiscord<djazz> It's when it is dereferencing a pointer to value that it crashes.
21:10:18FromDiscord<djazz> and in gdb it works and the value is correct
21:11:34FromDiscord<sOkam!> In reply to @Elegantbeef "No to the first,": both good and bad news then 🙂 tyty ✍️
21:11:49FromDiscord<Elegantbeef> What are you doing for the first though
21:12:56FromDiscord<sOkam!> sent a code paste, see https://play.nim-lang.org/#ix=4mhL
21:13:03FromDiscord<luteva> In reply to @djazz "I'm using a C": lol: debug the same code you are working with 😄 maybe you are just in a different folder having two compilations or something like this?
21:13:29*kenran quit (Remote host closed the connection)
21:13:42FromDiscord<djazz> I would rewrite it in Nim, but hey xD
21:14:02FromDiscord<djazz> I dont want to reinvent a jpeg decoder
21:14:45FromDiscord<sOkam!> @djazz does pixie not work in that system?
21:15:22FromDiscord<djazz> perhaps... does pixie have low memory footprint?
21:15:33FromDiscord<sOkam!> no clue bout that
21:15:33FromDiscord<djazz> don't want to decode it all into memory
21:16:07FromDiscord<sOkam!> if it doesn't, maybe you could rewrite it to decode in the way you need, just by tweaking it
21:16:27FromDiscord<sOkam!> not sure if a good or bad idea, just someting that popped in my mind, in case it helps
21:16:30FromDiscord<djazz> i could comment out the code that crashes it... heh
21:16:47FromDiscord<djazz> its in the EXIF parser
21:22:03FromDiscord<Elegantbeef> Sokam i'm uncertain the issue
21:28:34FromDiscord<djazz> hmm i think the C code is broken, that part of the jpeg hasnt been loaded it seems...
21:36:07FromDiscord<djazz> its for extracting the thumbnail, which I dont use anyway
21:37:55FromDiscord<sOkam!> sent a code paste, see https://play.nim-lang.org/#ix=4mhQ
21:40:48FromDiscord<treeform> hey, I need a sanity check 0x1FFFFFFFF00000000 / 2 is 0xffffffffc0000000 right??? why does wolfram alpha says its https://www.wolframalpha.com/input?i=0x1FFFFFFFF00000000+%2F+2 0xffffffff80000000 ??? C vs 8 in the middle? WTF
21:41:27FromDiscord<Elegantbeef> `SomeInteger` sokam
21:42:41FromDiscord<Elegantbeef> Doesnt fix the issue but makes your code a whole hell of a lot more readable
21:42:51FromDiscord<pyolyokh> In reply to @treeform "hey, I need a": 8 is 1000, C is 1100
21:43:11FromDiscord<pyolyokh> you're shifting an F by 2.
21:43:27FromDiscord<sOkam!> yeah totally
21:43:30FromDiscord<pyolyokh> wolfram alpha isn't shifting by 2, it's doing something weird
21:43:45FromDiscord<pyolyokh> like, division with multiple conversions
21:44:03FromDiscord<sOkam!> sent a code paste, see https://play.nim-lang.org/#ix=4mhR
21:45:18FromDiscord<pyolyokh> In reply to @treeform "hey, I need a": also, you're not shifting by 2. you should have an 8
21:47:19FromDiscord<treeform> so who is right me or wolfram alpha?
21:47:40FromDiscord<pyolyokh> you are definitely wrong, because you shifted by 2 to get C
21:48:28FromDiscord<pyolyokh> what's 123 in decimal divided by 10? 12.3↵what's 1010 in binary divided by 2? 101
21:49:20FromDiscord<pyolyokh> F0 divided by 2 is 78 , not 7C
21:49:21FromDiscord<treeform> sent a code paste, see https://play.nim-lang.org/#ix=4mhU
21:49:34FromDiscord<pyolyokh> you're shifting 8 by 1, there
21:49:40FromDiscord<pyolyokh> you have F in your original question
21:50:38FromDiscord<pyolyokh> "F0 divided by 2 is 78" -> in decimal this is "240 divided by 2 is 120"
21:50:38FromDiscord<treeform> thanks that's my actual problem!
21:50:47FromDiscord<treeform> I did not see the 8 being there and not here
21:50:58FromDiscord<treeform> thank you for the sanity check!
21:51:16FromDiscord<treeform> I was looking for error in logic, but it was error in initial conditions
21:51:46FromDiscord<treeform> it caused me to pull hair out
21:57:53FromDiscord<sOkam!> Looks really promising for doing deterministic decimals math↵Posting in case its useful for anyone else https://media.discordapp.net/attachments/371759389889003532/1068288695821684757/fx.nim
21:58:05FromDiscord<sOkam!> (edit) "Looks" => "Looking"
21:58:23FromDiscord<Elegantbeef> I do also think you should just have `fx(i: SomeFloat)` and `fx(i: SomeInteger)`
21:58:32FromDiscord<Elegantbeef> Do not use `when` instead of just using proc dispatch
22:00:00FromDiscord<sOkam!> In reply to @Elegantbeef "I do also think": where do you mean?
22:00:17FromDiscord<Elegantbeef> There is no point in an exception that can be caught at CT
22:00:18FromDiscord<Elegantbeef> the `newFx`
22:00:53FromDiscord<sOkam!> what does it do if its missing the case then?
22:01:01FromDiscord<Elegantbeef> make that `fx` and write the 2 procs
22:01:05FromDiscord<Elegantbeef> statically error
22:01:50FromDiscord<sOkam!> ah, instead of the newFx, replacing it with those two procs?
22:01:54FromDiscord<sOkam!> sounds reasonable ye
22:01:57FromDiscord<Elegantbeef> Yes
22:02:01FromDiscord<Elegantbeef> No need for using `when` like this
22:04:34FromDiscord<sOkam!> ye, totally. very handy
22:05:48FromDiscord<m4ul3r> sent a code paste, see https://play.nim-lang.org/#ix=4mhV
22:06:16FromDiscord<m4ul3r> (edit) "https://play.nim-lang.org/#ix=4mhV" => "https://play.nim-lang.org/#ix=4mhW"
22:07:32FromDiscord<Elegantbeef> dynlib should be `header`
22:07:39FromDiscord<demotomohiro> `dynlib` pragma is for loading dll or so file, not for importing C functions in header file.
22:07:42FromDiscord<Elegantbeef> You dont dynamically load headers
22:09:14FromDiscord<demotomohiro> @m4ul3r In think you need to find which .dll file contains that function (read microsoft dev page for windows api).
22:09:23FromDiscord<m4ul3r> I see, i see that the one I was modeling off of was leaving off .h.
22:09:25FromDiscord<sOkam!> sent a code paste, see https://play.nim-lang.org/#ix=4mhZ
22:09:46FromDiscord<m4ul3r> I've been referencing the dev page, it is included in ktm32.h
22:09:57FromDiscord<m4ul3r> oh, forgetting the w
22:10:50FromDiscord<m4ul3r> ktmw32 - lol↵looks like it is working with dynlib now
22:14:13*clemens3 quit (Read error: Connection reset by peer)
22:15:36FromDiscord<Elegantbeef> Sokam no clue what you mean
22:17:18FromDiscord<lithiumfrost> If I get back a buffer of LPBYTE and a length (I think that's a char []), how to I read and convert that back to a string value?
22:17:19FromDiscord<sOkam!> This: https://github.com/treeform/vmath/blob/f4c668874e48e9153d52c4d098f8202e5abec8a9/src/vmath.nim#L475-L476↵Which is used here: https://github.com/treeform/vmath/blob/f4c668874e48e9153d52c4d098f8202e5abec8a9/src/vmath.nim#L507-L512↵I started rewriting, but I might not even need to or something. I just assume its going to write the int representation and/or fail, since the LSP was complaining about it
22:17:41FromDiscord<sOkam!> (edit) "This: https://github.com/treeform/vmath/blob/f4c668874e48e9153d52c4d098f8202e5abec8a9/src/vmath.nim#L475-L476↵Which is used here: https://github.com/treeform/vmath/blob/f4c668874e48e9153d52c4d098f8202e5abec8a9/src/vmath.nim#L507-L512↵I started rewriting, but I might not even need to or something. I just assume its going to write the int representation and/or fail, since the LSP was complaining about it" => "sent a long message
22:18:07FromDiscord<Elegantbeef> It shouldnt error
22:18:15FromDiscord<Elegantbeef> It should write your value's type
22:19:03FromDiscord<sOkam!> but i have no `$` defined
22:19:12FromDiscord<Elegantbeef> Ah
22:19:19FromDiscord<Elegantbeef> Wait that doesnt matter for `type`
22:19:27FromDiscord<Elegantbeef> `typedesc` have `$` defined
22:19:32FromDiscord<sOkam!> oh
22:19:44FromDiscord<sOkam!> hmmm so this is only for vector/matrices then 🤔
22:22:01FromDiscord<sOkam!> wait, it is actually not registering the generic constructors in the mat.nim and vec.nim files
22:22:30FromDiscord<sOkam!> (edit) "wait, it is actually not registering the generic constructors ... in" added "from vmath.GVec and vmath.GMat"
22:29:27FromDiscord<lithiumfrost> Can I just cast the ptr to a Stream?
22:30:32FromDiscord<Elegantbeef> To get a string you do `$myCstring`
22:31:54FromDiscord<lithiumfrost> What if it's not null terminated?
22:32:05FromDiscord<lithiumfrost> I have a length instead
22:32:53FromDiscord<Elegantbeef> `copyMem` with a `newString(len)`
22:33:22FromDiscord<Elegantbeef> sent a code paste, see https://play.nim-lang.org/#ix=4mi6
22:33:38FromDiscord<lithiumfrost> Thanks, would have taken me forever to figure that one out
22:35:14FromDiscord<sOkam!> sent a code paste, see https://play.nim-lang.org/#ix=4mi7
22:35:32FromDiscord<Elegantbeef> no `$` for your type
22:35:38FromDiscord<Elegantbeef> So it doesnt handle it and just emits a `...`
22:36:29FromDiscord<sOkam!> ahh
22:36:56FromDiscord<Elegantbeef> !eval echo (new int,)
22:37:01NimBot(...,)
22:41:21FromDiscord<sOkam!> `(arr: [91.902, 48.0])` theeere you go 🙂
22:44:08FromDiscord<sOkam!> wait, it should be zero padded 🤔 ↵do i need std/strformat for formatting an int with zeros before it when representing as a string?
22:44:42FromDiscord<sOkam!> (edit) "it" => "it,"
22:46:11*clemens3 joined #nim
22:46:54*clemens3 quit (Client Quit)
22:47:58*clemens3 joined #nim
22:48:48*clemens3 quit (Client Quit)
22:48:57FromDiscord<sOkam!> sent a code paste, see https://play.nim-lang.org/#ix=4mi8
22:49:04FromDiscord<Elegantbeef> formatFloat
22:49:15FromDiscord<sOkam!> but they are ints
22:50:09FromDiscord<sOkam!> i guess i could pass through float for a simpler version of the same idea, and truncate the zeros 🤔
22:52:19FromDiscord<sOkam!> sent a code paste, see https://play.nim-lang.org/#ix=
23:05:39FromDiscord<sOkam!> Is there a way to get the base type of some type that has inherited another?↵As in, getting `int32` as a result from checking the type of : `type Base = distinct int32`
23:06:24FromDiscord<Elegantbeef> distinctBase in std/typetraits
23:06:24FromDiscord<Elegantbeef> It's also not inheritance 😄
23:06:47FromDiscord<sOkam!> what would it be called? aliasing?
23:06:57FromDiscord<Elegantbeef> Distinct type 😄
23:07:07FromDiscord<Elegantbeef> Aliasing is `type A = b`
23:10:12FromDiscord<sOkam!> how do you do the same for a non-distinct type?
23:11:28FromDiscord<sOkam!> `print (Fx.distinctBase).type` is giving me `Base`, but that's where it should be getting the int32 from, because `Base = int32` and `Fx = distinct Base`
23:13:36FromDiscord<Elegantbeef> Make a macro if you want that
23:13:40FromDiscord<Elegantbeef> Dont see the point though
23:14:13FromDiscord<sOkam!> sent a code paste, see https://play.nim-lang.org/#ix=4mih
23:14:36FromDiscord<Elegantbeef> You're using an alias that's the point to alias a type
23:14:44FromDiscord<Elegantbeef> But it's not a complicated macro to get to the bottom
23:15:20FromDiscord<sOkam!> i've never written a macro ever, though. i have no clue how to navigate them. i tried before, and they are like cryptograms for me for some reason 😔
23:18:20termerI hit a very interesting issue with Nim's asyncnet module
23:18:55termerIn a multithreaded environment with asynchttpserver, you're supposed to call shouldAcceptRequest to check if the maximum number of file descritors have been reached
23:19:42termerhowever, in a multithreaded environment, there's apparently a vulnerability to race conditions, so 2 concurrent calls can return true even if a file descriptor has been opened
23:19:42FromDiscord<Elegantbeef> sent a code paste, see https://play.nim-lang.org/#ix=4mik
23:20:14termerif you're restarting your HTTP thread, this leads to a memory leak if you're not closing your AsyncHttpServer socket
23:20:16FromDiscord<Elegantbeef> 'you're supposed to call shouldAcceptRequest to check if the maximum number of file descritors have been reached'↵↵that's a race condition and a half
23:20:27termerbut if you are, then it can lead to a read to nil, which crashes the program
23:20:57termerI'll test it out with locks, but this looks like an area that could be documented
23:21:08termerI don't have this issue in a singlethreaded environment
23:21:13FromDiscord<Elegantbeef> Even with locks you can have a third program that opens another file descriptor
23:21:20*azimut quit (Ping timeout: 255 seconds)
23:21:21*azimut_ joined #nim
23:21:34FromDiscord<Elegantbeef> So it'll work without anything else happening on the PC
23:21:54termerSo perhaps both the locking during the check and locking during the sleep between checks is necessary
23:22:02FromDiscord<Elegantbeef> The solution should be just "attempt to open and handle in the case it errors"
23:22:32FromDiscord<Elegantbeef> If that fails to work then a PR is needed to make it work
23:22:33termerwell the issue is that the crash happens when closing the AsyncHttpServer
23:22:54termerI think it must be trying to close connections that are nil
23:22:58termerwhich seems like a bug
23:25:02termerI suppose this could be mitigated by handling IOSelectorsException around the accept call
23:26:44FromDiscord<sOkam!> sent a code paste, see https://play.nim-lang.org/#ix=4mil
23:28:45FromDiscord<Elegantbeef> And here i thought sokam said i was rude
23:29:13termerInterestingly, wrapping the acceptRequest call with a try/except doesn't solve the problem
23:29:22termerit only gets called a few times before something outside of that loop triggers it
23:29:28termersomewhere in async world
23:29:41termerthe stack trace is useless lol
23:29:44FromDiscord<Elegantbeef> Yea i mean if you attempt to open a socket and it cannot an exception should be raised
23:29:51FromDiscord<Elegantbeef> So it's... quite silly how it presently works
23:30:22FromDiscord<Elegantbeef> Same with if attempt to add an asyncfd
23:30:47FromDiscord<Elegantbeef> I'd suggest using chronos
23:30:50FromDiscord<Elegantbeef> It likely isnt this silly
23:31:05termerPart of this could be mitigated if acceptRequest didn't take a callback
23:31:17termercause it sends that away to be run some other place with asyncCheck
23:31:21termerinstead of awaiting it right there
23:31:58termerwith how it is currently, the exception gets raised in the context of the place where polling started
23:32:04termerso in this case, a waitFor in another proc
23:32:28termerIs Chronos good? I never wanted to touch that stuff cause it doesn't use asyncdispatch
23:32:39termerand introduces a whole new chain of dependencies
23:35:40FromDiscord<Elegantbeef> It's generally a better async implementation afaik
23:35:41FromDiscord<Elegantbeef> I dont use async so cannot say much
23:45:22termerlooks like I'm gonna be using chronos
23:48:21termerSo, I'm able to ward off some of the errors by restructuring things
23:48:25termerbut it still eventually reads from nil
23:48:30termeron close
23:49:49termerit looks like a socket is nil somewhere
23:50:25termerok......
23:50:34termerso now I have to check whether the socket is nil
23:50:59termerThe crashes stop when I add a nil check before doing any closing inside of asyncnet.nim
23:51:56termerThere's also a memory leak here somewhere
23:52:03termermaybe
23:56:44termerGuess I'm nuking this code and starting with Chronos lol
23:57:02termernim async networking is pretty insane