<< 21-03-2024 >>

00:07:48*SchweinDeBurg quit (Quit: WeeChat 4.3.0-dev)
00:08:12*SchweinDeBurg joined #nim
00:56:08FromDiscord<Robyn [She/Her]> I wonder why there are no HTTP/2 or 3 servers in Nim that I know of
02:10:35arkanoidhow can I find from where a symbol is imported?
02:10:52*rockcavera quit (Read error: Connection reset by peer)
02:11:13*rockcavera joined #nim
02:11:13*rockcavera quit (Changing host)
02:11:13*rockcavera joined #nim
02:11:22arkanoidI'm doing "import math except sum" but compilation fails Error: ambiguous call; both utils.sum(x: openArray[T]) and math.sum(x: openArray[T]) anyway
02:13:14FromDiscord<Elegantbeef> You cannot get much more information then that
02:15:10arkanoidfound it!
02:17:23arkanoidmost efficient way to turn a func in stdlib into a proc without double function call nor copypaste the stdlib function body?
02:17:53FromDiscord<Elegantbeef> Just call the proc and wrap it with `{.noSideEffect.}: ...`
02:19:43arkanoidthis doesn't seem to work https://play.nim-lang.org/#pasty=miDnQSPYshpD
02:19:55arkanoidI keep getting Error: 'sum' can have side effects
02:21:03FromDiscord<Elegantbeef> Generic fun
02:21:18FromDiscord<Elegantbeef> https://play.nim-lang.org/#pasty=jGFXpkLWcakE
02:22:53arkanoidI keep having same error even with your solution
02:23:59arkanoidI have to use the hammper for now: https://play.nim-lang.org/#pasty=skkZjrJRVsQY
02:28:33*lucasta joined #nim
02:29:19FromDiscord<Elegantbeef> Are you sure you're using your sum?
02:35:53arkanoidyes, if I comment the first and decomment the second code compiles. https://play.nim-lang.org/#pasty=eMqrRKsJCVTn
02:36:57FromDiscord<Elegantbeef> Well throw the body into a `{.noSideEffect.}: ...` aswell 😄
02:38:50arkanoidstill Error: 'sum' can have side effects
02:41:21FromDiscord<Elegantbeef> https://play.nim-lang.org/#pasty=HYlvDrUUVCRa
02:42:57arkanoidno idea, the cause must be somewhere due to the context of my project
02:43:15arkanoidbut copypasting the function body works
02:43:40FromDiscord<Elegantbeef> What's the full error stack?
02:46:20arkanoidhttps://play.nim-lang.org/#pasty=jZlQMRaelheY
03:02:11FromDiscord<Elegantbeef> Interesting
03:02:24FromDiscord<Elegantbeef> Seems the no side effect cast is lost somehow
03:05:56*lucasta quit (Remote host closed the connection)
03:12:38arkanoidI'm getting deep into the typeclass rabbit hole now, so it might well be possible I'm stretching some compiler stuff
03:13:27arkanoidI have other "obvious stuff" that are not working for unknown reason so far
03:15:44arkanoidlike this: the commented code doesn't work, but the uncommented does work https://play.nim-lang.org/#pasty=tCByzojKgYjw
03:31:07FromDiscord<Elegantbeef> Heh using generic type aliases is asking for trouble
03:31:18FromDiscord<Elegantbeef> The type graph is bugged and those don't work really
03:32:47arkanoiddiscovered just now
03:54:05*disso-peach quit (Quit: Leaving)
04:36:53*eery quit (Ping timeout: 240 seconds)
04:37:02*eery joined #nim
04:41:19FromDiscord<morgan> so if i have a proc which has to get passed to c code and called by it, and it takes in a ptr object as an output variable (returns bool), how should i go about setting a new instance there? do i copy data to it? `var ptr Type` and setting to the addr makes the error go away but i feel like that's changing where its pointing not what the data is at where its pointing, which i don't think is right
04:41:55FromDiscord<Elegantbeef> Just do `var Type`
04:43:16FromDiscord<morgan> the c code on the other end expects it to be a pointer it looks like
04:43:30FromDiscord<Elegantbeef> `var T` is a `ptr T`
04:43:56FromDiscord<morgan> oh ok
05:05:33FromDiscord<huantian> wait you can do that? i still very much don't know a lot about nim's c interop
05:05:53FromDiscord<Elegantbeef> I mean `var T` is binary compatible for `ptr T` but not type compatible
05:06:00FromDiscord<Elegantbeef> So you can cast it if required
05:06:10FromDiscord<huantian> i suppose that makes sense
05:53:41*rockcavera quit (Remote host closed the connection)
06:24:00*advesperacit joined #nim
06:29:24*ntat joined #nim
06:54:58FromDiscord<whisperecean> What is the most usable ssh library? I need to execute command remotely from linux to linux using ssh keys
07:08:57*PMunch joined #nim
08:52:40*xet7 quit (Remote host closed the connection)
08:54:06*xet7 joined #nim
08:59:21PMunchFuthark now has a library section! https://github.com/PMunch/futhark?tab=readme-ov-file#known-wrappers-made-with-futhark
09:07:14FromDiscord<Elegantbeef> Nice, more examples more better
09:10:52FromDiscord<Elegantbeef> Pmunch your mapm destructor makes me sad
09:11:08FromDiscord<Elegantbeef> Why no `Mapm = object of MapmInternal` 😄
09:11:56PMunchI remember there was a reason for it
09:12:04PMunchDon't remember what though..
09:12:17PMunchI originally tried to do it like that
09:12:21PMunchBut couldn't get it to work
09:14:51*ntat quit (Quit: Leaving)
09:15:34FromDiscord<Elegantbeef> Understandable
09:15:54PMunchIf it's any consolidation they make me sad as well :P
09:16:10FromDiscord<Elegantbeef> What are we consolidating?!
09:16:30FromDiscord<Elegantbeef> consolation\ 😛
09:17:36PMunchAh yes, that word :P
09:27:47*advesperacit quit (Ping timeout: 260 seconds)
10:26:36*advesperacit joined #nim
11:42:14FromDiscord<general_rishkin> sent a long message, see https://pasty.ee/ppBQDzNVVfPr
11:42:40FromDiscord<general_rishkin> (edit) "https://pasty.ee/IqGgklosKUBM" => "https://pasty.ee/oXdJRTuspIVz"
11:43:25FromDiscord<general_rishkin> (edit) "sent" => "I am having" | "long message, see https://pasty.ee/pgLMYsGYfvph" => "look at neural networks in Arraymancer. After training the model, how do I test it at a particular point. See ??? in the last line of code below:"
11:44:05FromDiscord<general_rishkin> https://media.discordapp.net/attachments/371759389889003532/1220337133219352576/image.png?ex=660e9285&is=65fc1d85&hm=5b652ec9eea9ddd1cff11030f4072cb8244718373975d431f3be5feeee3e3418&
11:48:46*PMunch_ joined #nim
11:51:54*PMunch quit (Ping timeout: 255 seconds)
11:52:11NimEventerNew thread by scippie: Issues with identifier equality and FFI, see https://forum.nim-lang.org/t/11274
12:08:55FromDiscord<bung8954> `Error: execution of an external program failed` how to debug this ? it's only msg I got.
12:09:41PMunch_Depends on your program
12:13:23FromDiscord<bung8954> https://github.com/bung87/discord_rpc_puppy/tree/win this modified discord_rpc on windows
12:15:49PMunch_Hmm
12:16:27PMunch_Try to compile first (withouth -d:release or -d:danger of course) and then run it (so NOT with nim c -r). That should hopefully give some more info
12:23:47FromDiscord<bung8954> hmm, same, even stdout and stderr are empty
12:24:02PMunch_Wait, same?
12:24:27PMunch_So still the "Error: execution of an external program failed" message? Or no message
12:24:38FromDiscord<bung8954> no message
12:24:56FromDiscord<bung8954> I run with ` .\src\discord_rpc_puppy.exe > myoutput.txt 2> output.err`
12:26:22PMunch_Do you get an error code?
12:26:35PMunch_Oh wait, I guess if you got the program failed error
12:26:44PMunch_Time for GDB or littering echo statements I guess
12:27:33FromDiscord<bung8954> it's `let (version, config, user) = d.receiveResponse(tuple[v: int, config: ServerConfig, user: User])` not work
12:30:41PMunch_Uhm
12:30:53PMunch_That doesn't look valid.. Unless it's a macro of some sort
12:35:51FromDiscord<bung8954> my bad I didn't initialize the string when read the pipe
13:26:00*ntat joined #nim
13:27:02*rockcavera joined #nim
13:31:02*redj quit (Ping timeout: 268 seconds)
13:49:35*fallback quit (Read error: Connection reset by peer)
13:53:57*fallback joined #nim
14:31:35*TC quit (Ping timeout: 260 seconds)
15:02:09*lucasta joined #nim
15:20:19*PMunch_ quit (Quit: Leaving)
15:24:23*advesperacit quit (Ping timeout: 272 seconds)
15:32:18*fallback quit (Read error: Connection reset by peer)
15:38:15*fallback joined #nim
16:05:30FromDiscord<A2> Is nimble only for pure-nim packages, or is there also some way to distribute nim code which depends on C++ FFI using nimble?
16:07:16FromDiscord<odexine> nimble is for ffi libs too
16:07:29FromDiscord<odexine> as for how, im not sure
16:12:24FromDiscord<Robyn [She/Her]> In reply to @A2 "Is nimble only for": Nimble clones git submodules so if you're distributing C++ code to be compiled with your Nim code, use a submodule in a dir or something
16:14:15FromDiscord<Robyn [She/Her]> God I really can't wait for IC support in Nim
16:14:34FromDiscord<A2> IC? integrated circuits? inline C?
16:15:07FromDiscord<user2m> is it possible to extend or create an enum that inherits from another enum?
16:15:39FromDiscord<A2> @Robyn [She/Her]\: thanks on the nimble answer btw. I think there are still a few problems for me to think about, since my external c++ dependencies need to be built using their nix or cmake system too
16:15:57FromDiscord<A2> I think overloadable enums is one of the new features in nim2↵(@user2m)
16:16:29FromDiscord<A2> oh wait that might be something entirely different actually
16:25:29FromDiscord<user2m> In reply to @A2 "I think overloadable enums": yeah I think that just to help with notation so we don't have to do things like `nnkNode` etc
16:25:59*advesperacit joined #nim
16:28:13*fallback quit (Read error: Connection reset by peer)
16:32:05*fallback joined #nim
16:34:33*lucasta quit (Remote host closed the connection)
16:48:35*advesperacit quit (Ping timeout: 256 seconds)
16:50:12FromDiscord<Phil> In reply to @A2 "IC? integrated circuits? inline": incremental compilation
16:50:40FromDiscord<Phil> Imagine not having to recompile 1000 files for a large project every time you change one line, only the one file you changed stuff in (and link all the other files together)
16:50:44FromDiscord<Phil> (edit) "together)" => "together to a binary)"
16:52:28FromDiscord<firasuke> I am surprised neither xxhash nim packages provide support for `XXH3_128bits`. So far I have checked:↵- https://github.com/IcedQuinn/icedhash↵- https://github.com/OpenSystemsLab/xxhash.nim↵- https://github.com/cheatfate/nimcrypto
16:52:44FromDiscord<firasuke> (edit) "neither" => "no" | "packages provide" => "package provides"
16:53:21FromDiscord<firasuke> (edit) "`XXH3_128bits`." => "`XXH3_128bits` (the equivalent of running `xxh128sum`)."
17:00:36*jmdaemon joined #nim
17:11:25*jmdaemon quit (Ping timeout: 255 seconds)
17:26:53FromDiscord<Robyn [She/Her]> In reply to @A2 "IC? integrated circuits? inline": Incremental compilation aha
17:27:00FromDiscord<Robyn [She/Her]> In reply to @isofruit "Imagine not having to": Ah yep
17:28:18FromDiscord<firasuke> In reply to @firasuke "I am surprised no": I know Nim uses wyhash by default which is really good, and I was wondering if one can produce a 128-width hash of a file using it.
17:30:43*jmdaemon joined #nim
17:30:55FromDiscord<Robyn [She/Her]> In reply to @A2 "<@524288464422830095>\: thanks on the": No worries! `exec` is a command available in Nimble too, by the way, so you could define a task and then make sure you run that before installation, not sure if this can be automated though which is your primary issue
17:35:47*pmp-p quit (Quit: No Ping reply in 180 seconds.)
17:37:17*pmp-p joined #nim
17:58:45FromDiscord<.bobbbob> sent a code paste, see https://play.nim-lang.org/#pasty=qcraSupYFuIQ
18:01:25FromDiscord<leorize> depends on what you need
18:01:55FromDiscord<leorize> so you need true random or high quality randomness?
18:02:03FromDiscord<leorize> s/so/do/
18:02:49FromDiscord<.bobbbob> it doesnt need to be true random, it's not for passwords or crypto
18:03:21FromDiscord<leorize> then that one should be fine
18:10:22FromDiscord<.bobbbob> another question, is returning from an if faster than creating a var and assigning to it in an if?
18:11:33FromDiscord<Robyn [She/Her]> That seems like a micro-optimising? Also Nim's `result` is an implicit variable and for this you'd need a variable to generate that random string anyway
18:12:22FromDiscord<.bobbbob> not related to that, just wondering haha
18:13:12FromDiscord<Robyn [She/Her]> Ah, well, I'd assume C compilers are smart enough either way so I wouldn't worry about it, I don't know myself though
18:13:58FromDiscord<.bobbbob> yeah I figured the same, I should check
18:15:01FromDiscord<griffith1deadly> sent a code paste, see https://play.nim-lang.org/#pasty=TpyoPmKGnfEq
18:15:06FromDiscord<Robyn [She/Her]> In reply to @.bobbbob "yeah I figured the": Go for it! ^^
18:20:51*advesperacit joined #nim
18:23:07rockcaverafirasuke nim does not implement wyhash in full in std/hashes, but only for 64-bit hashes
18:24:08rockcaveraAs far as I know, wyhash produces 64-bit hashes
18:25:31*jmdaemon quit (Ping timeout: 272 seconds)
18:33:13*jmdaemon joined #nim
18:42:39FromDiscord<solitudesf> In reply to @griffith1deadly "if you wanna microoptimising": this doesnt do what you think it does
18:43:59FromDiscord<griffith1deadly> In reply to @solitudesf "this doesnt do what": ah forgot about it
18:44:19FromDiscord<griffith1deadly> with setlen need set chars via index in for
18:46:37FromDiscord<griffith1deadly> sent a code paste, see https://play.nim-lang.org/#pasty=oXwTwVAlXoCu
18:46:51FromDiscord<griffith1deadly> (edit) "https://play.nim-lang.org/#pasty=gtWCYYatSveJ" => "https://play.nim-lang.org/#pasty=cNpfhjtltatp"
18:48:09NimEventerNew thread by mszs: Rationale for parsecsv.readRow skipping blank lines?, see https://forum.nim-lang.org/t/11276
19:00:20*pmp-p quit (Ping timeout: 268 seconds)
19:06:15*ntat quit (Quit: Leaving)
19:09:00*pmp-p joined #nim
19:13:23*pusewicz joined #nim
19:13:27*pmp-p quit (Ping timeout: 260 seconds)
19:15:34*pmp-p joined #nim
19:16:56*jmdaemon quit (Ping timeout: 260 seconds)
19:18:58*pmp-p quit (Client Quit)
19:22:28*pmp-p joined #nim
19:30:09FromDiscord<user2m> how do you do exeception handling in nim when compiling down to js?
19:30:18*pmp-p quit (Quit: No Ping reply in 180 seconds.)
19:30:34*jmdaemon joined #nim
19:32:23*pmp-p joined #nim
19:34:21*pusewicz is now known as pusewicz|away
19:34:25*pusewicz|away is now known as pusewicz
19:34:36*pusewicz is now known as pusewicz|away
19:38:42*mal`` quit (Quit: Leaving)
19:38:50*pmp-p quit (Ping timeout: 264 seconds)
19:43:14*redj_ joined #nim
19:47:26Amun-RaJS exceptions or nim ones?
19:48:35*pmp-p joined #nim
19:50:39Amun-Raa) JsError b) nothing changes
19:51:41*redj_ quit (Quit: http://quassel-irc.org - Chat comfortably. Anywhere.)
19:52:09*redj joined #nim
19:54:19*SchweinDeBurg quit (Quit: WeeChat 4.3.0-dev)
20:01:04*mal`` joined #nim
20:02:05*SchweinDeBurg joined #nim
20:29:50*jmdaemon quit (Ping timeout: 264 seconds)
20:45:34FromDiscord<griffith1deadly> Is `chronos` a more efficient implementation of `async` than `std/asyncdispatch`?
20:47:17FromDiscord<morgan> so i'm trying to parse a cstring to a float, but the parsefloat proc takes a string not a cstring, and cstring(thatvar) shows an error
20:48:02Amun-RaparseFloat $cstringvar
20:48:14FromDiscord<Robyn [She/Her]> Was gonna say that, Amun-Ra beat me to it :p
20:48:15FromDiscord<morgan> oh right i should've tried $
20:48:24Amun-Ra:)
20:48:31FromDiscord<morgan> awesome no red squiggle
20:51:05FromDiscord<Elegantbeef> It produces fewer cycles supposedly
20:51:06FromDiscord<Elegantbeef> `parseUtils.parseFloat(cast[ptr UncheckedArray[char]](myCstring).toOpenArray(0, myCstrLen), floatVal)`
20:51:07FromDiscord<Elegantbeef> Or my way if you don't want to copy
20:56:04FromDiscord<morgan> eh it shouldn't be an issue if it's not the fastest it could be, it's not something i think could be called all that often
20:56:08FromDiscord<morgan> tho maybe im wrong on that
20:58:48FromDiscord<firasuke> With 3 lines of Nim, you can basically recurse over large directories and calculate checksums of files faster than piping C/Rust applications... Nim is impressive to say the least...
20:58:55FromDiscord<firasuke> https://media.discordapp.net/attachments/371759389889003532/1220476758017708062/image.png?ex=660f148e&is=65fc9f8e&hm=79f18364de8b2eed13af0c9cff2e8321451459ae1c25822f5246881f4d453849&
20:59:11FromDiscord<firasuke> I know this is a microbenchmark, but Nim never fails to surprise me every time
20:59:19FromDiscord<firasuke> Kudos to the devs!
20:59:30FromDiscord<Robyn [She/Her]> Any comparison in Rust or C?
21:00:10FromDiscord<firasuke> In reply to @chronos.vitaqua "Any comparison in Rust": basically using `walkDirRec` and `nimcrypto`'s BLAKE3 vs `find -exec b3sum`
21:00:22FromDiscord<firasuke> (edit) "In reply to @chronos.vitaqua "Any comparison in Rust": basically using `walkDirRec` and `nimcrypto`'s BLAKE3 vs `find -exec b3sum` ... " added "(find from coreutils, and b3sum the Rust version)"
21:00:44FromDiscord<Robyn [She/Her]> Ahh alright!
21:00:53FromDiscord<firasuke> Nim's version is also using 2x to 5x less CPU
21:01:16FromDiscord<Robyn [She/Her]> Could part of that be because it relies on piping the results from find to b3sum? Idk
21:03:55FromDiscord<firasuke> Yeah most likely
21:04:05FromDiscord<firasuke> But still 3 lines of Nim lol
21:08:41FromDiscord<Robyn [She/Her]> Fair lol
21:18:07*advesperacit quit ()
21:22:05FromDiscord<nnsee> In reply to @.bobbbob "is this a smart": just remember to call randomize()
21:23:04Amun-Raunless you need very deterministic rng ;)
21:25:07FromDiscord<Elegantbeef> Well if you need it to be deterministic you sure as hell should be passing in state 😛
21:25:22Amun-Ra:)
21:29:39*dtomato quit (Quit: The Lounge - https://thelounge.chat)
21:30:13*dtomato joined #nim
21:41:00FromDiscord<firasuke> I'll take that over piping any day lol
21:46:43*dtomato quit (Quit: The Lounge - https://thelounge.chat)
21:52:16*dtomato joined #nim
22:25:57FromDiscord<.bobbbob> is string.toRunes.len the Right Way to get the length of a utf-8 string?
22:26:16FromDiscord<Robyn [She/Her]> In reply to @.bobbbob "is string.toRunes.len the Right": I believe so, yeah
22:30:33FromDiscord<Elegantbeef> No there is`runeLen`
22:31:26*fallback quit (Read error: Connection reset by peer)
22:32:12FromDiscord<Robyn [She/Her]> Oh damn
22:33:05FromDiscord<Elegantbeef> there is also `graphemeLen`
22:34:36*fallback joined #nim
22:42:16FromDiscord<nasuray> Deciding to accommodate emoji input on a command line app I wrote made me wanna scratch my eyes out.
22:43:51FromDiscord<.bobbbob> dang it already pushed to the repo
22:44:30FromDiscord<.bobbbob> btw did the unicode strip function ever get fixed or should I do a pull request with my own
23:45:35*fallback quit (Read error: Connection reset by peer)