<< 20-09-2024 >>

00:33:09*SchweinDeBurg joined #nim
00:54:41FromDiscord<majortrips1763> Are there any provisions for doing send/expect testing of interactive text interfaces?
01:29:15*rstrz quit (Quit: Lost terminal)
01:33:46*SchweinDeBurg quit (Quit: WeeChat 4.5.0-dev)
01:44:02*xutaxkamay quit (Quit: ZNC 1.8.2+deb3.1+deb12u1 - https://znc.in)
01:44:56*xutaxkamay joined #nim
01:50:47*lucasta quit (Quit: Leaving)
03:48:42*rockcavera quit (Remote host closed the connection)
03:55:43*SchweinDeBurg joined #nim
05:15:31*ntat joined #nim
06:05:50*wikipedia joined #nim
06:35:22*PMunch joined #nim
06:37:39*mfg joined #nim
06:39:10*mfg quit (Client Quit)
06:39:25*mfg joined #nim
06:45:42*xet7 quit (Remote host closed the connection)
06:50:51FromDiscord<pmunch> In reply to @majortrips1763 "Are there any provisions": What do you mean?
07:31:37FromDiscord<enthus1ast.> std/json is missing a proc that just transforms the element to a string, regardless if its int,float,string etc
07:31:57FromDiscord<enthus1ast.> i find myself often to write this, maybe i should make a pr
07:33:14FromDiscord<enthus1ast.> the provided `$` contains the \"
07:33:24FromDiscord<enthus1ast.> that i wanna get rid of
07:40:49FromDiscord<enthus1ast.> sent a code paste, see https://play.nim-lang.org/#pasty=ORxhyNCA
07:41:44FromDiscord<enthus1ast.> i use this quite often when i want to present values from Json to the user
07:42:06FromDiscord<enthus1ast.> JObject and JArray are just there to make the case happy, but its not the actual use case
07:49:12FromDiscord<Phil> In reply to @enthus1ast. "std/json is missing a": Why not make your own json module, do an import json except $ as bla, define and export your own $, export bla
07:49:58FromDiscord<enthus1ast.> i just did https://github.com/enthus1ast/nimJsonExtends/blob/master/src/jsonExtends.nim
07:50:07FromDiscord<enthus1ast.> but i still want to keep the original stuff
07:50:14FromDiscord<Phil> At least allows you to use usual nim-isms like $for stringificarion
07:51:04FromDiscord<Phil> Is toString implicitly used for $
07:51:09FromDiscord<Phil> (edit) "$" => "$?"
07:51:47FromDiscord<Phil> Otherwise I was more talking about "replacing" (via doing a partial import and export + writing your own)
07:53:03FromDiscord<enthus1ast.> sent a code paste, see https://play.nim-lang.org/#pasty=fijfhscZ
07:53:33FromDiscord<enthus1ast.> and $ adds the ' " ' to strings
07:53:53FromDiscord<enthus1ast.> and when you just want to show users the value you must write a case
07:54:39FromDiscord<Phil> That's why you don't import it and define your own $
07:55:46FromDiscord<Phil> I wasn't telling you to get rid of toString, I was telling you to rename it $ and deal with the ambiguous symbol by never exposing json.$
07:56:42FromDiscord<Phil> In reply to @enthus1ast. "the thing is that:": As for why this screws up, can't say without a laptop and I'm about to go cycling so no chance for me to look deeper into it
08:31:50FromDiscord<enthus1ast.> Same here but with deutsche Bahn. I think this is desired behavior
08:31:58FromDiscord<enthus1ast.> From $
08:32:27FromDiscord<enthus1ast.> But it's not very useful to me
09:25:51FromDiscord<Phil> In reply to @enthus1ast. "But it's not very": Ye, which is why you replace it on your end and then use as normal😄
09:57:52*om3ga joined #nim
10:16:40FromDiscord<kyepskee> Any idea why I can't register on the Nim forum? I get the error "Couldn't send email"
10:43:40PMunchHappens from time to time
10:43:47PMunchAre you the one who created the issue yesterday?
10:45:09FromDiscord<kyepskee> No
10:45:31PMunchHmm, might have an issue with the email sending then
10:45:35PMunchSeems more prevalent than usual
10:45:55FromDiscord<pmunch> Could you PM me your e-mail and I can get it sorted
10:57:22FromDiscord<kyepskee> Sure, thanks
11:47:04*ryuukk quit (Remote host closed the connection)
11:49:23*ryuukk joined #nim
12:07:21FromDiscord<Nlits (Ping on reply)> How do i fix this: `/data/data/com.termux/files/home/.nimble/pkgs2/httpx-0.3.7-6e0fc3133fbd20530d53ab2792e93d3151387b10/httpx.nim(557, 19) Error: undeclared identifier: 'addTimer'`
12:08:11FromDiscord<Nlits (Ping on reply)> (It seems to be a system dependent error as i saw the exact same error on a prologue github issue.)
12:08:35FromDiscord<Nlits (Ping on reply)> Past that asyncdispatch is clearly imported so idk what is going on
12:10:13*lucasta joined #nim
12:10:43FromDiscord<Nlits (Ping on reply)> And i checked the system files and nothing was wrong with asyncdispatch
12:11:06FromDiscord<enthus1ast.> In reply to @PMunch "Seems more prevalent than": Does the forum contains the patches for helo/eloh ?
12:20:05PMunchDepends, where are they?
13:54:39*ryuukk quit (Remote host closed the connection)
13:56:23*ryuukk joined #nim
13:56:45*alexdaguy joined #nim
14:03:41FromDiscord<majortrips1763> sent a long message, see https://pasty.ee/ibhOPLsT
14:05:24FromDiscord<pmunch> Well you can use `expect` with Nim
14:05:32FromDiscord<pmunch> Not sure if anyone has created tools on top of that though
14:05:55*Guest82 joined #nim
14:11:48FromDiscord<majortrips1763> Yah, `expect` i just an example here, but it isn't easy to get it to work for the particular use cases I need. Python's `pexpect` has the necessary base functionality, but it has to have an entire tool developed on-top of it to make it remotely friendly to write tests in and handle the entire application session while still catch a variety of unsolicited error conditions when there is no exit status (stack traces, kernel OOPS, etc)
14:17:38*coldfeet joined #nim
14:30:13*PMunch quit (Ping timeout: 248 seconds)
14:46:13*mfg quit (Ping timeout: 248 seconds)
14:48:42*PMunch joined #nim
14:50:47*alexdaguy quit (Quit: ded)
15:04:23*ntat quit (Remote host closed the connection)
15:04:52*ntat joined #nim
15:20:25FromDiscord<enthus1ast.> In reply to @PMunch "Depends, where are they?": They're in the SMTP module
15:23:11FromDiscord<enthus1ast.> https://github.com/nim-lang/smtp/blob/829a2a11c4899740cf82c0c58fb7704f96fc293c/src/smtp.nim#L233
15:36:48*ntat quit (Remote host closed the connection)
15:38:46*ntat joined #nim
16:20:05FromDiscord<vindaar> In reply to @majortrips1763 "Yah, `expect` i just": while it sounds like you want a lot more control, my `shell` library does have basic `send` / `expect` functionality:↵https://github.com/Vindaar/shell?tab=readme-ov-file#handling-programs-that-require-user-input
16:24:54*lucasta quit (Ping timeout: 260 seconds)
16:33:14FromDiscord<majortrips1763> sent a long message, see https://pasty.ee/EnKbdHbL
16:40:28*xet7 joined #nim
16:41:54FromDiscord<majortrips1763> It is a little interesting to me because, even though the framework does cater to low level development work .. it is a fully usable tooling for any random binary (C/C++/ObjC/Nim/etc), in which the binary is launched via `gdbserver` (even locally) and then use `gdb` to attach to the running program, or to run the program via `gdb` and pass the `--tty` option to wire up the stdin/stdout for the program onto a different set of descri
16:42:25*mfg joined #nim
16:44:38FromDiscord<jd01g> Does anyone have an example project showing how to use Futhark in "project mode" in a way that plays nice with cross compilation? (I'm getting; `os module not ported to your operating system`)
16:55:01FromDiscord<carogaph_> guys my installation is just stuck here idk why https://media.discordapp.net/attachments/371759389889003532/1286732358656983113/image.png?ex=66eefa64&is=66eda8e4&hm=66baf28f925873f7139f044af0f77ab710746683a5f5fbd081f765dc9923bdd4&
16:55:21*PMunch quit (Quit: Leaving)
16:56:25FromDiscord<pmunch> @enthus1ast. Hmm, not sure
16:56:44FromDiscord<pmunch> Remind me at some point to check that
16:57:25FromDiscord<pmunch> @jd01g I do. It's the reason I added project mode in fact. We're using it to wrap FreeRTOS to run on a NXP microcontrollor
16:57:53*coldfeet quit (Remote host closed the connection)
16:58:07*SchweinDeBurg quit (Quit: WeeChat 4.5.0-dev)
17:04:00FromDiscord<Phil> In reply to @majortrips1763 "It is a little": I would typically say no, but after seeing your usecase I'm not convinced. Like, I'm sure you could set up some level of testing using testament, but it's not necessarily easy.↵My main issue in nim has always been and remains mocking when you're programming procedurally, but it doesn't look like that one's your key concern
17:04:23FromDiscord<Phil> (edit) "convinced." => "convinced that what I know around nim's unit-testing story applies to your stuff."
17:05:44*mfg quit (Ping timeout: 260 seconds)
17:07:45FromDiscord<majortrips1763> sent a long message, see https://pasty.ee/KQzyvKFK
17:09:50FromDiscord<carogaph_> this is about what I expected joining a nim discord server: Like four dudes who write freaking essays to eachother about nim
17:12:44FromDiscord<Phil> In reply to @majortrips1763 "Correct, mocking isn't the": Beyond std/unittest or status replacement of that I'm not aware of anything. You could run nimble search test to see if any of that speaks to you, though keep an eye out on the "last commit" history.↵Though anything from treeform and status-im should be pretty solid in any scenario
17:20:30FromDiscord<jd01g> In reply to @pmunch "<@940951696178311200> I do. It's": Oh amazing thank you ☺️.... I'll check GitHub for the repo
17:31:08FromDiscord<majortrips1763> sent a long message, see https://pasty.ee/VeuBsTFJ
17:31:36FromDiscord<majortrips1763> (edit) "https://pasty.ee/JwzySZQx" => "https://pasty.ee/XaYZiOpk"
17:31:56FromDiscord<pmunch> In reply to @jd01g "Oh amazing thank you": Unfortunately it's a work thing so not publicly available
17:40:47FromDiscord<Phil> sent a code paste, see https://play.nim-lang.org/#pasty=DGqfZqRd
17:42:27FromDiscord<Phil> In reply to @majortrips1763 "I did find an": Could try to have a chat with the creator, Basically open an issue and see to get in contact through that.↵Crashappsec seems eerily familiar, like an org somebody made and I forgot about it
17:42:44FromDiscord<Phil> Ohhhh that's @jviega !
17:44:00FromDiscord<Phil> Not sure how active they are nowadays since I had to reduce my own activity lately due to work (and summer heat frying my brain).
17:49:56FromDiscord<majortrips1763> sent a long message, see https://pasty.ee/QVGqlhEi
17:52:57FromDiscord<jd01g> In reply to @pmunch "Unfortunately it's a work": Ahh I was just coming back to ask as I couldn't find it 😄
18:02:32FromDiscord<Phil> Can you read in an entire file and parse it into NimNodes for a macro?
18:06:30FromDiscord<arathanis> Is there a way to resolve `this proc is not available on the NumScript/js target` error?
18:06:38FromDiscord<arathanis> (edit) "NumScript/js" => "NimScript/js"
18:09:40FromDiscord<Phil> sent a code paste, see https://play.nim-lang.org/#pasty=cSaYKcvH
18:14:53*ntat quit (Remote host closed the connection)
18:15:13*ntat joined #nim
18:18:49FromDiscord<Phil> In reply to @arathanis "Is there a way": Seems more like a forum question, unless the amount of folks using the js target increased lately
18:18:49FromDiscord<Phil> Other than that the only expert on the js target I'm aware of is @hotdog6666
18:24:40Amun-Raarathis: which one?
18:25:20Amun-Raarathanis*
18:27:34FromDiscord<Phil> sent a code paste, see https://play.nim-lang.org/#pasty=AaQPnYPN
18:27:58FromDiscord<Phil> (edit) "https://play.nim-lang.org/#pasty=BJuiaWym" => "https://play.nim-lang.org/#pasty=iDbtxeQl"
18:28:54FromDiscord<Phil> (edit) "https://play.nim-lang.org/#pasty=DXqWvvez" => "https://play.nim-lang.org/#pasty=fGNurpAB"
18:39:15*SchweinDeBurg joined #nim
18:49:53*ntat quit (Remote host closed the connection)
18:51:42*ntat joined #nim
18:54:51*ntat quit (Remote host closed the connection)
18:55:13*ntat joined #nim
18:59:48*ntat quit (Remote host closed the connection)
19:08:27*ntat joined #nim
19:29:35FromDiscord<xkonti> sent a code paste, see https://play.nim-lang.org/#pasty=AZwFasUm
19:29:59FromDiscord<Elegantbeef> `type Major = range[0..7]`
19:32:40FromDiscord<xkonti> sent a code paste, see https://play.nim-lang.org/#pasty=yhWUbxyz
19:33:07FromDiscord<Elegantbeef> That's not valid Nim
19:33:13FromDiscord<Elegantbeef> That's not valid anywhere
19:33:25FromDiscord<Elegantbeef> `tuple[gap: Gap[T], value: T]` or use an object
19:33:48FromDiscord<Elegantbeef> `args` is defaulted to `@[]` so that's redundant
19:35:21FromDiscord<xkonti> Aaah. So if I run `@[]` it's complaining that it can't infer the `T` type... And I see my goof with the tuple 🙃 Too much time between reading Nim tutorials vs actually coding something.
19:35:48FromDiscord<Elegantbeef> Yes you might be able to do `default seq[T]`
19:35:55FromDiscord<Elegantbeef> But again that's just `args: seq[T]` so silly to do
19:40:41FromDiscord<Elegantbeef> sent a code paste, see https://play.nim-lang.org/#pasty=aLEFstIq
19:40:49FromDiscord<Elegantbeef> This just errors an inane error
19:44:46*ntat quit (Remote host closed the connection)
19:50:21FromDiscord<xkonti> As long as it defaults to the proper value without assigning it explicitly, it's fine 🙂
19:54:38FromDiscord<fabric.input_output> you could also define the `default` proc manually
19:56:23FromDiscord<Elegantbeef> That fails when you do like `var a: T` though so it's a bit ugh
20:13:55FromDiscord<xkonti> sent a code paste, see https://play.nim-lang.org/#pasty=snxCJKHp
20:15:24FromDiscord<Elegantbeef> Well `default seq[SomeType]` is a genericable solution
20:15:35FromDiscord<Elegantbeef> though `newSeq[T]()` allocates
20:16:12FromDiscord<Elegantbeef> Or atleast I think it preallocates a small block
20:17:44FromDiscord<Elegantbeef> sent a code paste, see https://play.nim-lang.org/#pasty=slKuWlXe
20:18:38FromDiscord<jviega> In reply to @majortrips1763 "I have been reviewing": What do you mean that it doesn't look finished? It 100% is, we use it. The underlying pub/sub model is all in C, but I believe it's wrapped. The expect code hasn't changed because it hasn't needed to, but the underlying util library where the I/O code is kept we definitely update much more frequently.
20:19:44FromDiscord<majortrips1763> @jviega Was referring to the comments in the README.md regarding `The switchboard`
20:20:41FromDiscord<jviega> The README probably hasn't been updated; I still use the library for testing myself
20:20:54FromDiscord<majortrips1763> I also admit I have not looked at most of the rest of the source atm outside of the `expect.nim` as that is the primary functionality I am mostly interested in.
20:25:41FromDiscord<jviega> Well, that doesn't have to do too much given what we've built below it. That's why it hasn't been updated.
20:29:17FromDiscord<majortrips1763> Yah, ever since my original comments I have been slowly working my way through the code and trying to grok as much of the underlying work. I think I have worked out how to wire up quite a few of my use cases, w/ maybe the exception of the `gdb --tty` option.
20:29:46FromDiscord<majortrips1763> Well, and remote applications.
20:29:46FromDiscord<jviega> Okay cool, sorry it's not very documented 🙂
20:30:28FromDiscord<majortrips1763> Oh, that is fine .. I only really became really aware of Nim this last week and have been working through as much of it as possible.
20:30:39FromDiscord<Phil> Would be a prime opportunity to contribute some docs 😄
20:30:47FromDiscord<majortrips1763> Reading the source for stuff like this is really helpful to me.
20:34:00FromDiscord<majortrips1763> @jtv for reference, trying to test an interactive application while automating `gdb` which is controlling said application. Gb can move stdin/stdout to an alternate tty , so I would need to have some way to wire up an ExpectObject context onto whatever tty was reported by `gdb` https://visualgdb.com/gdbreference/commands/tty
20:34:18FromDiscord<majortrips1763> (edit) "Gb" => "Gdb"
20:35:29FromDiscord<majortrips1763> Hmm, though, perhaps a more realistic approach would be to support the gdbserver API directly w/out invoking the `gdb` client.
20:36:55*wikipedia quit (Read error: Connection reset by peer)
20:42:41FromDiscord<majortrips1763> The larger issue there is that `gdb` does an aweful lot of useful/neat stuff that would be a real pain to deal with by reinventing the entire client a nim module.
20:44:52FromDiscord<majortrips1763> woul be a lot easier to wrap up gdb and interact w/ it via its `mi` output.
20:44:54FromDiscord<jviega> Yeah, it's easy to do under the hood; just open the tty then add it to the pub/sub model
20:53:01FromDiscord<jviega> So I guess I don't exactly understand what you have in mind @majortrips1763 but if you're spawning gdb and wrapping it w/ that library, anything that gdb would display to you will get captured on the tty that gdb is bound to anyway.
21:09:46FromDiscord<majortrips1763> sent a long message, see https://pasty.ee/eMwqDCMv
21:11:36FromDiscord<majortrips1763> Also, various applications as well as hardware solutions support the gdbserver remote API, such as qemu and network JTAG devices. So the applications tty's might be serial ports, or network serial ports, or some network serial port server, or a USB device, and gdbserver might be a network JTAG that.
21:11:53FromDiscord<majortrips1763> (edit) "that." => "hardware device."
21:12:05FromDiscord<arathanis> In reply to @isofruit "Seems more like a": It's not that I am trying to use JS, its jst the error is blocking me from using it at all.
21:12:05FromDiscord<majortrips1763> It is a whole collectiojn of fun.
21:12:12FromDiscord<arathanis> In reply to @Amun-Ra "arathis: which one?": `createDir`
21:12:51FromDiscord<Elegantbeef> Stop trying to create a dir at CT
21:14:15FromDiscord<arathanis> In reply to @Elegantbeef "Stop trying to create": Not a surprising answer.
21:14:37FromDiscord<arathanis> Figured it would be something like that.
21:14:40FromDiscord<Elegantbeef> If you're inside a nims there are other procedures to use
21:15:28FromDiscord<arathanis> In reply to @Elegantbeef "If you're inside a": Any examples?
21:15:39FromDiscord<Elegantbeef> https://nim-lang.org/docs/nimscript.html
21:15:57FromDiscord<jviega> @majortrips1763 Sure, so if you want to manipulate it all, but can get the ttys, you can do whatever you want with them independently, whether it be read-side or write-side. So you could both manipulate or capture GDB and the process you're spawning. Probably easiest thing to do is to have a version of that expect constructor that lets you pass in ptys instead of spawning them, but easily done. LMK if it's not easy to figure out
21:16:31FromDiscord<arathanis> oh there is a literal `mkDir` in nims
21:17:42FromDiscord<Elegantbeef> It will not work at compile time, but if you're inside `.nims` it will
21:18:15FromDiscord<arathanis> im specifically working with `.nims` so that should be fine, im not trying to do heinous compile time shenanigans
21:19:20FromDiscord<majortrips1763> In reply to @jviega "<@661414156846628885> Sure, so if": Yah, I was thinking of doing the alternate version of the expect constructor to pass the pty's. I was also toying with supporting passing raw fd's as well for potentially wiring up any modules that could handle various network protocols. E.g. ssh, ftp, or something similar.
21:20:04FromDiscord<majortrips1763> Would bring the functionality a little closer to Python's `pexpect`.
21:29:46FromDiscord<majortrips1763> sent a long message, see https://pasty.ee/oaluKBbJ
21:33:03FromDiscord<jviega> So when you're talking over the PTY's fds, you get no ability to differentiate between stdout and stderr inside the process, unless you have some other reference to the proper file descriptor that you've passed in some other way. In your specific case you might want to pass down an extra file descriptor that you arrange to make stderr, or you can do signal handling to do something like pass libbacktrace stacks up on a crash, ...
21:33:52FromDiscord<jviega> ttys just don't give you that 3rd file descriptor unfortunately. They get munged together in the terminal driver, so you have to take special action to separate them.
21:34:51FromDiscord<jviega> I have done exactly that kind of thing myself, just passed down the fds I want used inside the managed process...
21:34:51FromDiscord<majortrips1763> In reply to @jviega "So when you're talking": Yah, stderr will end up being part of stdout in this use case.
21:36:13FromDiscord<jviega> I guess if it's my own software I'm instrumenting, I prefer to have my own signal handlers feeding me info, but you obviously could get it from the gdb fds in that case
21:40:52FromDiscord<majortrips1763> sent a long message, see https://pasty.ee/EqGTqwvl
21:41:58FromDiscord<jviega> Makes sense. Anyway, if you end up using it at all and need anything just lmk.
21:51:36FromDiscord<Nlits (Ping on reply)> Prologue issue: Logging doesn't work inside middleware. All the default debug logs show, so i know it isn't a level issues, and the code is running, as i am getting the right response. How would i fix this?
21:59:57*Guest82 quit (Quit: Client closed)
23:07:19FromDiscord<arathanis> is there a compiler flag for disabling removing of dead code in Nim?
23:07:34FromDiscord<Elegantbeef> Nope
23:08:11FromDiscord<arathanis> Is there a way to be warned it is removing dead code?
23:10:48*beholders_eye joined #nim
23:12:05FromDiscord<Elegantbeef> No
23:16:56FromDiscord<demotomohiro> `export` pragma prevents unused procs beging removed.