00:07:38 | madprops | made this little function. might be useful https://gist.github.com/madprops/9ed21ff1ca83e87878f63b404e6a13f2 |
00:12:13 | FromDiscord | <Elegantbeef> for showcasing logic mad easier to use asserts `assert multistring("day", -1, "is") == "-1 days are"` |
00:13:30 | madprops | you're right |
00:14:11 | arkanoid | do you know if its possible to do multiple preprocessing passes with nimterop? |
00:14:40 | FromDiscord | <Elegantbeef> I know nothing of nimterop, so nope 😀 |
00:20:15 | arkanoid | k |
00:55:40 | * | arkurious quit (Quit: Leaving) |
01:10:45 | FromDiscord | <proud linux user> In reply to @konsumlamm "it's called modules": :| |
01:18:32 | * | vicfred quit (Quit: Leaving) |
01:31:29 | FromDiscord | <deech> If I have an `Option[void]` how do I instantiate `some(...)`? I tried `some[void]()` and that failed. |
01:35:18 | FromDiscord | <Yardanico> In reply to @deech "If I have an": I don't think you can, why do you need that? |
01:39:53 | FromDiscord | <deech> Considering and API where a successful action yields a `some(void)` and unsuccessful one is `none()`. In functional langs it's a nice way of chaining a bunch of actions with short circuiting if one failes. |
01:40:14 | FromDiscord | <deech> (edit) "and" => "an" | "failes." => "fails." |
01:40:31 | FromDiscord | <Yardanico> In reply to @deech "Considering an API where": what about using a plain old boolean? :P |
01:40:35 | FromDiscord | <Yardanico> since you don't need any value anyway |
01:40:39 | FromDiscord | <Yardanico> just return true or false |
01:41:25 | FromDiscord | <deech> Yeah I know. 🙂 I just wanted to flatmap things together. |
01:41:41 | FromDiscord | <deech> It's a fairly common idiom in FP but no big deal. |
01:42:04 | FromDiscord | <Yardanico> well there might be some other way to do it, since there are some FP libs out there |
01:42:39 | FromDiscord | <Yardanico> i mean some alternatives to the options module |
01:45:07 | FromDiscord | <deech> I should probably just use Status' `results` library. 🙂 |
02:40:05 | * | rockcavera joined #nim |
02:40:05 | * | rockcavera quit (Changing host) |
02:40:05 | * | rockcavera joined #nim |
02:57:57 | madprops | what could be a good way to have a default array argument like... |
02:57:58 | madprops | afterwords: array[2, string] = ["a", "a"] |
02:58:07 | madprops | i want to check if it's not the default value, and do something |
02:58:22 | madprops | but checking if [0] == "a" seems dumb |
02:58:46 | madprops | can't simply do [] since it expects two items |
03:03:25 | madprops | also is there an argument type that is fixed but accepts array and seq ? |
03:03:36 | madprops | openarray can be any size, but i need it fixed |
03:07:06 | FromDiscord | <Rika> Use sequtils map prolly , not sure if there’s an open array version |
03:41:01 | NimEventer | New thread by Kalbhairab: Convert func to property box, see https://forum.nim-lang.org/t/8329 |
03:48:36 | FromDiscord | <Rika> I don’t know what he means |
03:48:46 | FromDiscord | <Elegantbeef> me either |
03:51:01 | FromDiscord | <InventorMatt> I believe he is saying that he wants a GUI that can generate code for a GUI to make it easier to build |
03:56:06 | FromDiscord | <Yardanico> yeah |
03:56:19 | FromDiscord | <Yardanico> He wants something like Delphi if I understand correctly |
04:05:57 | FromDiscord | <JSONBash> does anyone know of a macro that allows array/sequence unpacking? |
04:06:02 | * | supakeen quit (Quit: WeeChat 3.2) |
04:06:30 | * | supakeen joined #nim |
04:07:12 | FromDiscord | <Elegantbeef> https://github.com/technicallyagd/unpack |
04:09:25 | FromDiscord | <JSONBash> In reply to @Elegantbeef "https://github.com/technicallyagd/unpack": cheers |
04:40:08 | * | rockcavera quit (Remote host closed the connection) |
04:42:27 | * | Onionhammer joined #nim |
04:42:38 | * | flynn quit (*.net *.split) |
04:42:38 | * | nixfreak_nim[m] quit (*.net *.split) |
04:42:38 | * | mjsir911 quit (*.net *.split) |
04:42:38 | * | icebattle quit (*.net *.split) |
04:42:38 | * | Amun-Ra quit (*.net *.split) |
04:43:13 | * | flynn joined #nim |
04:43:13 | * | nixfreak_nim[m] joined #nim |
04:43:13 | * | mjsir911 joined #nim |
04:43:13 | * | icebattle joined #nim |
04:43:13 | * | Amun-Ra joined #nim |
04:44:54 | * | beshr quit (*.net *.split) |
04:44:54 | * | LyndsySimon quit (*.net *.split) |
04:44:54 | * | Jjp137 quit (*.net *.split) |
04:44:54 | * | jfrent quit (*.net *.split) |
04:45:22 | * | beshr joined #nim |
04:45:22 | * | LyndsySimon joined #nim |
04:45:22 | * | Jjp137 joined #nim |
04:45:22 | * | jfrent joined #nim |
04:47:18 | * | Helios quit (Ping timeout: 272 seconds) |
04:47:52 | * | flynn quit (Ping timeout: 272 seconds) |
04:48:03 | * | Yardanico quit (*.net *.split) |
04:48:04 | * | Ekho quit (*.net *.split) |
04:48:04 | * | greyrat quit (*.net *.split) |
04:48:04 | * | robertmeta quit (*.net *.split) |
04:48:04 | * | oz quit (*.net *.split) |
04:48:43 | * | Yardanico joined #nim |
04:48:43 | * | Ekho joined #nim |
04:48:43 | * | greyrat joined #nim |
04:48:43 | * | robertmeta joined #nim |
04:48:43 | * | oz joined #nim |
04:50:20 | * | Lord_Nightmare quit (*.net *.split) |
04:50:20 | * | blackbeard420 quit (*.net *.split) |
04:50:20 | * | ecs quit (*.net *.split) |
04:50:20 | * | lucerne quit (*.net *.split) |
04:50:20 | * | jkl quit (*.net *.split) |
04:50:24 | * | nixfreak_nim[m] quit (Ping timeout: 272 seconds) |
04:50:45 | * | Lord_Nightmare joined #nim |
04:50:45 | * | blackbeard420 joined #nim |
04:50:45 | * | ecs joined #nim |
04:50:45 | * | lucerne joined #nim |
04:50:45 | * | jkl joined #nim |
04:50:56 | * | happycorsair[m] quit (Ping timeout: 268 seconds) |
04:52:42 | * | asd quit (*.net *.split) |
04:52:55 | * | asd joined #nim |
04:54:20 | * | NimBot joined #nim |
04:54:31 | * | mikko joined #nim |
04:54:42 | * | nisstyre joined #nim |
04:55:26 | * | flynn joined #nim |
04:55:31 | FromDiscord | <proud linux user> ohyes goog module |
05:06:09 | * | Onionhammer quit (Ping timeout: 248 seconds) |
06:18:06 | * | Helios joined #nim |
06:55:11 | * | nixfreak_nim[m] joined #nim |
06:55:24 | * | PMunch joined #nim |
07:18:16 | * | happycorsair[m] joined #nim |
07:37:04 | FromDiscord | <enthus1ast> He wants to render a gui element that shows all the properties (variables) of a object and also all the procs/methods like in Delphi or VisualStudio I think it's called property editor↵(@Rika) |
07:39:18 | FromDiscord | <Rika> Can’t GDB do that |
07:39:45 | FromDiscord | <Yardanico> uh no |
07:40:12 | FromDiscord | <Yardanico> as I understand he wants an ui editor which'll allow to create handlers for button events easily |
07:40:16 | FromDiscord | <Yardanico> "button have many properties like color, on_click, onHover, etc. autocomplete gives us what we need but if we can make gui which gives all button properties and we only need to provide value and it gives us code then it will be fast." |
07:40:46 | FromDiscord | <Rika> I’m still confused lol |
07:40:47 | FromDiscord | <Elegantbeef> It's very unclear what they want so maybe in time they'll elaborate and explain |
07:42:02 | FromDiscord | <Yardanico> https://media.discordapp.net/attachments/371759389889003532/876732519360389130/unknown.png |
07:50:16 | * | max22- joined #nim |
08:13:16 | * | xet7 quit (Remote host closed the connection) |
08:13:16 | FromDiscord | <Chiggy> In reply to @enthus1ast "He wants to render": Hey enthus1ast! are you there? |
08:13:35 | FromDiscord | <enthus1ast> yep but working |
08:13:59 | FromDiscord | <Chiggy> oh ok |
08:14:15 | FromDiscord | <Chiggy> can you let me know when you'll be free |
08:14:24 | FromDiscord | <enthus1ast> sure |
08:14:37 | FromDiscord | <Chiggy> please do ping me. Thanks |
08:29:51 | * | xet7 joined #nim |
08:32:08 | NimEventer | New thread by Wani: Ubuntu Noobish Questions, see https://forum.nim-lang.org/t/8330 |
08:43:46 | * | Vladar joined #nim |
09:11:26 | * | PMunch quit (Remote host closed the connection) |
09:12:20 | * | PMunch joined #nim |
09:12:59 | * | PMunch quit (Remote host closed the connection) |
09:14:05 | * | PMunch joined #nim |
10:32:35 | FromDiscord | <Stuffe> Does anyone know how to get the time as an int out of a Time object? I am trying to use getLastAccessTime for a file, it returns a Time, but when I try to access the "seconds" field it gives me an error |
10:33:48 | PMunch | What error? |
10:34:00 | PMunch | And I assume you want a UNIX timestamp? |
10:34:34 | FromDiscord | <Stuffe> yeah |
10:34:34 | FromDiscord | <PsychoClay> toUnix() ? |
10:34:41 | PMunch | toUnix is probably what you want |
10:34:54 | FromDiscord | <Stuffe> it thinks I want to access a method called "seconds", which doesn't take a Time type as argument |
10:35:30 | FromDiscord | <Stuffe> toUnix() works! thanks |
10:37:42 | PMunch | seconds takes an integer and converts it to a TimeInterval that can be added to a Time object |
10:38:10 | PMunch | It's so you can do things like `myTime + 10.seconds` |
10:39:23 | FromDiscord | <Stuffe> yeah but it is also listed as a field on the Time object |
10:39:43 | FromDiscord | <Stuffe> I feel like that should take precedence. But maybe it is a private field |
10:39:57 | FromDiscord | <Stuffe> In which case there is probably no reason to show it in the docs |
10:41:09 | FromDiscord | <Rika> In reply to @Stuffe "yeah but it is": It is likely a private field |
10:41:40 | FromDiscord | <Rika> Maybe it should be more obvious that it is private |
10:42:00 | FromDiscord | <Rika> I think it’s fine to show it in the docs just make it more obvious that it is private |
10:43:20 | PMunch | @Stuffe, it's private because it's not annotated with a * |
10:43:38 | PMunch | It's a but odd that it even appears in the docs *shrugs* |
10:46:52 | FromDiscord | <Rika> Yes but that is not obvious to beginners or people skimming |
10:52:19 | FromDiscord | <PsychoClay> is it a bad idea to spawn 400 threads? |
10:54:03 | FromDiscord | <Rika> At once? Maybe |
10:54:04 | PMunch | Yup |
10:54:16 | PMunch | Unless you have 400 cores |
10:54:17 | FromDiscord | <Rika> Maybe just use a thread pool |
10:54:31 | FromDiscord | <Rika> In reply to @PMunch "Unless you have 400": For all you know he might be programming for a super computer |
10:55:04 | PMunch | I mean it's not going to crash or anything, but it could easily end up being slower than a single thread |
10:55:09 | FromDiscord | <PsychoClay> 400 = 20 secs, 1gb ram↵200 = 35 secs, 500mb↵100 = 50 secs, 250mb |
10:55:15 | FromDiscord | <PsychoClay> it seems a bit faster |
10:55:38 | FromDiscord | <PsychoClay> but the ram usage is pretty high |
10:55:46 | PMunch | Hmm, that actually surprises me quite a bit |
10:56:00 | PMunch | Do you by any chance lock your threads up with IO? |
10:56:21 | FromDiscord | <PsychoClay> yea it does a bunch of http requests |
10:56:26 | PMunch | @Rika, exactly, you never know :P |
10:56:47 | PMunch | Try doing it with asynchttpclient instead |
10:56:51 | FromDiscord | <PsychoClay> i know async is supposed to be better for io things |
10:56:58 | FromDiscord | <PsychoClay> but i couldnt get i to work |
10:57:00 | FromDiscord | <Rika> In reply to @PMunch "Try doing it with": I would assume that would still be slower |
10:57:06 | FromDiscord | <Rika> In reply to @PsychoClay "but i couldnt get": How? |
10:57:11 | FromDiscord | <Rika> What issues were you hitting |
10:57:21 | FromDiscord | <PsychoClay> i think its because i used waitfor |
10:57:36 | FromDiscord | <PsychoClay> but it seemed like only 1 worker was doing anything |
10:57:59 | FromDiscord | <Rika> That sounds like your issue alright |
10:58:08 | FromDiscord | <Rika> It’s a bit harder to think in async |
10:58:18 | FromDiscord | <PsychoClay> yep |
10:58:23 | FromDiscord | <Rika> Because there’s a lot of stuff being hidden from you |
10:58:55 | FromDiscord | <PsychoClay> maybe if i use 10 or so threads with async in them |
10:59:16 | FromDiscord | <Rika> Like how you don’t need to await an async proc for it to be queued in the loop (you just need to yield control back to the loop) |
10:59:38 | FromDiscord | <Rika> I know that sounds obvious to other people here |
11:02:22 | PMunch | PsychoClay, yup waitFor will stop the thread waiting for the async procedure to complete |
11:02:36 | PMunch | So that's essentially the same as not running async |
11:02:40 | FromDiscord | <PsychoClay> so i should await instead right? |
11:02:44 | PMunch | Yup |
11:04:16 | PMunch | You could run async in multiple threads, but it's probably not going to do anything extra for you. If you need to do some processing you could have one thread that does all the async stuff and puts the results in a channel that multiple consumer threads reads from and performs the calculations |
11:06:35 | FromDiscord | <PsychoClay> sent a code paste, see https://play.nim-lang.org/#ix=3waf |
11:07:35 | FromDiscord | <PsychoClay> (edit) "https://play.nim-lang.org/#ix=3waf" => "https://play.nim-lang.org/#ix=3wag" |
11:09:46 | FromDiscord | <Rika> Needs to be in a proc with pragma async |
11:10:03 | FromDiscord | <PsychoClay> oh ok |
11:10:14 | FromDiscord | <Rika> If that’s outside of a proc make a main proc with async then do wait for on the main proc |
11:12:54 | FromDiscord | <PsychoClay> hmm it still appears to be running one at the time |
11:14:14 | FromDiscord | <PsychoClay> maybe because im using curl instead of std/httpclient |
11:15:03 | FromDiscord | <proud linux user> oof |
11:15:49 | PMunch | Wait what? You're just awaiting a procedure that does a blocking call to curl? |
11:15:54 | PMunch | Yeah that won't work |
11:16:11 | FromDiscord | <PsychoClay> guess its back to threads then lol |
11:16:27 | PMunch | Just use asynchttpclient instead of curl.. |
11:16:45 | FromDiscord | <PsychoClay> it has no configuarbility |
11:16:53 | FromDiscord | <PsychoClay> not enough atleast |
11:17:08 | PMunch | What do you want to configure? |
11:17:33 | PMunch | You should be able to configure pretty much anything you could need with it.. |
11:17:58 | FromDiscord | <PsychoClay> cant write to file |
11:18:34 | FromDiscord | <PsychoClay> how do i download a 10 gb file with asynchttpclient? |
11:19:15 | FromDiscord | <PsychoClay> oh wait theres a downloadFile proc |
11:19:55 | PMunch | Mhm |
11:20:11 | FromDiscord | <PsychoClay> can it do chunked downloads tho? |
11:20:31 | PMunch | Define chunked |
11:21:18 | FromDiscord | <PsychoClay> multiple connections download different parts of a file with the range header |
11:22:32 | FromDiscord | <Rika> You just do exactly that… |
11:22:36 | PMunch | Would that even speed up the download? |
11:22:53 | FromDiscord | <PsychoClay> yea it bypassed speedlimits on some file hosting sites |
11:23:01 | FromDiscord | <PsychoClay> (edit) "bypassed" => "bypassew" |
11:23:06 | FromDiscord | <PsychoClay> (edit) "bypassew" => "bypasses" |
11:23:16 | PMunch | Ah right |
11:23:39 | FromDiscord | <PsychoClay> In reply to @Rika "You just do exactly": how do u do that with httpclient ? |
11:23:41 | FromDiscord | <Rika> I could have written some pseudo code if I were home |
11:24:06 | FromDiscord | <Rika> The range thing is just a header so you just make many clients then send the get request with the differing headers |
11:24:22 | FromDiscord | <Rika> Though the writing to a file part is a bit more complicated |
11:24:40 | FromDiscord | <Rika> In reply to @Rika "The range thing is": Requests |
11:24:51 | FromDiscord | <PsychoClay> but doesnt downloadFile just start at the start of the file or something |
11:25:13 | FromDiscord | <PsychoClay> so it would just be overwriting itself all the time |
11:25:25 | PMunch | Yeah, easiest would probably be to download to a bunch of small files and then stitch them together afterwards |
11:25:35 | FromDiscord | <PsychoClay> isnt that slow? |
11:26:01 | PMunch | Might be.. |
11:26:11 | FromDiscord | <PsychoClay> i guess i could just get it as a string with `get` and then put it in the file |
11:26:26 | FromDiscord | <PsychoClay> but that might also be slow |
11:26:39 | FromDiscord | <Yardanico> that'll take huge amounts of RAM since you'll have to store the file in memory before writing |
11:26:40 | PMunch | What do you think curl is doing? |
11:27:00 | FromDiscord | <PsychoClay> well curl seems to only take a few bytes at the time |
11:27:13 | FromDiscord | <PsychoClay> wich i can then directily write to the correct place in the file |
11:27:50 | FromDiscord | <PsychoClay> it seems like that would be the fastest way |
11:28:12 | PMunch | What you do is queue up a bunch of `get` with asynchttpclient, then you throw on a callback that writes it to the file with an async file writer |
11:28:56 | FromDiscord | <PsychoClay> il try that, see if its faster |
11:29:25 | FromDiscord | <Rika> Since this is asynchronous you don’t need to worry about fucking up a write so it should be fine to open the file, seek, write, then close |
11:29:29 | FromDiscord | <Rika> Then yield back to the loop |
11:30:22 | PMunch | Why open and close every step? |
11:32:59 | PMunch | First run a HEAD request to the file, that should give you the size. Then create an async file and run setFileSize on it with that size. Then chunk that length into parts, request them all with async, and in a callback seek the file and write into that position. |
11:34:10 | FromDiscord | <PsychoClay> yea i already did it with curl so i should be able to just translate it |
11:35:42 | FromDiscord | <PsychoClay> does httpclient support socks proxies? |
11:37:30 | FromDiscord | <Rika> In reply to @PMunch "Why open and close": I am unsure if it is safe for open to open the same file multiple times |
11:37:51 | FromDiscord | <PsychoClay> In reply to @Rika "I am unsure if": it worked for me |
11:38:10 | FromDiscord | <Rika> Then good |
11:38:31 | FromDiscord | <PsychoClay> dunno about safe but it didnt get corrupted or anything |
11:38:35 | PMunch | @Rika, why would you open it multiple times? |
11:39:06 | FromDiscord | <Rika> Because I was thinking of writing while receiving data and since this is concurrent reception of data then you need to open the same file many times |
11:39:42 | FromDiscord | <Rika> Unless you want to do the many files then combine after finish |
11:39:45 | PMunch | Uhm, no? |
11:39:51 | FromDiscord | <Rika> Which I would say would probably be more robust |
11:39:55 | FromDiscord | <Rika> Explain |
11:40:13 | FromDiscord | <PsychoClay> u can just use setFilePos right to move around |
11:40:19 | FromDiscord | <Rika> Indeed |
11:40:39 | FromDiscord | <PsychoClay> open once and then just move to where u need to be? |
11:41:00 | FromDiscord | <Rika> And then pass that to each iterative |
11:41:04 | FromDiscord | <Rika> Iterator |
11:41:07 | FromDiscord | <Rika> Okay |
11:41:12 | FromDiscord | <xflywind> bug existed with opening file multiple times without closing https://github.com/nim-lang/Nim/issues/13940 |
11:52:09 | FromDiscord | <Yardanico> In reply to @Rika "Because I was thinking": that won't happen |
11:52:18 | FromDiscord | <Yardanico> two async callbacks can't happen at exactly the same time |
11:52:23 | FromDiscord | <Yardanico> concurrency is not parallelism |
11:52:58 | FromDiscord | <Yardanico> since even if you do a lot of async stuff you're still essentially running a single thread |
11:53:11 | FromDiscord | <Yardanico> that said, async is actually not bad for network tasks (obviously) |
11:53:26 | FromDiscord | <Yardanico> i have a quite fast prnt.sc scraper in simple async code, also https://github.com/Yardanico/adbscan/ |
11:56:12 | arkanoid | nimterop says that it is doing preprocessing, but to me seems failing in doing multiple passes |
11:57:01 | FromDiscord | <Rika> In reply to @Yardanico "two async callbacks can't": Well yes I never said parallel write |
11:57:32 | FromDiscord | <Rika> I mean having many of the same file open at once since that is possible if you yield before closing |
11:57:43 | FromDiscord | <Rika> Please read what I say |
11:58:24 | FromDiscord | <Yardanico> anyway time to do fun investigations |
11:58:24 | FromDiscord | <Yardanico> https://stackoverflow.com/questions/67665566/how-to-cosmonim-gcc-on-solus-linux-segfault |
11:58:27 | FromDiscord | <Yardanico> unanswered |
11:58:38 | FromDiscord | <Yardanico> guess i should update cosmonim (if needed) and try to find the reason of this |
12:05:50 | PMunch | @PsychoClay, something like this http://ix.io/3waA/nim |
12:06:02 | * | supakeen quit (Quit: WeeChat 3.2) |
12:06:29 | * | supakeen joined #nim |
12:09:29 | FromDiscord | <PsychoClay> In reply to @PMunch "<@596976507033747466>, something like this": shouldnt line 28 be await instead of waitfor? |
12:10:13 | PMunch | It could be await, but we're not using the result |
12:10:20 | PMunch | And you shouldn't discard a future |
12:10:32 | PMunch | asyncCheck doesn't await completion, so that wouldn't work |
12:10:54 | PMunch | waitFor should work fine since we've already added all the tasks |
12:11:01 | PMunch | I think.. |
12:12:05 | FromDiscord | <PsychoClay> hmm i still dont really understand the difference between waitfor and await ig |
12:14:11 | FromDiscord | <Yardanico> @PMunch wouldn't it make more sense to https://nim-lang.org/docs/asyncfutures.html#all%2Cvarargs%5BFuture%5BT%5D%5D `requests` and waitFor on the result? |
12:14:15 | FromDiscord | <Yardanico> so waitFor all(requests) |
12:14:29 | PMunch | Oh I was looking for something like that! |
12:15:00 | FromDiscord | <Yardanico> actually `discard waitFor all(requests)` in full right |
12:15:08 | PMunch | await: yield control over the process to the caller, so that other stuff can be done while we're waiting for IO. waitFor: Spin until the IO is done, blocking the thread |
12:15:43 | FromDiscord | <Yardanico> hmm maybe not |
12:15:49 | FromDiscord | <Yardanico> ah wait it seems to complete |
12:15:52 | FromDiscord | <Yardanico> but took quite some time, that's weirdf |
12:15:53 | FromDiscord | <Yardanico> (edit) "weirdf" => "weird" |
12:21:02 | * | dsrw joined #nim |
12:21:18 | PMunch | Not that weird, if the server isn't throttling you it will be faster to just grab the whole file as one stream |
12:22:56 | arkanoid | I see that nor c2nim nor nimterop support C macros that require multiple preprocessor passes. If I do "gcc -C -P -E" it gets expanded successfully but now nimterop fails to convert (outputs pragma only) without explicit error, and c2nim tried to pull in whole stdlib names. I feel not following the right strategy here, what would you do? |
12:27:27 | * | rockcavera joined #nim |
12:27:27 | * | rockcavera quit (Changing host) |
12:27:27 | * | rockcavera joined #nim |
12:28:35 | * | dsrw quit (Quit: My MacBook has gone to sleep. ZZZzzz…) |
12:30:31 | FromDiscord | <Yardanico> so apparently cosmopolitan doesn't seem to be happy with refc on latest nim devel, works with orc though XD |
12:30:38 | FromDiscord | <Yardanico> (sigsegv with refc, runs fine with orc) |
12:31:54 | FromDiscord | <Yardanico> ah no, i celebrated too soon, it crashes on more complex programs with orc too |
12:37:41 | * | stkrdknmibalz quit (Ping timeout: 258 seconds) |
12:37:51 | * | dsrw joined #nim |
12:44:46 | PMunch | http://ix.io/3waD/nim <- PsychoClay, there, this should be a bit more stable |
12:45:03 | PMunch | Still no retry for failing requests though |
12:45:18 | PMunch | Which you probably want |
12:46:36 | PMunch | By the way, I'm rebooting that server right now. So replace the URL if you want to try it :P |
12:47:06 | FromDiscord | <Rika> error handling would be somewhat problematic to implement this way |
12:47:40 | * | xet7 quit (Ping timeout: 240 seconds) |
12:47:47 | PMunch | Why? |
12:48:17 | PMunch | Just keep track of the ranges that have failed and retry them |
12:51:35 | FromDiscord | <Rika> so do you readd to the seq or what |
12:51:48 | PMunch | Huh? |
12:52:10 | FromDiscord | <Rika> do you readd the failed ranges to the requests seq with the same callback |
12:53:27 | PMunch | while requests.len != 0: waitFor all(requests); requests = failedRequests |
12:53:52 | PMunch | And in the callback populate the failedRequests sequence |
12:53:58 | FromDiscord | <Rika> so an extra seq okay |
12:54:08 | FromDiscord | <Rika> not in the same callback, in the error callback right |
12:54:36 | FromDiscord | <Rika> eh i feel like this could be nicer |
12:55:21 | PMunch | Hmm, yeah I guess it would have to go in the error callback |
12:56:37 | * | arkurious joined #nim |
12:59:43 | FromDiscord | <Clonkk> As anyone heard / used NvChad ? https://github.com/NvChad/NvChad |
13:01:06 | * | xet7 joined #nim |
13:01:09 | FromDiscord | <Rika> what does it do? |
13:01:55 | PMunch | Well shit.. My server doesn't seem to want to come back up.. |
13:02:09 | * | kayabaNerve_ joined #nim |
13:03:18 | FromDiscord | <PsychoClay> eew lua |
13:04:44 | FromDiscord | <Rika> `if s > size or i + chunkSize == size: size else: s` why the or? s >= size would be true if the other is true is it not? |
13:05:25 | FromDiscord | <Rika> actually no the or is just not needed at all since if s == size it doesnt matter... |
13:05:33 | * | kayabaNerve quit (Ping timeout: 276 seconds) |
13:11:17 | * | max22- quit (Ping timeout: 245 seconds) |
13:13:22 | * | max22- joined #nim |
13:16:16 | PMunch | Huh? |
13:17:47 | PMunch | s > size is to cap the last range. i + chunkSize == size is to make sure that if the chunks exactly split the size the last chunk wouldn't do -1 and then lose a byte |
13:18:04 | PMunch | Since it loops to size -1 |
13:18:33 | FromDiscord | <PsychoClay> In reply to @PsychoClay "400 = 20 secs,": async 100 = 30 secs, 50mb↵async 200 = 20 secs, 50mb↵async 400 = 10 sec, 60mb |
13:19:05 | FromDiscord | <PsychoClay> def a big improvement |
13:19:19 | FromDiscord | <Rika> In reply to @PMunch "s > size is": then just add 1 to s? s+1 > size? |
13:23:51 | PMunch | Hmm, yeah I guess :P |
13:26:17 | * | max22- quit (Ping timeout: 245 seconds) |
13:29:42 | FromDiscord | <Rika> also this naming is awful, i did `s/\<i\>/chunkStart/g` and `s/\<s\>/chunkEnd/g` then removed stop and just did `min(size, ...)` |
13:29:51 | FromDiscord | <Rika> not sure if that's equivalent though, have to check |
13:30:04 | FromDiscord | <Rika> actually, why is it -1? |
13:39:26 | * | Vladar quit (Remote host closed the connection) |
13:41:17 | PMunch | Why is what -1? |
13:43:05 | PMunch | I originally had min(size, ...) but that had a bad edge case where it would drop the last byte of the file |
13:45:36 | FromDiscord | <fae> what's the difference between `for k, v in table:` and `for k, v in table.pairs` |
13:45:43 | PMunch | Nothing |
13:46:09 | PMunch | The pairs iterator is automatically assumed when you give two variables in a for loop |
13:46:41 | FromDiscord | <fae> but if you only do one variable it returns it as a tuple, hmm |
13:46:51 | PMunch | Yup |
13:47:07 | PMunch | The k, v syntax is just sugar for tuple unpacking |
13:47:28 | FromDiscord | <fae> cool, feels very compact |
13:49:46 | * | pro joined #nim |
13:50:10 | * | pro quit (Client Quit) |
14:05:37 | * | PMunch quit (Quit: Leaving) |
14:23:07 | * | max22- joined #nim |
14:38:42 | FromDiscord | <Chiggy> In reply to @enthus1ast "yep but working": You there? |
14:43:12 | * | nisstyre quit (Changing host) |
14:43:12 | * | nisstyre joined #nim |
15:05:23 | FromDiscord | <enthus1ast> want to look at your nimscript tutorials ;) |
15:11:23 | FromDiscord | <Chiggy> In reply to @enthus1ast "want to look at": Huh? |
15:11:27 | FromDiscord | <haxscramper> I have some examples in https://github.com/haxscramper/hack/tree/master/testing/nim/compilerapi and added seveal more |
15:11:37 | FromDiscord | <haxscramper> From peterme.net |
15:13:23 | FromDiscord | <enthus1ast> [haxscramper](https://matrix.to/#/@haxscramper:matrix.org)\: this dynamic execution thing is hard stuff (for me), i want to play around with nimscript first to get more familiar with compiler/vm api |
15:13:42 | FromDiscord | <enthus1ast> at least i fixed the return issue |
15:14:10 | FromDiscord | <haxscramper> yes, the code I linked starts with basic examples |
15:14:18 | FromDiscord | <haxscramper> like hello world |
15:14:18 | FromDiscord | <enthus1ast> yeah i see |
15:17:52 | FromDiscord | <dom96> In reply to @PMunch "<@596976507033747466>, something like this": nice example, but you should really make these changes: template->proc, do not use `waitFor` in an async proc, ever. |
15:46:05 | FromDiscord | <Chiggy> In reply to @enthus1ast "want to look at": What did you mean? |
15:46:18 | FromDiscord | <Chiggy> (edit) "In reply to @enthus1ast "want to look at": What did you mean? ... " added "was that msg meant for me" |
16:02:34 | * | flynn quit (Ping timeout: 240 seconds) |
16:03:41 | * | flynn joined #nim |
16:05:43 | FromDiscord | <PsychoClay> is there a way to get n amount of (random) elements from a `HashSet` |
16:07:30 | FromDiscord | <Rika> pop? |
16:07:34 | FromDiscord | <Rika> https://nim-lang.org/docs/sets.html#pop%2CHashSet%5BA%5D |
16:07:37 | FromDiscord | <PsychoClay> hmm yea ig |
16:07:52 | FromDiscord | <Rika> just pop n times |
16:23:52 | * | _KurtGodel joined #nim |
16:26:21 | FromDiscord | <TechnoRazor> If I want to abandon OOP completely, there's just one issue that I can't find a solution to:↵In Java or other object-oriented languages, you can keep a list of objects that match a certain interface. Is there any way to do this, or something similar, in Nim? Generics don't work because there's no way to know the type of an object in the list at compile-time. |
16:26:55 | * | KurtGodel quit (Ping timeout: 268 seconds) |
16:30:17 | FromDiscord | <chiggy_> [enthus1ast](https://matrix.to/#/@sn0re:matrix.code0.xyz) you there? |
16:34:11 | FromDiscord | <⃟⃟> when i saw that i already noticed hte text is grey |
16:34:42 | FromDiscord | <⃟⃟> why would you stare at grey text for extended periods of time |
16:34:59 | FromDiscord | <⃟⃟> the comments looks even harder to read |
16:36:02 | FromDiscord | <⃟⃟> also i see those bars which look like for a music player |
16:36:05 | FromDiscord | <⃟⃟> ....in a text editor |
16:38:33 | FromDiscord | <Rika> what are you talking abou |
16:38:35 | FromDiscord | <tandy> when using the \`poParentStreams\` option, and the \`process.errorStream\`, how do i stop the program from stopping when there is an error? I just want the error to be logged |
16:41:04 | FromDiscord | <haxscramper> In reply to @TechnoRazor "If I want to": You can try using concepts (experimental) or https://github.com/yglukhov/iface |
16:43:28 | FromDiscord | <TechnoRazor> It doesn't look like you can use a concept as a type for a seq, sadly https://media.discordapp.net/attachments/371759389889003532/876868773985022023/unknown.png |
16:43:54 | FromDiscord | <haxscramper> yes, concepts define compile-time interface |
16:44:51 | FromDiscord | <TechnoRazor> Yeah that's the issue |
16:45:46 | FromDiscord | <TechnoRazor> I need some way of storing objects that match a certain interface into an array or seq or something, without their types being known at compile-time |
16:49:25 | * | max22- quit (Quit: Leaving) |
16:50:27 | * | max22- joined #nim |
16:54:23 | FromDiscord | <gerwy> hi, so umm idk where i can post it and i just wanted to show it lol↵i made mandelbrot renderer that is using avx2 and also multithreading, again thanks for everyone that helped me :> |
16:54:26 | FromDiscord | <gerwy> https://media.discordapp.net/attachments/371759389889003532/876871531727294464/image.png |
16:54:43 | FromDiscord | <haxscramper> In reply to @TechnoRazor "I need some way": then try iface |
16:55:24 | FromDiscord | <everyon> In reply to @Life Sucks "hi, so umm idk": can you post a link please? |
16:57:53 | FromDiscord | <TechnoRazor> In reply to @haxscramper "then try iface": iface seems to work well, thanks! |
17:07:56 | FromDiscord | <gerwy> In reply to @everyon "can you post a": i just wrote it and it works but there are still a lot of issues with it so i don't recommend to use that for anything but yeah its in my tomata project↵https://github.com/g3rwy/tomata↵its mandel_optim |
17:08:44 | FromDiscord | <gerwy> in near future i could also try to rewrite it in GLSL for even more performance, but raylib shader needs to work for that and it doesn't |
17:10:46 | * | icebattle quit (Ping timeout: 272 seconds) |
17:19:09 | FromDiscord | <treeform> In reply to @Life Sucks "hi, so umm idk": That is pretty cool! I also made one recently using shady: |
17:19:11 | FromDiscord | <treeform> https://media.discordapp.net/attachments/371759389889003532/876877765801017384/mandelbrot.png |
17:19:25 | FromDiscord | <treeform> Mine does not look as good. |
17:19:42 | FromDiscord | <treeform> https://github.com/treeform/shady/blob/master/examples/circle.nim |
17:19:58 | FromDiscord | <treeform> https://github.com/treeform/shady/blob/master/examples/mandelbrot.nim |
17:20:16 | FromDiscord | <treeform> But same code runs on both GPU and CPU. |
17:21:15 | FromDiscord | <treeform> How can I make mine look as good as yours? |
17:23:59 | arkanoid | filterIt cannot be used on iterator? |
17:25:37 | FromDiscord | <Rika> sequtils things can only be used on container-like types |
17:25:43 | FromDiscord | <Rika> iterators can be infinite so |
17:25:50 | FromDiscord | <Rika> would need a different implementation |
17:27:34 | arkanoid | got it |
17:28:13 | arkanoid | not sure then why XmlNode "items" proc is an iterator |
17:28:24 | arkanoid | shouldn't the child nodes be finite |
17:30:35 | arkanoid | also: what's this? https://nim-lang.org/1.0.6/sequtils.html#items.i |
17:31:57 | FromDiscord | <haxscramper> https://github.com/nim-lang/Nim/blob/version-1-4/lib/pure/collections/sequtils.nim#L985 mapit & other explicitly call items so it break everything |
17:32:15 | FromDiscord | <haxscramper> it is not about infinite or finite iterators, it has nothing to do with seqs |
17:32:19 | FromDiscord | <haxscramper> filterit etc. |
17:33:05 | FromDiscord | <haxscramper> In reply to @arkanoid "also: what's this? https://nim-lang.org/1.0.6/sequt": you need this in order to iterate over closure iterator |
17:33:09 | FromDiscord | <haxscramper> idk why this is not in system |
17:33:48 | FromDiscord | <haxscramper> but `let it = (iterator(): int = yield 12)` and `for i in it` probably won't work by default |
17:34:13 | FromDiscord | <haxscramper> ye https://wandbox.org/permlink/Vz6iCJ5xCbIKoc7k |
17:34:17 | arkanoid | I'm just trying to filter out XmlNode according to direct child tag |
17:34:47 | arkanoid | for node in sequtils.items(rootNode).filterIt(it.tag == "bar"): |
17:35:12 | arkanoid | for node in sequtils.items(rootNode.items).filterIt(it.tag == "bar"): |
17:35:35 | FromDiscord | <haxscramper> sent a code paste, see https://play.nim-lang.org/#ix=3wc4 |
17:36:33 | FromDiscord | <haxscramper> I think there should be a library for composable `collect`-like code, similar to zerofunctional and the thing I described in pattern matching article |
17:36:41 | arkanoid | I think there's something wrong with your paste on nim-lang |
17:36:54 | FromDiscord | <haxscramper> https://wandbox.org/permlink/f6AEg6GLn7ugyqMM |
17:38:15 | FromDiscord | <gerwy> In reply to @treeform "": @treeform oh shit so you are the author of shady hah↵i tried to use it too, because GLSL was my target too, but raylib doesn't like it for some reason... (using the mandelbrot from shady examples) |
17:39:55 | * | rockcavera quit (Remote host closed the connection) |
17:40:15 | FromDiscord | <haxscramper> In reply to @arkanoid "for node in sequtils.items(rootNode.items).filterIt": Though in this particular case you overenginerr stuff `echo parseXml("<a><b/><c/><b/></a>").filterIt(it.tag == "b")` |
17:40:37 | FromDiscord | <haxscramper> `filterIt` implicitly calls items, so you don't need to |
17:41:18 | FromDiscord | <haxscramper> !eval import std/[sequtils, xmltree, xmlparser]; echo parseXml("<a><b/><c/><b/></a>").filterIt(it.tag == "b") |
17:41:22 | NimBot | @[<b />, <b />] |
17:42:33 | FromDiscord | <treeform> In reply to @Life Sucks "<@107140179025735680> oh so you": I never test it with raylib so I don't know. It just produces GLSL code you can inspect it to see what the issues is. |
17:44:37 | arkanoid | k thanks |
17:44:38 | FromDiscord | <gerwy> yeah i tried, i wanted to use the generated glsl file and one issue i think i could have was that i couldn't get or set time uniform↵but idk, if shady won't work for me i can also try to modify julia set example in nimraylib-now |
17:50:28 | FromDiscord | <Rika> didnt realise it worked with closure iterators |
17:50:32 | * | jfrent left #nim (WeeChat 3.1) |
17:50:36 | FromDiscord | <Rika> then the issue is that items() isnt a closure iterator no? |
17:53:16 | FromDiscord | <haxscramper> you mean filterIt? |
17:53:24 | FromDiscord | <haxscramper> "worked with closure iterators" |
17:58:09 | FromDiscord | <Rika> yes the reply didnt seem to work |
17:58:10 | FromDiscord | <Rika> xd |
18:02:12 | FromDiscord | <haxscramper> filterit break with `.items` not because it is a non-closure, but because it calls `items()` explicitly in template, so you get `items(items(X))`, or `items(<some other iterator>)` |
18:02:22 | FromDiscord | <haxscramper> If inline iterators were composable this would be a non-issue |
18:07:35 | FromDiscord | <Chiggy> Hey uh, can anyone help me port some python code into nim? the thing is my code right now is too slow to run in python. And am new to nim, so some help would be appreciated 😅 |
18:08:06 | FromDiscord | <linux user> do it man |
18:08:11 | FromDiscord | <linux user> let the probkllems in |
18:10:30 | FromDiscord | <Rika> In reply to @haxscramper "filterit break with `.items`": well if `items()` were wrapped in a closure iterator then it would work because of the proc sent above |
18:10:58 | FromDiscord | <Rika> if it were tried with another inline iterator it would not work i assume, doesnt that mean i'm right? |
18:15:33 | FromDiscord | <Rika> In reply to @Chiggy "Hey uh, can anyone": well it would be nice to just have said what you needed help with |
18:16:46 | FromDiscord | <Chiggy> I tried porting the first part (of 3 parts) of my python code to nim, and uhhh, its horribly inefficient. my python code took 2 minutes 15 seconds, and nim version took 11 minutes 💀. I am now looking into ways I can improve my code |
18:17:00 | FromDiscord | <Chiggy> my python code <https://gist.github.com/Chiggy-Playz/09daa4563f5b7dd0275d92ffbefef60e> |
18:17:02 | FromDiscord | <Rika> well yeah but i mean more |
18:17:03 | FromDiscord | <Rika> okay |
18:17:06 | FromDiscord | <Rika> the nim code? |
18:17:12 | FromDiscord | <Chiggy> gimme a sec lemme upload |
18:18:08 | FromDiscord | <Rika> i didnt realise it is 3 am for me okay well im not sure if i can help |
18:18:13 | FromDiscord | <Chiggy> In reply to @Rika "the nim code?": nim code <https://gist.github.com/Chiggy-Playz/2217d1322cd77527c246c136bead70ee> |
18:18:28 | FromDiscord | <Chiggy> In reply to @Rika "i didnt realise it": oh |
18:18:30 | FromDiscord | <Chiggy> well |
18:18:39 | FromDiscord | <Chiggy> ig I will be stuck on it lol |
18:19:17 | FromDiscord | <Chiggy> does nim have something like python dicts |
18:19:19 | FromDiscord | <Rika> ill look at it and try if i can see anything obvious but ill leave soon |
18:19:24 | FromDiscord | <Rika> yes theyre called tables |
18:19:48 | FromDiscord | <Chiggy> why are they not in here lol https://media.discordapp.net/attachments/371759389889003532/876893018886656041/unknown.png |
18:20:23 | FromDiscord | <PsychoClay> theyre here https://nim-lang.org/docs/lib.html |
18:20:26 | * | max22- quit (Ping timeout: 272 seconds) |
18:20:51 | FromDiscord | <Chiggy> ok |
18:21:34 | FromDiscord | <Rika> i dont see anything obviously slow other than probably the `json` module, you might have more luck with another (3rd party) json parser |
18:21:52 | FromDiscord | <Chiggy> the loop is the slowest thing |
18:21:58 | FromDiscord | <Chiggy> its just |
18:22:00 | FromDiscord | <Chiggy> so slow lol |
18:22:34 | FromDiscord | <Chiggy> I am looking into tables |
18:22:36 | FromDiscord | <Chiggy> (edit) "I am looking into tables ... " added "r" |
18:22:38 | FromDiscord | <Chiggy> (edit) "r" => "rn" |
18:22:45 | FromDiscord | <Chiggy> hopefully they will help out much more |
18:23:18 | FromDiscord | <PsychoClay> doesnt `client.getContent("ip")` give any errors? |
18:23:27 | FromDiscord | <PsychoClay> ip isnt a valid url right? |
18:23:27 | FromDiscord | <Chiggy> no? |
18:23:34 | FromDiscord | <Chiggy> I changed the ip on purpose |
18:23:35 | FromDiscord | <Chiggy> duh |
18:23:38 | FromDiscord | <PsychoClay> ahh ok |
18:23:42 | FromDiscord | <Chiggy> wait |
18:23:49 | FromDiscord | <Chiggy> <https://gist.github.com/Chiggy-Playz/09daa4563f5b7dd0275d92ffbefef60e> if you scroll down |
18:23:53 | FromDiscord | <Chiggy> you can see it return |
18:23:54 | FromDiscord | <Chiggy> (edit) "return" => "returns" |
18:24:01 | FromDiscord | <Chiggy> whats present in the `raw_data.json` file |
18:24:35 | FromDiscord | <Rika> In reply to @Chiggy "hopefully they will help": doubt |
18:24:58 | FromDiscord | <Chiggy> ah shit |
18:25:23 | FromDiscord | <Rika> just use a different json library, i feel like it would be faster that way. maybe packedjson? |
18:25:44 | FromDiscord | <Chiggy> is it really the issue of the json lib and not my code? |
18:25:55 | FromDiscord | <Chiggy> like old players gts contains a good amount of jsonnodes. Like 40k+ |
18:26:09 | FromDiscord | <Rika> `json` is notorious for being slow so its my suspicion |
18:26:14 | FromDiscord | <Rika> yes |
18:26:27 | FromDiscord | <Rika> if that's so im almost sure its `json` now |
18:26:40 | FromDiscord | <Chiggy> so what do you suggest |
18:26:42 | FromDiscord | <PsychoClay> if you get really stuck u can try the profiling section in this guide: https://nim-lang.org/blog/2017/10/02/documenting-profiling-and-debugging-nim-code.html |
18:26:44 | FromDiscord | <Rika> swap |
18:26:48 | FromDiscord | <Rika> to packedjson |
18:27:01 | FromDiscord | <Rika> or try doing something else, do you really need to copy the whole section? |
18:27:22 | FromDiscord | <Chiggy> huh? |
18:27:29 | FromDiscord | <Rika> if you can avoid doing `player["Old Server"] = player["Server"]` and company then it would probably be quicker |
18:27:40 | FromDiscord | <Chiggy> I have to |
18:27:45 | FromDiscord | <Chiggy> its necesarry |
18:27:59 | FromDiscord | <Chiggy> those 4 lines are important yes |
18:27:59 | FromDiscord | <Rika> then use the different library, i dont see any other way to make this quicker |
18:28:03 | FromDiscord | <Chiggy> which |
18:28:11 | FromDiscord | <Rika> i already told you |
18:28:54 | FromDiscord | <Chiggy> ok |
18:29:34 | FromDiscord | <Rika> im thinking still |
18:29:59 | FromDiscord | <Rika> actually |
18:29:59 | FromDiscord | <Rika> wait |
18:30:06 | FromDiscord | <Rika> @Chiggy wait, maybe try a different GC |
18:30:28 | FromDiscord | <Rika> im not sure if that would help at all because having a massive number of json nodes means a fucktonne of indirection |
18:30:55 | FromDiscord | <Chiggy> I am thinking of converting my json nodes into table key value pairs |
18:31:07 | FromDiscord | <Rika> actually, does it even copy? i dont think that's the issue is it? |
18:31:12 | FromDiscord | <Chiggy> then I can do if table.hasKey instead of this https://media.discordapp.net/attachments/371759389889003532/876895883420135475/unknown.png |
18:31:21 | FromDiscord | <Chiggy> I believe this image above is the issue |
18:31:26 | FromDiscord | <Chiggy> coz like it has to loop 40k every time |
18:31:34 | FromDiscord | <Chiggy> (edit) "every time" => "like 6-7k times" |
18:31:50 | FromDiscord | <Chiggy> would table.hasKey be fast |
18:31:51 | FromDiscord | <Chiggy> (edit) "fast" => "faster" |
18:31:55 | FromDiscord | <Chiggy> I think it will be? |
18:31:57 | * | greaser|q quit (Changing host) |
18:31:57 | * | greaser|q joined #nim |
18:32:00 | FromDiscord | <Rika> what |
18:32:01 | * | greaser|q is now known as GreaseMonkey |
18:32:14 | FromDiscord | <Rika> i dont see where haskey would slot in here |
18:32:25 | FromDiscord | <Chiggy> yes sorry |
18:32:32 | FromDiscord | <Chiggy> In reply to @Chiggy "I am thinking of": . |
18:32:34 | FromDiscord | <Chiggy> this is my plan now |
18:32:47 | FromDiscord | <Rika> please note that tables arent like python dictionaries |
18:32:54 | FromDiscord | <Chiggy> uh |
18:33:14 | FromDiscord | <Rika> in the fact that the value is limited to a single type is what i mean |
18:33:20 | FromDiscord | <Chiggy> oh ok |
18:33:21 | FromDiscord | <Chiggy> lmao |
18:33:24 | FromDiscord | <Chiggy> you had me scared |
18:33:25 | FromDiscord | <Chiggy> thats fine |
18:33:33 | FromDiscord | <Chiggy> all my values will be string |
18:33:35 | FromDiscord | <PsychoClay> u can also try the `strtabs` lib if ur only working with strings |
18:33:43 | FromDiscord | <PsychoClay> i think its supposed to be faster |
18:33:55 | FromDiscord | <Chiggy> I don't think I will be working with only strings |
18:33:59 | FromDiscord | <Chiggy> but I will have a look at it |
18:34:02 | FromDiscord | <PsychoClay> in the table i mean |
18:34:20 | FromDiscord | <Chiggy> also, for some reason, as soon as I import nimprof, lots of errors appear |
18:35:22 | FromDiscord | <Chiggy> In reply to @Rika "in the fact that": except that they are pretty much the same right |
18:36:03 | FromDiscord | <Rika> i think so? my brain is thinking of a lot of scenarios and i cant see any difference |
18:36:14 | FromDiscord | <Chiggy> ok |
18:36:23 | FromDiscord | <Rika> other than pythony stuff like how globals is a dict or w/e |
18:39:27 | FromDiscord | <Chiggy> can I have nested table? |
18:39:33 | FromDiscord | <Chiggy> key is string, but value is another tble |
18:39:36 | FromDiscord | <Chiggy> (edit) "tble" => "table" |
18:39:45 | FromDiscord | <PsychoClay> should be fine |
18:39:57 | FromDiscord | <Chiggy> So how do I init such a table? |
18:40:50 | FromDiscord | <PsychoClay> i think its automatic not sure tho |
18:40:57 | FromDiscord | <Chiggy> `initTable[string, initTable[string,string]]()` ? |
18:41:01 | FromDiscord | <Rika> no need to init |
18:41:14 | FromDiscord | <Chiggy> I was just trying to follow this example : https://nim-lang.org/docs/tables.html#basic-usage-table |
18:41:57 | FromDiscord | <Rika> `initTable[string, Table[string, string]]()` |
18:42:09 | FromDiscord | <Rika> `Starting from Nim v0.20, tables are initialized by default and it is not necessary to call this function explicitly.` |
18:42:12 | FromDiscord | <Rika> https://nim-lang.org/docs/tables.html#initTable |
18:42:32 | FromDiscord | <Chiggy> so how do I create a blank table |
18:42:41 | FromDiscord | <Chiggy> just `var t = {}.toTable` ? |
18:42:43 | FromDiscord | <Rika> the table is blank by default |
18:42:45 | FromDiscord | <PsychoClay> sent a code paste, see https://play.nim-lang.org/#ix=3wcx |
18:43:04 | FromDiscord | <Chiggy> Ok |
18:43:05 | FromDiscord | <Rika> sent a code paste, see https://play.nim-lang.org/#ix=3wcy |
18:43:34 | FromDiscord | <Rika> it is pushing 4 am |
18:43:36 | FromDiscord | <Rika> i forgot |
18:43:48 | FromDiscord | <Chiggy> you should sleep |
18:43:53 | FromDiscord | <PsychoClay> how are u even awake lol |
18:43:56 | FromDiscord | <Chiggy> I appreciate your help 🙂 |
18:44:50 | FromDiscord | <Rika> In reply to @PsychoClay "how are u even": short story is that ive been doing this for years now because of the schools i attend (prestigious therefore pretty intense) |
18:45:12 | FromDiscord | <PsychoClay> that sucks |
18:49:04 | FromDiscord | <Chiggy> Ok uh somethings going wrong here |
18:49:12 | FromDiscord | <Chiggy> https://media.discordapp.net/attachments/371759389889003532/876900416300941322/unknown.png |
18:49:32 | FromDiscord | <Chiggy> this is how I defined old_players_gts var old_players_gts : Table[string, Table[string, string]] |
18:49:38 | FromDiscord | <Chiggy> (edit) "var" => "`var" | "string]]" => "string]]`" |
18:50:34 | FromDiscord | <PsychoClay> Put a getStr after x[name] |
18:51:53 | FromDiscord | <Chiggy> oh yeah thans |
18:51:54 | FromDiscord | <Chiggy> (edit) "thans" => "thanks" |
18:51:55 | FromDiscord | <Chiggy> btw |
18:52:02 | FromDiscord | <Chiggy> can I just do `$x["Name"]` |
18:52:14 | FromDiscord | <PsychoClay> I dont think so |
18:52:51 | FromDiscord | <PsychoClay> I think that gives the string representation of the jsonnode |
18:53:05 | FromDiscord | <Chiggy> oh ok |
18:56:40 | * | dsrw quit (Ping timeout: 240 seconds) |
18:57:08 | * | SebastianM joined #nim |
19:03:47 | NimEventer | New thread by Martin: Newbie kick-in-the-pants: nim as a cgi application, see https://forum.nim-lang.org/t/8331 |
19:07:25 | * | max22- joined #nim |
19:08:03 | * | dsrw joined #nim |
19:08:22 | FromDiscord | <tandy> is it possible to "subtract" two sorted seqs in nim? |
19:08:22 | FromDiscord | <tandy> to get the difference / missing items? |
19:12:37 | FromDiscord | <exelotl> there's probably not a built-in method for it |
19:15:04 | * | rockcavera joined #nim |
19:15:04 | * | rockcavera quit (Changing host) |
19:15:04 | * | rockcavera joined #nim |
19:16:04 | FromDiscord | <Chiggy> if I define a variable inside a for loop, it will not be accessible out of the lop right? and will be destroyed when loop is done? |
19:18:52 | FromDiscord | <haxscramper> yes |
19:19:18 | FromDiscord | <haxscramper> For loop variables are not exactly "created", so I'm not sure if they would trigger destructor |
19:19:34 | FromDiscord | <Chiggy> yeah destruction actually doesnt matter much in this case |
19:19:44 | FromDiscord | <haxscramper> i.e. for loop variables are not copied from container |
19:20:00 | FromDiscord | <Chiggy> and also one more question |
19:20:26 | FromDiscord | <Chiggy> I have a table. Printing it would be horrible since its really big. How can I save it into a file? |
19:21:12 | FromDiscord | <haxscramper> You want to serialize or just print to the file? |
19:21:32 | FromDiscord | <haxscramper> priting to file would be `"myFile".writeFile($table)` |
19:21:34 | FromDiscord | <Chiggy> Like, for debugging purposes, I would like to see the contents of the table |
19:21:44 | FromDiscord | <Chiggy> but its really big to echo |
19:21:50 | FromDiscord | <Chiggy> In reply to @haxscramper "priting to file would": ok |
19:26:29 | * | SebastianM quit (Quit: Bye) |
19:33:07 | FromDiscord | <Chiggy> sent a code paste, see https://play.nim-lang.org/#ix=3wcL |
19:33:17 | FromDiscord | <Chiggy> (edit) "https://play.nim-lang.org/#ix=3wcL" => "https://play.nim-lang.org/#ix=3wcM" |
19:34:51 | FromDiscord | <haxscramper> sent a code paste, see https://paste.rs/83C |
19:35:09 | FromDiscord | <haxscramper> (edit) "https://play.nim-lang.org/#ix=3wcO" => "https://play.nim-lang.org/#ix=3wcN" |
19:35:19 | FromDiscord | <haxscramper> This would leave `"Server"` node in the both keys and values |
19:35:20 | FromDiscord | <Chiggy> I am hoping to make the seq elements Table |
19:35:27 | FromDiscord | <Chiggy> (edit) "I am hoping to make the seq elements Table ... " added "not a jsonNode" |
19:35:47 | FromDiscord | <haxscramper> so you want to have like `table[string, seq[Record]]`? |
19:35:56 | FromDiscord | <Chiggy> um. Whats a Record |
19:35:58 | FromDiscord | <Chiggy> let me searh |
19:35:59 | FromDiscord | <Chiggy> (edit) "searh" => "search" |
19:36:07 | FromDiscord | <haxscramper> `{"Name":"Foo","Time":"1 minute"},` |
19:36:48 | FromDiscord | <haxscramper> sent a code paste, see https://play.nim-lang.org/#ix=3wcQ |
19:36:51 | * | dsrw quit (Ping timeout: 268 seconds) |
19:37:16 | FromDiscord | <Chiggy> I didnt understand the mget part |
19:37:16 | FromDiscord | <haxscramper> sent a code paste, see https://play.nim-lang.org/#ix=3wcR |
19:37:25 | FromDiscord | <Chiggy> wouldnt that just set the value to an empty seq every time |
19:37:26 | FromDiscord | <haxscramper> https://nim-lang.org/docs/tables.html#mgetOrPut%2CTable%5BA%2CB%5D%2CA%2CB |
19:37:44 | FromDiscord | <haxscramper> In reply to @Chiggy "wouldnt that just set": mgetOrPut stands for mutable get OR put |
19:37:54 | FromDiscord | <haxscramper> > Retrieves value at t[key] or puts val if not present, either way returning a value which can be modified. |
19:38:21 | FromDiscord | <haxscramper> so no, it would not put empty sequence each time, only when first encountered |
19:38:29 | FromDiscord | <Chiggy> oh yeah it makes sense now |
19:38:32 | FromDiscord | <Chiggy> got it |
19:39:16 | FromDiscord | <Chiggy> sent a code paste, see https://play.nim-lang.org/#ix=3wcS |
19:39:26 | * | dsrw joined #nim |
19:39:38 | FromDiscord | <haxscramper> https://wandbox.org/permlink/Mp2FTMq0f5kllz2S |
19:40:20 | FromDiscord | <haxscramper> You want to get result as `Table[string, seq[JsonNode]]` or as `Table[string, seq[Record]]`? |
19:40:57 | FromDiscord | <Chiggy> Whichever is best for performance |
19:42:31 | FromDiscord | <Chiggy> so uh, which would be best for perf? |
19:44:49 | FromDiscord | <haxscramper> sent a code paste, see https://play.nim-lang.org/#ix=3wcX |
19:44:56 | FromDiscord | <haxscramper> sent a code paste, see https://play.nim-lang.org/#ix=3wcY |
19:45:01 | FromDiscord | <haxscramper> jsony is ~43/23 times faster |
19:45:09 | FromDiscord | <haxscramper> ~twice |
19:46:38 | FromDiscord | <Chiggy> Damn this timeit thingy is cool |
19:46:44 | FromDiscord | <Chiggy> lemme search jsony |
19:47:09 | FromDiscord | <haxscramper> sent a code paste, see https://play.nim-lang.org/#ix=3wd0 |
19:47:24 | FromDiscord | <haxscramper> In reply to @Chiggy "lemme search jsony": https://github.com/treeform/jsony https://github.com/treeform/benchy |
19:47:30 | FromDiscord | <Chiggy> got it |
19:54:23 | * | dsrw quit (Quit: Textual IRC Client: www.textualapp.com) |
19:57:45 | FromDiscord | <Chiggy> hey @haxscramper, if my input json has spaces in the field, jsony just puts a blank string (`""`) for the records. How do I deal with that |
19:58:13 | FromDiscord | <haxscramper> `renameHook` |
19:58:52 | FromDiscord | <Chiggy> ok |
19:59:03 | FromDiscord | <Chiggy> so just defining a proc called renameHook wil ldo it? |
19:59:05 | FromDiscord | <Chiggy> (edit) "wil ldo" => "will do" |
19:59:41 | FromDiscord | <haxscramper> yes, I have it in my example |
19:59:57 | FromDiscord | <haxscramper> I used it to convert `"Name"` to the nep1-conforming field names |
20:00:12 | FromDiscord | <Chiggy> ok |
20:00:14 | FromDiscord | <Chiggy> thanks |
20:06:19 | arkanoid | is it possible to force a seq[MyVariantTypeOfParticularKind]? |
20:06:56 | FromDiscord | <undersquire> wdym force |
20:07:54 | arkanoid | a seq that contains object variants of a particular kind |
20:08:05 | FromDiscord | <undersquire> oh |
20:08:13 | FromDiscord | <undersquire> not that I know of |
20:08:15 | FromDiscord | <haxscramper> no, this is not possible |
20:08:26 | arkanoid | k |
20:08:29 | FromDiscord | <haxscramper> well |
20:08:37 | FromDiscord | <haxscramper> depends on definition on sanity |
20:08:42 | FromDiscord | <undersquire> 😂 |
20:09:00 | FromDiscord | <haxscramper> but you can make a generic wrapper with `static[set[Kind]]` |
20:09:39 | FromDiscord | <haxscramper> and then write all sort of operators that would statically check for intersection/subset/superset relations between static generic parameters of the arguments |
20:09:42 | FromDiscord | <haxscramper> this is possible |
20:10:14 | arkanoid | I don't want it anymore :D |
20:10:20 | FromDiscord | <haxscramper> https://wandbox.org/permlink/5bWPmFbPiWEYmSDL example of this madness for compile-time query validation |
20:10:40 | FromDiscord | <haxscramper> It doesn't look that bad, just more work then you'd probably want to put in |
20:10:41 | FromDiscord | <haxscramper> ye |
20:10:43 | FromDiscord | <haxscramper> yes |
20:11:20 | FromDiscord | <haxscramper> well, now I'm interested |
20:12:14 | arkanoid | oh dear, I fear like having activated evil robot by accident |
20:13:01 | FromDiscord | <PsychoClay> you could also just use pointers right? |
20:13:50 | FromDiscord | <haxscramper> is this related to `MyVariantTypeOfParticularKind`? |
20:20:25 | FromDiscord | <haxscramper> okay, yes, https://wandbox.org/permlink/bzWymdCvs7mX8bQD type mismatch errors would literally murder anyone's willingness to work with that |
20:20:40 | FromDiscord | <haxscramper> `required type for arg: AstWrap[{0, 1, 2}] but expression 'AstWrap[toSet({akInt})]()' is of type: AstWrap[{0}]` |
20:20:59 | FromDiscord | <haxscramper> But we are getting so deep into |
20:21:31 | FromDiscord | <haxscramper> Like, this would be an awesome feature if nim supported some way of user-defined callbacks for user messages |
20:21:33 | FromDiscord | <haxscramper> idk |
20:22:13 | FromDiscord | <haxscramper> and btw, this is a zero-cost-at-runtime solution (wrap has the same `sizeof`), |
20:22:33 | FromDiscord | <haxscramper> Only paying for field access on non-compiled backends |
20:24:27 | FromDiscord | <tandy> is there a method for escaping \`$\` in a filename? |
20:25:09 | FromDiscord | <tandy> im substituting the filename in here, \` FFMPEG = "ffmpeg -hide\_banner -loglevel error -i \\"$#\\" -n -map\_metadata 0 -c\:a libopus -b\:a 128k \\"$#\\""\`, and when the filename has a \`$\` it fails some how |
20:26:08 | FromDiscord | <haxscramper> you are using runtime string interpolation with `$#`, and when file has `$` it fails. Can you use strformat maybe? |
20:28:15 | FromDiscord | <tandy> i wil try that |
20:31:57 | FromDiscord | <Chiggy> shouldnt the hour minute and second values be 1, 35 and 40 respectively? https://media.discordapp.net/attachments/371759389889003532/876926273421729832/unknown.png |
20:32:36 | FromDiscord | <tandy> hmm, since i am using this string as a constant and i dont have the vars that i am substituting until later in the program im not sure how to do it |
20:32:51 | FromDiscord | <tandy> because you cant just put fmt"string\: {}" |
20:34:44 | FromDiscord | <konsumlamm> In reply to @Chiggy "shouldnt the hour minute": `var hours, minutes, seconds = ...` doesn't destructure the result, it just assigns the same result to every variable |
20:35:02 | FromDiscord | <Chiggy> In reply to @konsumlamm "`var hours, minutes, seconds": how can I get the values then? |
20:35:24 | FromDiscord | <konsumlamm> assign them to a variable and then index? |
20:35:27 | FromDiscord | <Chiggy> like other than doing `var hour = time[0]` |
20:35:31 | FromDiscord | <konsumlamm> or use `fusion/matching` |
20:35:40 | FromDiscord | <Chiggy> hmm ok |
20:40:27 | FromDiscord | <haxscramper> I forgot you can escape `$` by doubling it |
20:40:28 | FromDiscord | <haxscramper> so replace `$` with `$$` |
20:40:42 | FromDiscord | <haxscramper> !eval import std/strutils; echo "$1 eats $$2 $2." % ["The cat", "fish"] |
20:40:45 | NimBot | The cat eats $2 fish. |
20:42:19 | arkanoid | I'm getting "Error: unhandled exception: assignment to discriminant changes object branch; compile with -d:nimOldCaseObjects for a transition period [FieldDefect]" but I dont know how this is possible, I'm just doing "result.kind = nyMyKind" where result is non-ref |
20:42:53 | arkanoid | oh, wait, I have an idea |
20:43:03 | FromDiscord | <Chiggy> @haxscramper how can I create an empty table? |
20:43:47 | FromDiscord | <haxscramper> `var table: Table[...]` |
20:44:06 | FromDiscord | <haxscramper> you can't assign to kind fields↵(<@709044657232936960_arkanoid=5b=49=52=43=5d>) |
20:44:19 | FromDiscord | <haxscramper> https://github.com/nim-lang/RFCs/issues/407 |
20:44:33 | FromDiscord | <Chiggy> In reply to @haxscramper "`var table: Table[...]`": https://media.discordapp.net/attachments/371759389889003532/876929445829697536/unknown.png |
20:45:11 | FromDiscord | <haxscramper> Use `initTable[K, V]()` to init empty table then |
20:45:19 | FromDiscord | <Chiggy> ok |
20:48:24 | arkanoid | simplest way to pretty print nested objects in nim? |
20:49:53 | FromDiscord | <haxscramper> treeform/jsony or haxscramper/hmisc/other/hpprint |
20:50:04 | FromDiscord | <haxscramper> s/jsony/print/ |
20:50:20 | FromDiscord | <haxscramper> hpprint is more featured, but I still havent properly tested it |
20:50:27 | FromDiscord | <konsumlamm> In reply to @Chiggy "": the empty "table" literal is `{:}` |
20:50:43 | FromDiscord | <konsumlamm> but `var table: Table[...]` also would've worked |
20:50:49 | FromDiscord | <haxscramper> But it should give you the best results wrt. to coloring, formatting etc |
20:51:23 | FromDiscord | <haxscramper> In reply to @konsumlamm "the empty "table" literal": not when the expression is part of another I believe |
20:51:52 | FromDiscord | <Ducko> Sorry to intrude, is this the best channel for support / help? |
20:52:01 | FromDiscord | <haxscramper> `let table = toTable({"123": {:}})` `Error: invalid type: 'empty' in this context: 'KeyValuePairSeq[system.string, array[0..-1, empty]]' for var` |
20:52:03 | FromDiscord | <haxscramper> In reply to @Ducko "Sorry to intrude, is": yes |
20:52:09 | FromDiscord | <konsumlamm> no, #offtopic is way better /s |
20:52:12 | FromDiscord | <Ducko> haha |
20:53:12 | FromDiscord | <konsumlamm> In reply to @haxscramper "`let table = toTable({"123":": well, that's type inference being bad though, not having an unexpected set literal |
20:53:32 | FromDiscord | <Ducko> sent a code paste, see https://play.nim-lang.org/#ix=3wdl |
20:53:39 | FromDiscord | <konsumlamm> In reply to @haxscramper "`let table = toTable({"123":": and it would still need the `.toTable` |
20:53:46 | * | nisstyre quit (Ping timeout: 240 seconds) |
20:53:49 | FromDiscord | <haxscramper> it is annoying when "no HM" described as "bad type inference" honestly |
20:54:04 | FromDiscord | <konsumlamm> independently of it being HM, it is bad imo |
20:54:10 | FromDiscord | <tandy> oh wow |
20:54:22 | FromDiscord | <tandy> i think i need to add an escape rule for this |
20:55:12 | FromDiscord | <Ducko> (edit) "https://play.nim-lang.org/#ix=3wdl" => "https://play.nim-lang.org/#ix=3wdm" |
20:55:45 | * | nisstyre joined #nim |
20:56:06 | FromDiscord | <Ducko> it seems to be still trying to use `clang` even though I specify to use mingw? unsure |
20:58:00 | FromDiscord | <Chiggy> @haxscramper thanks to your help, I have already reduced my code time from 2 minutes to 5 seconds. I appreciate your help a lot 😁 |
20:58:10 | arkanoid | thanks haxscramper |
20:58:28 | FromDiscord | <Chiggy> I will be finishing porting my program tom coz its 230am here and I gotta sleep now |
20:58:40 | FromDiscord | <Chiggy> (edit) "seconds." => "seconds ish." |
20:59:03 | FromDiscord | <haxscramper> In reply to @Ducko "it seems to be": I think you need to do `nimble -d:mingw build`. I don't remember how nimble handles flags exactly, so |
20:59:19 | FromDiscord | <haxscramper> Because `nim c -d:mingw for_windows.nim` for me correctly runs with `/usr/bin/x86_64-w64-mingw32-gcc` |
20:59:19 | FromDiscord | <Ducko> In reply to @haxscramper "I think you need": Same issue |
20:59:32 | FromDiscord | <Ducko> I have it instalel |
20:59:35 | FromDiscord | <Ducko> (edit) "instalel" => "installed" |
20:59:52 | FromDiscord | <Ducko> https://media.discordapp.net/attachments/371759389889003532/876933300499923014/unknown.png |
21:00:11 | FromDiscord | <Ducko> it just is still using `clang`? |
21:00:21 | FromDiscord | <Ducko> > Error: execution of an external compiler program 'clang |
21:00:41 | FromDiscord | <haxscramper> which nim version do you have? I Use 1.4.8 and `nim c -d:mingw test.nim` shows it is trying to use mingw |
21:01:12 | FromDiscord | <Ducko> sent a code paste, see https://paste.rs/xbF |
21:01:50 | FromDiscord | <haxscramper> and simple mingw hello world hasm the same issue? |
21:01:55 | FromDiscord | <Ducko> could it be my `nim.cfg`? |
21:02:01 | FromDiscord | <Ducko> I have `cc: "clang"` in it |
21:03:18 | FromDiscord | <Ducko> Well I have progress |
21:03:23 | FromDiscord | <haxscramper> yes, this affects configuration |
21:03:31 | FromDiscord | <Ducko> using this `$ nimble build -d:mingw --cc="gcc"` |
21:03:39 | FromDiscord | <Ducko> it now uses mingw |
21:03:51 | FromDiscord | <Ducko> but now I have errors in mingw internally? |
21:04:03 | FromDiscord | <Ducko> sent a code paste, see https://play.nim-lang.org/#ix=3wdo |
21:04:03 | * | stkrdknmibalz joined #nim |
21:04:26 | FromDiscord | <Ducko> it's trying to run `ld -z`? |
21:05:05 | FromDiscord | <haxscramper> https://forum.nim-lang.org/t/7803 okay, at least they had the same error |
21:05:46 | FromDiscord | <Ducko> > Try adding `--os:windows` |
21:06:08 | FromDiscord | <Ducko> And now I get a different error as it's trying to use normal `gcc` |
21:06:30 | FromDiscord | <haxscramper> whack-a-mole time |
21:07:00 | FromDiscord | <tandy> hmm that didnt solve my problem, i need to look into this more |
21:07:51 | FromDiscord | <Ducko> In reply to @haxscramper "whack-a-mole time": yeah I only have 2 errors lol |
21:09:38 | FromDiscord | <haxscramper> you can explicitly specify compilation path |
21:09:58 | FromDiscord | <Ducko> wdym? |
21:10:07 | FromDiscord | <haxscramper> https://nim-lang.github.io/Nim/nimc.html#crossminuscompilation |
21:10:12 | FromDiscord | <haxscramper> compiler path |
21:10:26 | FromDiscord | <Ducko> yeah I did that, same thing |
21:10:30 | FromDiscord | <haxscramper> and maybe run with `--skipParentCfg --skipProjectCfg` etc. |
21:11:01 | FromDiscord | <haxscramper> sent a code paste, see https://play.nim-lang.org/#ix=3wdr |
21:11:28 | FromDiscord | <Ducko> it compiles fine, then linking it dies |
21:11:57 | FromDiscord | <Ducko> sent a code paste, see https://play.nim-lang.org/#ix=3wds |
21:13:03 | FromDiscord | <Ducko> I think it's related to the args it's trying to pass to mingw-gcc? |
21:13:13 | FromDiscord | <Ducko> sent a code paste, see https://play.nim-lang.org/#ix= |
21:13:19 | FromDiscord | <Ducko> > `-z` `-z` |
21:13:32 | FromDiscord | <haxscramper> yes, but `-z` is known option for gcc linker |
21:13:38 | FromDiscord | <haxscramper> But maybe not for mingw |
21:13:56 | FromDiscord | <Ducko> yeah |
21:14:07 | FromDiscord | <haxscramper> You can try running `/usr/lib/gcc/x86_64-w64-mingw32/11.2.0/../../../../x86_64-w64-mingw32/bin/ld` manually and check whether it accepts options, syntax etc. |
21:14:24 | FromDiscord | <Ducko> trying to do that |
21:14:25 | FromDiscord | <haxscramper> Though docs say `-z keyword -z is passed directly on to the linker along with the keyword keyword. See the section in the documentation of your linker for permitted values and their meanings. ` |
21:17:10 | FromDiscord | <Ducko> In reply to @haxscramper "You can try running": can't find the file so hmm |
21:18:40 | FromDiscord | <Ducko> would these actually do anything important?↵> `-z,relro,-z,now` |
21:18:57 | FromDiscord | <haxscramper> idk, this is linker-specific |
21:19:13 | FromDiscord | <haxscramper> you can try without them, at least right now |
21:19:18 | FromDiscord | <Ducko> if I remove it, it compiles |
21:20:20 | FromDiscord | <haxscramper> ` -z now Marks the object to override the runtime linker's default mode and require non-lazy runtime binding. This is similar to adding the object to the process by using dlopen(3DL) with the RTLD_NOW mode, or setting the LD_BIND_NOW environment variable in effect. See ld.so.1(1).` |
21:21:20 | FromDiscord | <haxscramper> Anyway, I'm almost done for today, so |
21:21:55 | FromDiscord | <Ducko> fair enough |
21:22:04 | FromDiscord | <Ducko> getting someone to see if it works on win |
21:22:29 | FromDiscord | <tandy> how do you add a backslash to a string in nim? |
21:22:36 | FromDiscord | <tandy> i need it to escape a $ in a unix command |
21:23:56 | FromDiscord | <tandy> oh yeah you do double backslash |
21:24:07 | FromDiscord | <Ducko> In reply to @haxscramper "Anyway, I'm almost done": thanks! |
21:41:55 | arkanoid | I have two functions that calls each other. I tried adding code {.experimental: "codeReordering".} but it didn't work: Warning: Circular dependency detected. `codeReordering` pragma may not be able to reorder some nodes properely. What is the proper way to solve this? Forward declaration? |
21:42:23 | FromDiscord | <Elegantbeef> Yep |
22:25:08 | * | max22- quit (Quit: Leaving) |
22:47:07 | * | xet7 quit (Ping timeout: 245 seconds) |
22:54:15 | * | flynn quit (Read error: Connection reset by peer) |
22:55:23 | * | flynn joined #nim |
23:03:14 | madprops | can I use toTable and define the type? |
23:03:22 | madprops | [int64, string] |
23:05:02 | FromDiscord | <Elegantbeef> Yeswould be `{..}.toTable[: K, V]` |
23:05:03 | FromDiscord | <Elegantbeef> Yes would be `{..}.toTable[: K, V]` |
23:07:05 | madprops | what does the : mean ? |
23:07:32 | FromDiscord | <Elegantbeef> It's a way to override the `[]` so it knows it's generic arguements in MCS |
23:07:50 | FromDiscord | <Elegantbeef> Cause otherwise it's turned into `[](toTable({..})` |
23:08:34 | FromDiscord | <Elegantbeef> It's a simple/clean way to override the `[]` operator |
23:08:46 | madprops | wondering what's wrong here https://play.nim-lang.org/#ix=3wdK |
23:09:53 | FromDiscord | <Elegantbeef> The issue here is that the tuples are inferred separately so each one needs the `i64` written after the int literal |
23:10:08 | madprops | i see. thanks |
23:11:00 | FromDiscord | <Elegantbeef> This should be like an array though, so wonder if this can be fixed easily |
23:13:11 | NimEventer | New thread by Col: Html tags from template not being rendered, see https://forum.nim-lang.org/t/8332 |
23:18:08 | FromDiscord | <Elegantbeef> Atleast the devel error message is cleaner in this case mad, but yea this should be converted automatically |
23:27:18 | madprops | i see |
23:27:29 | madprops | maybe this is offtopic but I'm trying to convert some scala to nim |
23:27:30 | madprops | https://scastie.scala-lang.org/pgXjPxTxR5WnQaXBG8SEZg |
23:27:40 | madprops | wondering if I could do that |
23:27:50 | madprops | not sure what ".to(number)" is doing here |
23:28:01 | madprops | but it matches 100 for 120 for example |
23:28:07 | madprops | 1000 for 1200 |
23:28:37 | FromDiscord | <Elegantbeef> Yea i dont quite get it |