<< 06-07-2023 >>

00:26:23NimEventerNew post on r/nim by Teyakko: Distributed computing in Nim, see https://reddit.com/r/nim/comments/14rsecs/distributed_computing_in_nim/
00:41:01FromDiscord<gogolxdong666> Tip: 5 messages have been suppressed, use --verbose to show them.↵nimble.nim(683) getDownloadInfo↵↵ Error: Package bncurve@any version not found.
00:41:47FromDiscord<gogolxdong666> nimble doesn't work properly on windows.
00:52:45FromDiscord<gogolxdong666> `↵nimble v0.14.2 compiled at 2023-07-05 12:18:51↵git hash: 168416290e49023894fc26106799d6f1fc964a2d↵`
00:57:26*cnx quit (Remote host closed the connection)
00:58:18*cnx joined #nim
02:26:26*cyraxjoe quit (Ping timeout: 252 seconds)
02:27:06*cyraxjoe joined #nim
02:35:27*cyraxjoe quit (Ping timeout: 246 seconds)
02:40:51*cyraxjoe joined #nim
03:08:46FromDiscord<wungussy> Is there a Nim version of Python's requests module for checking the response code of opening websites? ↵https://pypi.org/project/requests/
03:09:52FromDiscord<Elegantbeef> the `std/httpclient` does have a way to get the response code
03:16:36*cyraxjoe quit (Read error: Connection reset by peer)
03:17:19FromDiscord<wungussy> Ok thanks
03:20:22*cyraxjoe joined #nim
03:52:26*ltriant joined #nim
04:10:08FromDiscord<demotomohiro> When I use macrocache, I define `CacheTable` like const `mcTable = CacheTable"myTable"`.↵But what does string literal part "myTable" do?↵I can use it even if defined like `const mcTable = CacheTable""`, but using empty string can cause a problem?
04:16:13FromDiscord<leorize> the string is the unique identifier for the table
04:16:30FromDiscord<leorize> anyone with the same string can access the same table, iirc
04:21:25FromDiscord<Elegantbeef> Yep
04:25:26*azimut_ joined #nim
04:25:38*azimut quit (Ping timeout: 240 seconds)
05:05:36FromDiscord<demotomohiro> @leorize Thank you! So I have to use unique identifier so that it doesn't overlap other CacheTable.
05:19:58*ltriant quit (Read error: Connection reset by peer)
05:21:25*azimut_ quit (Remote host closed the connection)
05:21:48*azimut joined #nim
05:25:13*ltriant joined #nim
06:15:09*ntat joined #nim
06:42:35*PMunch joined #nim
07:00:55*xet7 quit (Ping timeout: 245 seconds)
07:09:18*azimut quit (Ping timeout: 240 seconds)
07:13:15*xet7 joined #nim
07:40:37FromDiscord<amjadhd> sent a code paste, see https://play.nim-lang.org/#ix=4zS7
07:43:04FromDiscord<Elegantbeef> aside from using `toSet` from `std/setutils`?
07:43:21FromDiscord<Elegantbeef> Oh wait you're avoiding uppercase and other characters
07:43:27FromDiscord<Elegantbeef> I'm too tired for this helping thing
07:43:44FromDiscord<Elegantbeef> I don't think you can use collect here
07:59:03PMunchDamn it, why aren't closure iterators allowed to recurse?
07:59:33PMunchI get why normal iterators aren't, since they just expand the code, but closure iterators should be allowed to, no?
08:00:08PMunchamjadhd, easiest would be toLowerAscii, no?
08:00:39FromDiscord<Elegantbeef> Perhaps, likely just a limitation on how lambda lifting is done
08:01:06PMunchThis really turns this problem from finicky to hard..
08:02:00FromDiscord<Elegantbeef> Could you make an iterator that takes an iterator and does the internal operation?
08:06:18PMunchHmm, seems promising: https://play.nim-lang.org/#ix=4zSb
08:06:22PMunchAssuming this is what you meant
08:06:31FromDiscord<Elegantbeef> Yea
08:23:36PMunchThat worked like a charm
08:23:55PMunchWould be nice though if the compiler did this by itself for this case
08:35:55FromDiscord<amjadhd> In reply to @PMunch "<@629598664452734989>, easiest would be": The example was to illustrate that `collect` falls short here, and to check if it can be fixed.
08:43:30*ovenpasta joined #nim
08:57:47FromDiscord<demotomohiro> In reply to @amjadhd "How do I fix": You got an error because else branch of case is discard.↵All branches must be same type expression.
09:16:58FromDiscord<amjadhd> In reply to @demotomohiro "You got an error": I know, shouldn't collect account for the use of `discard`, `continue` and `break` ?
09:18:44*PMunch_ joined #nim
09:21:57*PMunch quit (Ping timeout: 250 seconds)
10:10:35*junaid__ joined #nim
10:25:47*arkanoid quit (Ping timeout: 264 seconds)
10:31:09*junaid__ quit (Remote host closed the connection)
10:41:54*antranigv quit (Quit: ZNC 1.8.2 - https://znc.in)
10:44:42FromDiscord<planetis_m> Is there anything like seq.size that would be correct even after casting? If you cast a seq[byte] to seq[tuple[r,g,b,a:uint8]] for example, pixels.lensizeof(T) would give you the wrong results
10:48:15*ltriant quit (Ping timeout: 246 seconds)
10:53:03*ltriant joined #nim
10:55:48*antranigv joined #nim
10:57:29*ltriant quit (Ping timeout: 246 seconds)
10:58:06*ltriant joined #nim
10:58:58PMunch_No, casting seqs like that is illegal
11:00:07PMunch_And AFAIK there is no non-hacky way to change the length of a seq without it trying to resize the data
11:00:51PMunch_You would basically have to cast it to a representation based on what a seq actually is, then fiddle with the fields yourself, and then cast it back to a sequence
11:00:58PMunch_But it's terribly hacky
11:01:01PMunch_!nick PMunch
11:01:08*PMunch_ is now known as PMunch
11:01:17PMunchWhoops, wrong command character
11:01:24FromDiscord<planetis_m> thanks PMunch
11:01:33PMunchNo problem
11:02:24PMunchOf course you could do something like `cast[ptr UncheckedArray[tuple[r,g,b,a:uint8]](myByteSeq[0].addr])[]`
11:02:34PMunchBut now you don't have a length at all
11:04:21FromDiscord<planetis_m> no thats not desired, in the end I am going to provide byte overloads
11:04:43FromDiscord<planetis_m> openArray[byte]
11:04:46PMunchOr do something like `toOpenArray(cast[ptr UncheckedArray[tuple[r,g,b,a: uint8]](myByteSeq[0].addr), 0, myByteSeq.len div 4)` for an openArray
11:08:01FromDiscord<planetis_m> shoot I haven't thought of that, it could work
11:14:41FromDiscord<mratsim> In reply to @planetis_m "shoot I haven't thought": I don't know if that will help you but to abstract accessing color channels in a byte arrays, I create a descriptor with a stride and I just do compute on that: https://github.com/mratsim/trace-of-radiance/blob/master/trace_of_radiance/io/color_conversions.nim#L68-L103
11:16:03FromDiscord<mratsim> (edit) removed "a"
11:20:11FromDiscord<spotlightkid> Use `if`/`elif`.↵(@amjadhd)
11:20:11FromDiscord<planetis_m> that looks cool but I don't have many options I just interface with C
11:20:32Amun-RaI have a function that returns some value not to trigger DSE, is there a way to forbid discard such a returned value?
11:29:51FromDiscord<planetis_m> In reply to @amjadhd "How do I fix": You have to return something from every branch, if you change to `else: ' '` it works
12:17:54FromDiscord<basilajith> I wrote my first ever library... 🙂 ↵https://bitbucket.org/pyfyclan/printo
12:21:42FromDiscord<gogolxdong666> How to convert pointer to OpenArray[byte]?
12:33:08FromDiscord<gogolxdong666> sent a code paste, see https://play.nim-lang.org/#ix=4zT9
12:33:16FromDiscord<gogolxdong666> Bus error (core dumped)
12:39:34Amun-Racast[ptr UncheckedArray[type]](…)
12:43:15FromDiscord<gogolxdong666> I've tried ptr UncheckedArray, but the proc requires openArray[byte]
12:44:00Amun-Rahmm
12:44:12Amun-Rawould cast[seq[byte]](…) work? I've never done that
12:44:48*pbsds quit (Quit: The Lounge - https://thelounge.chat)
12:44:53Amun-Racan you implement another ondata for ptr type?
12:46:51FromDiscord<gogolxdong666> https://media.discordapp.net/attachments/371759389889003532/1126494469810815037/image.png
12:47:04FromDiscord<gogolxdong666> https://media.discordapp.net/attachments/371759389889003532/1126494521992151120/image.png
12:57:17FromDiscord<gogolxdong666> sent a code paste, see https://play.nim-lang.org/#ix=4zTd
13:19:34Amun-Raah, right, good old to_open_array
13:46:56FromDiscord<4zv4l> in a client/server context, does the arrow make sense to basically say incoming and outgoing ? https://media.discordapp.net/attachments/371759389889003532/1126509587881799740/image.png
13:51:36*PMunch_ joined #nim
13:52:26*Guest86 joined #nim
13:53:42FromDiscord<luckayla> Sure, but if I'm parsing logs I'd rather a standard RECV/SEND
13:54:06FromDiscord<luckayla> Especially if those aren't ligatures
13:54:27*Guest86 quit (Client Quit)
13:54:38FromDiscord<4zv4l> they're ligatures so basically -> and <-
13:54:45FromDiscord<4zv4l> so better replace by recv and send ?
13:54:48*PMunch quit (Ping timeout: 246 seconds)
14:12:12*rockcavera joined #nim
14:14:43*PMunch_ quit (Quit: Leaving)
14:30:31FromDiscord<odexine> They’re only ligatures if you have the font
14:52:39FromDiscord<mratsim> In reply to @gogolxdong666 "How to convert pointer": `toopenArrayByte`
15:35:00NimEventerNew thread by juancarlospaco: Bisect bugs GitHub Action, see https://forum.nim-lang.org/t/10325
15:43:05*Flox[m] joined #nim
16:25:27*pbsds joined #nim
16:52:19*jmdaemon joined #nim
17:03:56FromDiscord<4zv4l> is there a `workspace` feature with nimble ?
17:04:16FromDiscord<4zv4l> like with cargo in which you could have a library and a binary at the same time ?↵for example networking lib, the client binary and server binary ?
17:04:36*jmdaemon quit (Ping timeout: 245 seconds)
17:06:33FromDiscord<demetera> Atlas is not what you've looking for?
17:12:18FromDiscord<4zv4l> Atlas ?
17:29:48FromDiscord<demetera> Yep \: https://github.com/nim-lang/atlas
17:31:49FromDiscord<demetera> It seems there're problems with matrix \> discord bridge
17:39:44*hohlerde joined #nim
17:40:49NimEventerNew thread by xigoi: How to pass a C array to a C function taking a pointer?, see https://forum.nim-lang.org/t/10326
17:40:58*Flox[m] left #nim (#nim)
17:49:07*strogon14 joined #nim
17:58:26*azimut joined #nim
17:59:57FromDiscord<exelotl> does anyone know a way to make the Nim compiler re-run the .c -> .o -> link steps without the .nim -> .c step ?
18:01:40FromDiscord<exelotl> I have a crash occurring in an auto-generated destructor on a device with no debugger, so my only option is to hack on the generated C code to figure out where the issue is occurring. But the generated C code gets overwritten every time ;_;
18:02:12FromDiscord<exelotl> (edit) "I have a crash occurring in an auto-generated destructor on a device with no debugger, so my only option is to hack on the generated C code to figure out ... whereit" added "precisely" | "the issue is occurring." => "it goes wrong."
18:07:59FromDiscord<exelotl> nevermind, I think I can quickly swap out the file mid-compilation 😈
18:14:37FromDiscord<spotlightkid> you can do `nim c --genScript:on --nimcache:nimcache foo.nim` and then edit & run the script generated in `nimcache`.
18:16:34FromDiscord<exelotl> yeah, I tried that but the script gets the compiler exe wrong and all the file paths wrong :(
18:26:04FromDiscord<spotlightkid> nothing a quick serch&replace can't fix?
18:34:25FromDiscord<juan_carlos> In reply to @exelotl "yeah, I tried that": The data is in the JSON in the cache folder.
18:43:16*jmdaemon joined #nim
18:55:27*jmdaemon quit (Ping timeout: 246 seconds)
19:00:08*jmdaemon joined #nim
19:07:21*jmdaemon quit (Ping timeout: 246 seconds)
19:09:05*jmdaemon joined #nim
19:13:31*strogon14 left #nim (Und tschüss!)
19:55:26*jmdaemon quit (Ping timeout: 245 seconds)
20:11:53FromDiscord<arathanis> how can I keep nim from popping up a terminal window on execution? I have tried `--app:gui` and when i double click the executable it still opens a prompt
20:25:21*ntat quit (Quit: Leaving)
20:48:28FromDiscord<demetera> AFAIK --app\:gui flag is valid only for NiGui. For others better check appropriate docs
20:58:53FromDiscord<arathanis> ok i will take a look
20:59:02FromDiscord<arathanis> `--app:gui` was the only thing I found while searching.
20:59:19FromDiscord<arathanis> do you know which docs are apprioriate for checking this?
20:59:24FromDiscord<arathanis> (edit) "apprioriate for checking this?" => "appropriate?"
21:03:53FromDiscord<demetera> Depends on which GUI framework you are using
21:18:29FromDiscord<arathanis> In reply to @demetera "Depends on which GUI": im not using a GUI framework, I just need it to run silently without opening a console window.
21:30:51*ovenpasta quit (Ping timeout: 245 seconds)
22:10:45FromDiscord<nasuray> In reply to @4zv4l "like with cargo in": Yes this would be a "hybrid" package. https://github.com/nim-lang/nimble#hybrids
22:30:33FromDiscord<arathanis> well the only info I can find is using `--app:gui` and that doesn't seem to work
22:45:48*sagax quit (Ping timeout: 240 seconds)
22:53:04FromDiscord<demotomohiro> In reply to @arathanis "well the only info": Programs that keep running without a window sounds like virus or malware that trying to keep running without user notice it.↵I don't know much about MS windows, but it might creates a terminal window for a security reason.
23:25:22FromDiscord<Mike> Ah yes, systemd, the scourge of the earth
23:28:43FromDiscord<Yepoleb> who mentioned systemd?
23:29:51FromDiscord<spotlightkid> No, windows distinguishes between terminal (console) and GUI apps. It's nothing security related. You need to use special linker flags to build a windows app without the console.↵(@demotomohiro)
23:32:13*jmdaemon joined #nim
23:38:30FromDiscord<mrgaturus> why is not possible check if a key exists on a CacheTable?
23:46:59FromDiscord<Elegantbeef> It is in devel