00:07:48 | * | SchweinDeBurg quit (Quit: WeeChat 4.3.0-dev) |
00:08:12 | * | SchweinDeBurg joined #nim |
00:56:08 | FromDiscord | <Robyn [She/Her]> I wonder why there are no HTTP/2 or 3 servers in Nim that I know of |
02:10:35 | arkanoid | how 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:22 | arkanoid | I'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:14 | FromDiscord | <Elegantbeef> You cannot get much more information then that |
02:15:10 | arkanoid | found it! |
02:17:23 | arkanoid | most efficient way to turn a func in stdlib into a proc without double function call nor copypaste the stdlib function body? |
02:17:53 | FromDiscord | <Elegantbeef> Just call the proc and wrap it with `{.noSideEffect.}: ...` |
02:19:43 | arkanoid | this doesn't seem to work https://play.nim-lang.org/#pasty=miDnQSPYshpD |
02:19:55 | arkanoid | I keep getting Error: 'sum' can have side effects |
02:21:03 | FromDiscord | <Elegantbeef> Generic fun |
02:21:18 | FromDiscord | <Elegantbeef> https://play.nim-lang.org/#pasty=jGFXpkLWcakE |
02:22:53 | arkanoid | I keep having same error even with your solution |
02:23:59 | arkanoid | I have to use the hammper for now: https://play.nim-lang.org/#pasty=skkZjrJRVsQY |
02:28:33 | * | lucasta joined #nim |
02:29:19 | FromDiscord | <Elegantbeef> Are you sure you're using your sum? |
02:35:53 | arkanoid | yes, if I comment the first and decomment the second code compiles. https://play.nim-lang.org/#pasty=eMqrRKsJCVTn |
02:36:57 | FromDiscord | <Elegantbeef> Well throw the body into a `{.noSideEffect.}: ...` aswell 😄 |
02:38:50 | arkanoid | still Error: 'sum' can have side effects |
02:41:21 | FromDiscord | <Elegantbeef> https://play.nim-lang.org/#pasty=HYlvDrUUVCRa |
02:42:57 | arkanoid | no idea, the cause must be somewhere due to the context of my project |
02:43:15 | arkanoid | but copypasting the function body works |
02:43:40 | FromDiscord | <Elegantbeef> What's the full error stack? |
02:46:20 | arkanoid | https://play.nim-lang.org/#pasty=jZlQMRaelheY |
03:02:11 | FromDiscord | <Elegantbeef> Interesting |
03:02:24 | FromDiscord | <Elegantbeef> Seems the no side effect cast is lost somehow |
03:05:56 | * | lucasta quit (Remote host closed the connection) |
03:12:38 | arkanoid | I'm getting deep into the typeclass rabbit hole now, so it might well be possible I'm stretching some compiler stuff |
03:13:27 | arkanoid | I have other "obvious stuff" that are not working for unknown reason so far |
03:15:44 | arkanoid | like this: the commented code doesn't work, but the uncommented does work https://play.nim-lang.org/#pasty=tCByzojKgYjw |
03:31:07 | FromDiscord | <Elegantbeef> Heh using generic type aliases is asking for trouble |
03:31:18 | FromDiscord | <Elegantbeef> The type graph is bugged and those don't work really |
03:32:47 | arkanoid | discovered 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:19 | FromDiscord | <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:55 | FromDiscord | <Elegantbeef> Just do `var Type` |
04:43:16 | FromDiscord | <morgan> the c code on the other end expects it to be a pointer it looks like |
04:43:30 | FromDiscord | <Elegantbeef> `var T` is a `ptr T` |
04:43:56 | FromDiscord | <morgan> oh ok |
05:05:33 | FromDiscord | <huantian> wait you can do that? i still very much don't know a lot about nim's c interop |
05:05:53 | FromDiscord | <Elegantbeef> I mean `var T` is binary compatible for `ptr T` but not type compatible |
05:06:00 | FromDiscord | <Elegantbeef> So you can cast it if required |
05:06:10 | FromDiscord | <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:58 | FromDiscord | <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:21 | PMunch | Futhark now has a library section! https://github.com/PMunch/futhark?tab=readme-ov-file#known-wrappers-made-with-futhark |
09:07:14 | FromDiscord | <Elegantbeef> Nice, more examples more better |
09:10:52 | FromDiscord | <Elegantbeef> Pmunch your mapm destructor makes me sad |
09:11:08 | FromDiscord | <Elegantbeef> Why no `Mapm = object of MapmInternal` 😄 |
09:11:56 | PMunch | I remember there was a reason for it |
09:12:04 | PMunch | Don't remember what though.. |
09:12:17 | PMunch | I originally tried to do it like that |
09:12:21 | PMunch | But couldn't get it to work |
09:14:51 | * | ntat quit (Quit: Leaving) |
09:15:34 | FromDiscord | <Elegantbeef> Understandable |
09:15:54 | PMunch | If it's any consolidation they make me sad as well :P |
09:16:10 | FromDiscord | <Elegantbeef> What are we consolidating?! |
09:16:30 | FromDiscord | <Elegantbeef> consolation\ 😛 |
09:17:36 | PMunch | Ah yes, that word :P |
09:27:47 | * | advesperacit quit (Ping timeout: 260 seconds) |
10:26:36 | * | advesperacit joined #nim |
11:42:14 | FromDiscord | <general_rishkin> sent a long message, see https://pasty.ee/ppBQDzNVVfPr |
11:42:40 | FromDiscord | <general_rishkin> (edit) "https://pasty.ee/IqGgklosKUBM" => "https://pasty.ee/oXdJRTuspIVz" |
11:43:25 | FromDiscord | <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:05 | FromDiscord | <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:11 | NimEventer | New thread by scippie: Issues with identifier equality and FFI, see https://forum.nim-lang.org/t/11274 |
12:08:55 | FromDiscord | <bung8954> `Error: execution of an external program failed` how to debug this ? it's only msg I got. |
12:09:41 | PMunch_ | Depends on your program |
12:13:23 | FromDiscord | <bung8954> https://github.com/bung87/discord_rpc_puppy/tree/win this modified discord_rpc on windows |
12:15:49 | PMunch_ | Hmm |
12:16:27 | PMunch_ | 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:47 | FromDiscord | <bung8954> hmm, same, even stdout and stderr are empty |
12:24:02 | PMunch_ | Wait, same? |
12:24:27 | PMunch_ | So still the "Error: execution of an external program failed" message? Or no message |
12:24:38 | FromDiscord | <bung8954> no message |
12:24:56 | FromDiscord | <bung8954> I run with ` .\src\discord_rpc_puppy.exe > myoutput.txt 2> output.err` |
12:26:22 | PMunch_ | Do you get an error code? |
12:26:35 | PMunch_ | Oh wait, I guess if you got the program failed error |
12:26:44 | PMunch_ | Time for GDB or littering echo statements I guess |
12:27:33 | FromDiscord | <bung8954> it's `let (version, config, user) = d.receiveResponse(tuple[v: int, config: ServerConfig, user: User])` not work |
12:30:41 | PMunch_ | Uhm |
12:30:53 | PMunch_ | That doesn't look valid.. Unless it's a macro of some sort |
12:35:51 | FromDiscord | <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:30 | FromDiscord | <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:16 | FromDiscord | <odexine> nimble is for ffi libs too |
16:07:29 | FromDiscord | <odexine> as for how, im not sure |
16:12:24 | FromDiscord | <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:15 | FromDiscord | <Robyn [She/Her]> God I really can't wait for IC support in Nim |
16:14:34 | FromDiscord | <A2> IC? integrated circuits? inline C? |
16:15:07 | FromDiscord | <user2m> is it possible to extend or create an enum that inherits from another enum? |
16:15:39 | FromDiscord | <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:57 | FromDiscord | <A2> I think overloadable enums is one of the new features in nim2↵(@user2m) |
16:16:29 | FromDiscord | <A2> oh wait that might be something entirely different actually |
16:25:29 | FromDiscord | <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:12 | FromDiscord | <Phil> In reply to @A2 "IC? integrated circuits? inline": incremental compilation |
16:50:40 | FromDiscord | <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:44 | FromDiscord | <Phil> (edit) "together)" => "together to a binary)" |
16:52:28 | FromDiscord | <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:44 | FromDiscord | <firasuke> (edit) "neither" => "no" | "packages provide" => "package provides" |
16:53:21 | FromDiscord | <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:53 | FromDiscord | <Robyn [She/Her]> In reply to @A2 "IC? integrated circuits? inline": Incremental compilation aha |
17:27:00 | FromDiscord | <Robyn [She/Her]> In reply to @isofruit "Imagine not having to": Ah yep |
17:28:18 | FromDiscord | <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:55 | FromDiscord | <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:45 | FromDiscord | <.bobbbob> sent a code paste, see https://play.nim-lang.org/#pasty=qcraSupYFuIQ |
18:01:25 | FromDiscord | <leorize> depends on what you need |
18:01:55 | FromDiscord | <leorize> so you need true random or high quality randomness? |
18:02:03 | FromDiscord | <leorize> s/so/do/ |
18:02:49 | FromDiscord | <.bobbbob> it doesnt need to be true random, it's not for passwords or crypto |
18:03:21 | FromDiscord | <leorize> then that one should be fine |
18:10:22 | FromDiscord | <.bobbbob> another question, is returning from an if faster than creating a var and assigning to it in an if? |
18:11:33 | FromDiscord | <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:22 | FromDiscord | <.bobbbob> not related to that, just wondering haha |
18:13:12 | FromDiscord | <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:58 | FromDiscord | <.bobbbob> yeah I figured the same, I should check |
18:15:01 | FromDiscord | <griffith1deadly> sent a code paste, see https://play.nim-lang.org/#pasty=TpyoPmKGnfEq |
18:15:06 | FromDiscord | <Robyn [She/Her]> In reply to @.bobbbob "yeah I figured the": Go for it! ^^ |
18:20:51 | * | advesperacit joined #nim |
18:23:07 | rockcavera | firasuke nim does not implement wyhash in full in std/hashes, but only for 64-bit hashes |
18:24:08 | rockcavera | As 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:39 | FromDiscord | <solitudesf> In reply to @griffith1deadly "if you wanna microoptimising": this doesnt do what you think it does |
18:43:59 | FromDiscord | <griffith1deadly> In reply to @solitudesf "this doesnt do what": ah forgot about it |
18:44:19 | FromDiscord | <griffith1deadly> with setlen need set chars via index in for |
18:46:37 | FromDiscord | <griffith1deadly> sent a code paste, see https://play.nim-lang.org/#pasty=oXwTwVAlXoCu |
18:46:51 | FromDiscord | <griffith1deadly> (edit) "https://play.nim-lang.org/#pasty=gtWCYYatSveJ" => "https://play.nim-lang.org/#pasty=cNpfhjtltatp" |
18:48:09 | NimEventer | New 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:09 | FromDiscord | <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:26 | Amun-Ra | JS exceptions or nim ones? |
19:48:35 | * | pmp-p joined #nim |
19:50:39 | Amun-Ra | a) 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:34 | FromDiscord | <griffith1deadly> Is `chronos` a more efficient implementation of `async` than `std/asyncdispatch`? |
20:47:17 | FromDiscord | <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:02 | Amun-Ra | parseFloat $cstringvar |
20:48:14 | FromDiscord | <Robyn [She/Her]> Was gonna say that, Amun-Ra beat me to it :p |
20:48:15 | FromDiscord | <morgan> oh right i should've tried $ |
20:48:24 | Amun-Ra | :) |
20:48:31 | FromDiscord | <morgan> awesome no red squiggle |
20:51:05 | FromDiscord | <Elegantbeef> It produces fewer cycles supposedly |
20:51:06 | FromDiscord | <Elegantbeef> `parseUtils.parseFloat(cast[ptr UncheckedArray[char]](myCstring).toOpenArray(0, myCstrLen), floatVal)` |
20:51:07 | FromDiscord | <Elegantbeef> Or my way if you don't want to copy |
20:56:04 | FromDiscord | <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:08 | FromDiscord | <morgan> tho maybe im wrong on that |
20:58:48 | FromDiscord | <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:55 | FromDiscord | <firasuke> https://media.discordapp.net/attachments/371759389889003532/1220476758017708062/image.png?ex=660f148e&is=65fc9f8e&hm=79f18364de8b2eed13af0c9cff2e8321451459ae1c25822f5246881f4d453849& |
20:59:11 | FromDiscord | <firasuke> I know this is a microbenchmark, but Nim never fails to surprise me every time |
20:59:19 | FromDiscord | <firasuke> Kudos to the devs! |
20:59:30 | FromDiscord | <Robyn [She/Her]> Any comparison in Rust or C? |
21:00:10 | FromDiscord | <firasuke> In reply to @chronos.vitaqua "Any comparison in Rust": basically using `walkDirRec` and `nimcrypto`'s BLAKE3 vs `find -exec b3sum` |
21:00:22 | FromDiscord | <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:44 | FromDiscord | <Robyn [She/Her]> Ahh alright! |
21:00:53 | FromDiscord | <firasuke> Nim's version is also using 2x to 5x less CPU |
21:01:16 | FromDiscord | <Robyn [She/Her]> Could part of that be because it relies on piping the results from find to b3sum? Idk |
21:03:55 | FromDiscord | <firasuke> Yeah most likely |
21:04:05 | FromDiscord | <firasuke> But still 3 lines of Nim lol |
21:08:41 | FromDiscord | <Robyn [She/Her]> Fair lol |
21:18:07 | * | advesperacit quit () |
21:22:05 | FromDiscord | <nnsee> In reply to @.bobbbob "is this a smart": just remember to call randomize() |
21:23:04 | Amun-Ra | unless you need very deterministic rng ;) |
21:25:07 | FromDiscord | <Elegantbeef> Well if you need it to be deterministic you sure as hell should be passing in state 😛 |
21:25:22 | Amun-Ra | :) |
21:29:39 | * | dtomato quit (Quit: The Lounge - https://thelounge.chat) |
21:30:13 | * | dtomato joined #nim |
21:41:00 | FromDiscord | <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:57 | FromDiscord | <.bobbbob> is string.toRunes.len the Right Way to get the length of a utf-8 string? |
22:26:16 | FromDiscord | <Robyn [She/Her]> In reply to @.bobbbob "is string.toRunes.len the Right": I believe so, yeah |
22:30:33 | FromDiscord | <Elegantbeef> No there is`runeLen` |
22:31:26 | * | fallback quit (Read error: Connection reset by peer) |
22:32:12 | FromDiscord | <Robyn [She/Her]> Oh damn |
22:33:05 | FromDiscord | <Elegantbeef> there is also `graphemeLen` |
22:34:36 | * | fallback joined #nim |
22:42:16 | FromDiscord | <nasuray> Deciding to accommodate emoji input on a command line app I wrote made me wanna scratch my eyes out. |
22:43:51 | FromDiscord | <.bobbbob> dang it already pushed to the repo |
22:44:30 | FromDiscord | <.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) |