00:31:39 | FromDiscord | <sOkam! 🫐> In reply to @arnetheduck "or rather, the ideas": yeah that's what lead me to the wrong expectation, and therefore frustation when my hopes were shattered right after 😭↵But it's great to hear that you left room for customization in the codebase! that's really really great news, and a huge improvement over nimpretty just by itself. ty for that! |
00:32:32 | FromDiscord | <sOkam! 🫐> When I read that it has "no options" immediately assumed that you wouldn't have cared about leaving any option flexibility in there, and focused on making it as dead simple as possible. I guess I assumed wrong, great to hear |
00:33:35 | FromDiscord | <sOkam! 🫐> sent a code paste, see https://play.nim-lang.org/#ix=html> |
00:33:58 | FromDiscord | <sOkam! 🫐> (edit) |
01:10:42 | FromDiscord | <Elegantbeef> @sOkam! 🫐 I know it's not the same but `strscans` does provide an API that does sorta work here https://hatebin.com/ivdofuttam |
01:14:05 | FromDiscord | <sOkam! 🫐> its definitely not the same, agreed |
01:15:13 | FromDiscord | <Elegantbeef> I do think the strscans is a better approach as it does not use regex 😄 |
01:15:28 | FromDiscord | <sOkam! 🫐> I have used strscans a lot, though. its great for some tasks |
01:15:29 | FromDiscord | <Elegantbeef> Which means it's pluggable with captures |
01:16:08 | FromDiscord | <sOkam! 🫐> In reply to @Elegantbeef "I do think the": whats wrong about regex, other than the cR$yp1c:^ syntax? |
01:16:37 | FromDiscord | <Elegantbeef> It's slower and also does not have any parsing logic built in |
01:21:14 | FromDiscord | <Elegantbeef> Which means you cannot do like `line.scanf("$[skip(Letters)]:$i${either({'c', 'f'})} $+", temp, name)` where the input is like "Edmonton\:-10c Cloudy" |
01:21:52 | FromDiscord | <Elegantbeef> Guess that should be `temp, unit, name` |
01:23:03 | FromDiscord | <Elegantbeef> I mean regex is of course fine when all you're doing is searching, but if parsing is involved I think strscans is just more appropriate |
01:45:02 | * | antranigv_ is now known as antranigv |
02:18:28 | * | antranigv is now known as antranigv_ |
02:19:08 | * | antranigv_ is now known as antranigv |
03:35:45 | * | derpydoo quit (Ping timeout: 260 seconds) |
04:31:56 | FromDiscord | <Phil> I may need to take a dive into the dark arts again |
04:31:59 | FromDiscord | <Phil> untyped macros |
04:32:52 | FromDiscord | <Elegantbeef> Nah you don't need em |
04:38:39 | FromDiscord | <Phil> sent a code paste, see https://play.nim-lang.org/#ix=html> |
04:39:00 | FromDiscord | <Phil> (edit) |
04:39:33 | FromDiscord | <Phil> Note, neither of the actor macros generate code, they just collect it in macrocaches that is used when the generateCode() macro is called |
04:39:49 | FromDiscord | <Phil> Or rather that's the goal, I haven't implemented that syntax yet |
04:41:24 | FromDiscord | <Phil> The problem is mostly that you can't use the type of another actor in your handler before the other actor is defined, so I kinda need to have non-sem-checked code be the input so that I can reshape the code from all the actor macro calls into one where first all the message types get defined, and then all the handlers |
04:43:28 | FromDiscord | <Phil> sent a code paste, see https://play.nim-lang.org/#ix=html> |
04:43:54 | FromDiscord | <Phil> Anyway, the current approach feels less... "clean" from the mental model |
04:45:52 | FromDiscord | <Phil> sent a code paste, see https://play.nim-lang.org/#ix=html> |
04:46:09 | FromDiscord | <Phil> That might actually work out way nicer |
04:46:42 | FromDiscord | <Phil> ... How the fuck did you not even dunk on me and somehow the problem still got solved |
04:47:23 | FromDiscord | <Elegantbeef> Lol |
04:48:20 | FromDiscord | <Phil> Props to michaelb btw., he made me take a look at pony and their syntax for actor inspired very much how I restructured my own way of doing this |
04:50:15 | FromDiscord | <Phil> Wait, can I even do that with the nested stuff like this? |
04:51:28 | FromDiscord | <Elegantbeef> 1 master macro that emits any more macros and converts the DSL to something else |
04:51:30 | FromDiscord | <Phil> sent a code paste, see https://play.nim-lang.org/#ix=html> |
04:51:52 | FromDiscord | <Elegantbeef> Correct you need to change it from untyped to valid macro calls chained |
04:52:16 | FromDiscord | <Phil> So I'd need macros "messageTypes" and "handlers" ? |
04:52:34 | FromDiscord | <Elegantbeef> Not really |
04:52:48 | FromDiscord | <Elegantbeef> You call them anything and just unpack `messageTypes` and `handlers` to what you want |
04:56:11 | FromDiscord | <Phil> sent a code paste, see https://play.nim-lang.org/#ix=html> |
04:56:34 | FromDiscord | <Elegantbeef> `typed` will expand all the code so not what you want likely |
04:58:02 | FromDiscord | <Phil> How so? |
04:58:47 | FromDiscord | <Phil> Ah you mean it'll expand macros which may cause problems |
04:58:58 | FromDiscord | <Phil> it'll expand macros used inside of handlers |
04:59:26 | FromDiscord | <Elegantbeef> `echo body.treeRepr` inside `actor` |
04:59:54 | FromDiscord | <Phil> That's one big tree |
05:00:10 | FromDiscord | <Elegantbeef> Is it empty? |
05:00:38 | FromDiscord | <Phil> No because I added "return body" to the "handlers" macro ^^ |
05:00:48 | FromDiscord | <Phil> Which means it returns the handler-procs in a stmtlist |
05:00:58 | FromDiscord | <Phil> inside of actor I mean |
05:01:15 | FromDiscord | <Phil> sent a code paste, see https://play.nim-lang.org/#ix=html> |
05:05:28 | FromDiscord | <Elegantbeef> The issue will be doesn't `messageTypes` introduce `Request` in the future? |
05:05:44 | FromDiscord | <Elegantbeef> IE when you run `generateCode` |
05:05:48 | FromDiscord | <Elegantbeef> The awfully named macro |
05:06:16 | FromDiscord | <Phil (he/him)> The inbox for naming suggestions is still open \:-D |
05:06:40 | FromDiscord | <Elegantbeef> well it's called actors so `action` is a grand name 😛 |
05:07:07 | FromDiscord | <Phil (he/him)> As for Request, the only reason that section needs to even exist is to be able to generate an object variant out of all of them |
05:07:31 | FromDiscord | <Elegantbeef> Right but doesnt `actor` introduce `Request` in real code |
05:08:14 | FromDiscord | <Phil (he/him)> Define what you mean by real code.↵Code inside of a handler proc?↵Or a proc defined outside of actor that gets called by a handler proc? |
05:08:26 | FromDiscord | <Elegantbeef> I mean in a real application |
05:08:40 | FromDiscord | <Elegantbeef> What is the purpose of `messageTypes`? |
05:09:31 | FromDiscord | <Phil (he/him)> Allows me to generate an object variant to wrap data in and send through a Channel↵Where I promptly unwrap the object variant with a generated switch-case statement that calls the corresponding handler |
05:10:25 | FromDiscord | <Phil (he/him)> Other actors will also need to use `Request`, but that is why I jumped to types needing to be defined in a separate file\: They can import that file for usage |
05:10:31 | FromDiscord | <Elegantbeef> Right but why does that block exist? |
05:14:14 | FromDiscord | <Phil (he/him)> Honestly it doesn't have to, just the handlers could do it and I just analyze the type of the first parameter. But I like the explicitness of it |
05:14:16 | FromDiscord | <Elegantbeef> Arent the handlers always `msg: MessageType, hub: ChannelHub` |
05:14:18 | FromDiscord | <Elegantbeef> Ok |
05:14:19 | FromDiscord | <Elegantbeef> Seems like a source of error |
05:14:21 | FromDiscord | <Phil (he/him)> I mean we can definitely have a debate about whether that makes sense to have, imo having a section of "This is what I accept, below how I deal with each of these" seems nice |
05:14:23 | FromDiscord | <Phil (he/him)> And yeah, would be a potential source of compiletime errors if you add a type in messagetypes and forget to provide a handler for it (or have a handler for a not previously defined type) |
05:14:24 | FromDiscord | <Elegantbeef> I'd probably just do a proc macro and have `{.actor: X.}` like a numpty 😄 |
05:14:26 | FromDiscord | <Elegantbeef> But anyway I'll shush |
05:14:28 | FromDiscord | <Elegantbeef> you do you and all you want |
05:34:55 | FromDiscord | <Phil> Hmm looking through it for more actor related libs to see if I'm reinventing the wheel.↵I'm spotting synthesis and syndicate-nim↵https://git.syndicate-lang.org/ehmry/syndicate-nim |
05:35:41 | FromDiscord | <Phil> And https://github.com/mratsim/Synthesis |
05:41:42 | FromDiscord | <Phil> ... While I appreciate that there are docs and that the repo of syndicate-nim and that the wording is trying to go for correctness↵> The Ref is something that we can observe and publish assertions at, and a Turn is special type for temporal scoping and transactional semantics.↵↵My eyes glazed over at half the sentence consisting of not-that-simple technical terms |
05:42:13 | FromDiscord | <Phil> (edit) "... While I appreciate that there are docs and that the repo of syndicate-nim ... and" added "exists" |
05:44:09 | FromDiscord | <Phil> I mean, I get it after breaking the sentence down for a hot minute, but that was not an easy sentence to digest |
05:52:20 | FromDiscord | <Elegantbeef> Remember you should dump a spoonful on your eyes to make the medicine go down |
05:58:38 | FromDiscord | <Phil> Okay I may be reinventing the wheel but at least I'll get the mental model of that wheel |
06:00:27 | FromDiscord | <Phil> I'm almost 100% certain that I'm not deep enough in the material to understand how it benefits me, but for what I want to achieve the syntax and mental model requested seems a bit much |
06:05:15 | FromDiscord | <michaelb.eth> In reply to @Elegantbeef "Remember you should dump": never put salt in your eyes |
06:05:42 | FromDiscord | <Elegantbeef> Anything is better than reading Phils messages |
06:06:29 | FromDiscord | <michaelb.eth> https://www.youtube.com/watch?v=_83MEuLoz9Y |
06:18:25 | * | rockcavera quit (Remote host closed the connection) |
07:51:01 | FromDiscord | <Phil> TFW I just innocently type messages and get slandered in return! |
07:56:14 | * | antranigv is now known as antranigv_ |
07:56:31 | * | antranigv_ is now known as antranigv |
07:58:31 | FromDiscord | <Elegantbeef> You now what you did wrong |
08:01:26 | * | PMunch joined #nim |
08:03:34 | FromDiscord | <Phil> I don't this time in fact |
08:04:30 | FromDiscord | <Elegantbeef> Who are you?? |
08:04:39 | PMunch | Who who |
08:05:07 | FromDiscord | <Elegantbeef> Oh yay the owls have awoken |
08:05:11 | NimEventer | New thread by Duboak: Parallelism in Nim: trying to call proc with my argument, see https://forum.nim-lang.org/t/10796 |
08:05:29 | PMunch | Haha |
09:05:24 | * | antranigv is now known as antranigv_ |
09:05:42 | * | antranigv_ is now known as antranigv |
09:10:27 | * | antranigv is now known as antranigv_ |
09:10:51 | * | antranigv_ is now known as antranigv |
09:37:51 | * | antranigv is now known as antranigv_ |
09:49:03 | * | jmdaemon quit (Ping timeout: 256 seconds) |
10:39:50 | PMunch | Damn it.. walkDirRec with {pcDir} only return directories with no further directories in them |
10:42:10 | madprops | walk_dir_rec |
10:42:16 | madprops | oh |
10:46:45 | * | junaid_ joined #nim |
10:54:03 | * | antranigv_ is now known as antranigv |
10:54:07 | * | antranigv is now known as antranigv_ |
11:31:27 | * | junaid_ quit (Remote host closed the connection) |
12:24:24 | FromDiscord | <gogolxdong666> Is there any way to reverse json array in Nim |
12:29:02 | FromDiscord | <Phil> In reply to @gogolxdong666 "Is there any way": Parse into nim array, invert, parse back to JSON? |
12:29:09 | FromDiscord | <Phil> Well, nim seq, not array |
13:03:16 | FromDiscord | <gogolxdong666> sent a code paste, see https://play.nim-lang.org/#ix=html> |
13:04:04 | FromDiscord | <gogolxdong666> (edit) |
13:04:41 | FromDiscord | <gogolxdong666> (edit) |
13:05:49 | FromDiscord | <gogolxdong666> compared with `transactions[(page-1)pageSize..pagepageSize]` |
13:25:06 | * | rockcavera joined #nim |
13:58:27 | PMunch | wtf.. |
13:58:29 | PMunch | This is really weird |
13:59:17 | PMunch | I've got this code in my config.nims: https://paste.rs/Y4vsX.txt |
13:59:52 | PMunch | I can see it echo out all the folders just fine. But it fails because it can't find some header files and looking at the command it fails with not all the files that where listed out are present |
13:59:55 | PMunch | But some of them are.. |
14:00:13 | PMunch | So `switch("passC", importDir)` only sometimes adds the statement.. |
14:13:33 | PMunch | Anyone knows what's going on here? |
14:15:38 | PMunch | Hmm, strange. Now I tried to pass it manually and it still doesn't take |
14:28:07 | * | azimut quit (Ping timeout: 240 seconds) |
14:32:52 | FromDiscord | <srabb> happy holidays everyone |
14:32:59 | FromDiscord | <Phil> I don't do anything with switches |
14:33:10 | FromDiscord | <Phil> ~~For good reason~~ |
14:33:44 | PMunch | Try saying that to microcontroller programming.. |
14:33:57 | PMunch | @srabb, happy holidays! |
14:34:15 | FromDiscord | <Phil> I mean I tend to be able to get around everything by having a bajillion nimble tasks and explicit exec statements |
14:34:26 | FromDiscord | <srabb> In reply to @PMunch "<@1111512879049490514>, happy holidays!": :) |
14:34:38 | FromDiscord | <Phil> In reply to @srabb "happy holidays everyone": Happy holidays, though its still a bit 😉 |
14:35:22 | FromDiscord | <maker_of_mischief> What's the best way to store many strings at once for caching purposes? |
14:35:55 | FromDiscord | <maker_of_mischief> I'm trying to balance ease of use for me and memory use for user |
14:36:51 | FromDiscord | <Phil> Without having done any benchmarks or deeper analysis on the topic:↵Storing in a seq.↵Index access is afaik always the fastest thing |
14:37:01 | FromDiscord | <Phil> Regard the index on the seq as an "id" for the string |
14:40:53 | PMunch | Regarding memory use it would probably be some kind of in-memory LZ77 |
14:59:31 | PMunch | @nnsee, now the JSON file system can create new files and folders! https://github.com/PMunch/libfuse-nim/ |
14:59:41 | PMunch | Can currently actually be used to edit JSON with :P |
15:00:45 | PMunch | You can get some input from a program, mount it as a filesystem, change it however you like (with some limitations) and on unmount it will print out the JSON to stdout |
15:01:41 | PMunch | The limitations are basically that all values are tried to be parsed as JSON. So it's not possible to have a string key with the value 100 for example, that would be converted to an integer. |
15:02:03 | PMunch | And you can't write a non-numbered file to an array, and you have to write the files in order |
15:02:23 | PMunch | And there is no way to create empty arrays, all empty folders are empty objects |
15:03:16 | * | PMunch quit (Quit: Leaving) |
15:05:33 | FromDiscord | <Chronos [She/Her]> Python feels so odd to use now that I've been using Nim for ages |
15:09:09 | FromDiscord | <rakgew> when switching back, I am frequently missing ucs in python land.. \:-D |
15:09:40 | FromDiscord | <Clonkk> UCS and case insensitive are so good once you're used to it |
15:10:05 | FromDiscord | <rakgew> fully agree! |
15:10:15 | FromDiscord | <Chronos [She/Her]> In reply to @rakgew "when switching back, I": Same though |
15:12:01 | FromDiscord | <Chronos [She/Her]> In reply to @Clonkk "UCS and case insensitive": I can live without case insensitivity tbh, but it is nice to have |
15:13:43 | FromDiscord | <Chronos [She/Her]> UCS is very nice though |
15:22:27 | FromDiscord | <Clonkk> Yeah case insensitivity can be solved by a good auto completion on an IDE↵(@Chronos [She/Her]) |
15:26:06 | FromDiscord | <Chronos [She/Her]> In reply to @Clonkk "Yeah case insensitivity can": Definitely |
15:38:40 | * | azimut joined #nim |
15:45:41 | Amun-Ra | I often start writing in python with "proc main() =" |
15:54:23 | * | derpydoo joined #nim |
15:58:42 | FromDiscord | <odexine> Hey I mean it’s just a difference of a keyword and a character/operator |
16:00:07 | * | azimut quit (Ping timeout: 240 seconds) |
16:01:18 | * | azimut joined #nim |
16:03:14 | Amun-Ra | mhm |
16:18:23 | FromDiscord | <Chronos [She/Her]> In reply to @odexine "Hey I mean it’s": I'm using classes |
16:18:45 | FromDiscord | <Chronos [She/Her]> And also I keep forgetting to not do `let`/`var`/`const` :P |
16:19:01 | FromDiscord | <Chronos [She/Her]> I'm also using explicit type annotations out of familiarity |
16:24:18 | FromDiscord | <odexine> In reply to @chronos.vitaqua "I'm using classes": I mean to Amun |
16:25:50 | FromDiscord | <Chronos [She/Her]> ah |
16:27:42 | FromDiscord | <Chronos [She/Her]> Honestly I heavily prefer & for concat instead of +, ngl |
16:32:03 | FromDiscord | <Phil> Hmmm what's a good nimnode that'll let me keep a symnode to a typedesc around but still compile |
16:44:17 | FromDiscord | <griffith1deadly> love new inline hints https://media.discordapp.net/attachments/371759389889003532/1187797769977598033/image.png?ex=659831e0&is=6585bce0&hm=be3c84c15a8b8729bde2d1eb7b014c363a07fcfe1dd291bbf12ffadc244b16e2& |
16:44:22 | FromDiscord | <Chronos [She/Her]> In reply to @isofruit "Hmmm what's a good": Elaborate? :p |
16:46:21 | FromDiscord | <Phil> sent a code paste, see https://play.nim-lang.org/#ix=html> |
16:46:40 | FromDiscord | <Phil> to be typed |
16:47:40 | FromDiscord | <Chronos [She/Her]> Ah then I have no idea :p |
16:50:59 | FromDiscord | <piqueiras> you know you're doing weird stuff when "generic methods are deprecated [Deprecated]" |
16:52:43 | FromDiscord | <piqueiras> cause if i have a class Father with subclasses Child1,Child2,Child3 with some different attributes |
16:52:53 | FromDiscord | <piqueiras> i gotta do a cmp for each combination?? |
17:00:04 | FromDiscord | <Phil> Going untyped may just be easier =/ |
17:03:27 | FromDiscord | <piqueiras> xD |
17:03:43 | FromDiscord | <piqueiras> with which approach |
17:03:53 | FromDiscord | <Phil> Ah sorry, was that stating more regarding my own problem |
17:04:01 | FromDiscord | <Phil> I was stating that |
17:04:17 | FromDiscord | <Phil> Yours would be one where I'd look into not using inheritance and rather object variants tbh |
17:04:49 | FromDiscord | <Phil> Basically the non-inheritance way.↵If that's not an option I'd like into generating the methods via macro with quote-do |
17:05:13 | FromDiscord | <Phil> or rather genAst since that's supposedly better 😄 |
17:07:02 | FromDiscord | <piqueiras> huh |
17:07:06 | FromDiscord | <piqueiras> hows object variants |
17:07:28 | FromDiscord | <piqueiras> i mean im doing AoC trying to add some weird language stuff every day dont mind inefficiency or so |
17:08:14 | FromDiscord | <piqueiras> In reply to @piqueiras "hows object variants": oooh |
17:08:28 | FromDiscord | <Phil> I mean, for splitting out scenario-subtypes with their own logic inheritance uses methods and knowing the subclass at runtime, object variants use gigantic switch-cases which are definitely more verbose |
17:08:36 | FromDiscord | <piqueiras> ooooh https://media.discordapp.net/attachments/371759389889003532/1187803891128074340/image.png?ex=65983793&is=6585c293&hm=885ba02f9d3f1e33ca2d33888b08e4101fd407ba0438ddbe398ab4ac8c5be7f4& |
17:10:13 | FromDiscord | <piqueiras> cause this does some.. weird things https://media.discordapp.net/attachments/371759389889003532/1187804298701189140/image.png?ex=659837f5&is=6585c2f5&hm=3e1f29240555116124bc88d9783aed71b104ec9f38f15dff7d6f5bbb3f8b7fa6& |
17:19:57 | FromDiscord | <piqueiras> why does it not magically work |
17:21:27 | FromDiscord | <piqueiras> https://media.discordapp.net/attachments/371759389889003532/1187807123443290132/image.png?ex=65983a96&is=6585c596&hm=624ec559e84391092adb51953bfb2d1551b3b5a4e4bdf8a4f511cb4cb0209730& |
17:34:13 | FromDiscord | <alohaer> I don’t know your familiarity with nim but I think you need to pass a compiler flag. —multimethods:on or close to |
17:35:28 | FromDiscord | <piqueiras> huh |
17:44:28 | FromDiscord | <piqueiras> okay i think it works |
17:59:45 | FromDiscord | <odexine> Multi methods are deprecated in Nim |
17:59:52 | FromDiscord | <odexine> IIRC |
18:02:58 | FromDiscord | <piqueiras> yea |
18:03:05 | FromDiscord | <piqueiras> since like 0.20 |
18:03:22 | FromDiscord | <piqueiras> i should not be doing this but its working |
18:04:03 | FromDiscord | <piqueiras> it just crossed my mind that instead of tuple with x,y,z:Slice[int] I could have fun with inheritance |
18:09:39 | * | antranigv_ is now known as antranigv |
18:13:57 | Amun-Ra | I've not used method even once yet |
18:40:35 | FromDiscord | <albassort> kinda makes me sad that the language i know most about is a language my job interviewers go "so you wrote that in uh... Nim?" |
18:41:08 | FromDiscord | <albassort> "can you do that in c"# |
18:41:10 | FromDiscord | <albassort> (edit) "c"#" => "c3"" |
18:41:13 | FromDiscord | <albassort> (edit) "c3"" => "c<#null>" |
18:41:19 | FromDiscord | <albassort> (edit) "c<#null>" => "d#>" |
18:41:23 | FromDiscord | <albassort> (edit) "d#>" => "C<#null>" |
18:41:26 | FromDiscord | <albassort> ?????? |
18:41:46 | FromDiscord | <albassort> (edit) "C<#null>" => "C.#" |
18:42:14 | FromDiscord | <albassort> you cant write csharp anyore |
18:42:18 | FromDiscord | <albassort> (edit) "anyore" => "anymore" |
18:46:51 | * | Lord_Nightmare quit (Quit: ZNC - http://znc.in) |
18:49:58 | * | Lord_Nightmare joined #nim |
19:12:00 | FromDiscord | <Phil> sent a code paste, see https://play.nim-lang.org/#ix=html> |
19:12:09 | FromDiscord | <Phil> (edit) |
19:12:56 | FromDiscord | <Phil> Also maybe rename actor to threadServer |
19:16:37 | FromDiscord | <odexine> therver |
19:17:02 | FromDiscord | <Phil> I mean, it's called threadbutler.↵Could call it "butler" |
19:17:07 | FromDiscord | <Phil> But I doubt that makes sense for anyone |
19:17:50 | FromDiscord | <odexine> threaver |
19:18:27 | FromDiscord | <odexine> threadler |
19:18:44 | FromDiscord | <odexine> thrutler |
19:20:46 | FromDiscord | <maker_of_mischief> sent a code paste, see https://play.nim-lang.org/#ix=html> |
19:21:26 | FromDiscord | <Phil> I mean you, you get a future back right? |
19:21:29 | FromDiscord | <Phil> Can check future.finished |
19:21:30 | FromDiscord | <maker_of_mischief> yeah |
19:21:31 | FromDiscord | <maker_of_mischief> oh |
19:21:46 | FromDiscord | <Phil> That's how `waitFor` works |
19:22:13 | FromDiscord | <Phil> That while-loops against future.finished, polling against the async-dispatcher over and over again |
19:22:17 | FromDiscord | <odexine> There’s a lot of ways to express what you want |
19:22:24 | FromDiscord | <Phil> (edit) "That" => "That's a" |
19:22:35 | FromDiscord | <Phil> (edit) "That's a while-loops against future.finished, polling against the async-dispatcher over and over again ... " added "until future.finished is true" |
19:23:53 | FromDiscord | <maker_of_mischief> sent a code paste, see https://play.nim-lang.org/#ix=html> |
19:24:02 | FromDiscord | <odexine> No |
19:24:04 | FromDiscord | <maker_of_mischief> (edit) |
19:24:25 | FromDiscord | <Phil> Got to put poll in that loop as well |
19:24:36 | FromDiscord | <odexine> No |
19:24:44 | FromDiscord | <Phil> What, yes? Literally waitfor |
19:24:55 | FromDiscord | <maker_of_mischief> what im doing is running a TUI and getting key inputs in that loop |
19:25:18 | FromDiscord | <odexine> packetFut = ws.receivePacket()↵while not packetFut.finished:↵ ...↵packet = await packetFut |
19:25:29 | FromDiscord | <maker_of_mischief> In reply to @odexine "packetFut = ws.receivePacket() while": thanks |
19:25:30 | FromDiscord | <Phil> Ahh, missed the await at the start |
19:25:49 | FromDiscord | <odexine> Add lets or vars as appropriate |
19:26:00 | FromDiscord | <Phil> But you still have to poll otherwise your future is never getting worked on, no? |
19:26:07 | FromDiscord | <maker_of_mischief> yeah |
19:26:09 | FromDiscord | <odexine> Plus you need to await in the loop |
19:26:22 | FromDiscord | <Phil> It ain't going to set itself to finished |
19:26:47 | FromDiscord | <odexine> In reply to @isofruit "It ain't going to": It will if you give the dispatcher back control... By yielding/awaiting |
19:27:25 | FromDiscord | <maker_of_mischief> sent a code paste, see https://play.nim-lang.org/#ix=html> |
19:27:26 | FromDiscord | <odexine> A simple await sleepAsync(some time) would work |
19:27:31 | FromDiscord | <maker_of_mischief> (edit) |
19:27:40 | FromDiscord | <maker_of_mischief> (edit) |
19:28:20 | FromDiscord | <odexine> In reply to @isofruit "But you still have": I would recommend never polling when in an async proc, pretty much dont need to ever if my assumptions are correct |
19:28:22 | FromDiscord | <Phil> That requires an async proc |
19:28:44 | FromDiscord | <odexine> Yes, and since theres already an await it is safe to assume that … |
19:28:46 | FromDiscord | <Phil> In reply to @odexine "I would recommend never": I mean I agree, but there was no mention he's in an async proc |
19:29:25 | FromDiscord | <Phil> I mean, are you @maker_of_mischief ? In an async proc I mean |
19:29:27 | FromDiscord | <maker_of_mischief> In reply to @isofruit "I mean I agree,": i am |
19:30:08 | FromDiscord | <Phil> In that case await is the way to go, the caller of the proc will need to take care of doing the async-dispatcher work somehow |
19:30:28 | FromDiscord | <odexine> Easiest is just to wait for, or run forever |
19:30:33 | FromDiscord | <odexine> Depending on what you want to do |
19:30:45 | FromDiscord | <odexine> I’ve virtually never needed to run poll manually |
19:33:34 | FromDiscord | <odexine> I have to sleep now, good bye |
19:41:41 | FromDiscord | <_goel_> How do you get the memory adress of a pointer? Using with `echo repr p` just shows `ptr x`↵I mean the usual visual rapresentation like in C++ `0xc000018030` |
19:42:25 | FromDiscord | <_goel_> (edit) "x`↵I" => "p`↵I" |
19:43:13 | FromDiscord | <Phil> Honestly I typically just cast to uint64, for the classic representation you'll likely need to transform that uint64 a bit |
19:43:33 | FromDiscord | <Phil> Or cast maybe to 8 bytes and encode in hex? |
19:43:40 | FromDiscord | <_goel_> I'll try |
19:48:13 | NimEventer | New thread by CardealRusso: Binaries does not correctly display dependencies, see https://forum.nim-lang.org/t/10798 |
20:03:05 | FromDiscord | <albassort> sent a code paste, see https://play.nim-lang.org/#ix=html> |
20:03:25 | FromDiscord | <albassort> What is an actor. |
20:03:51 | FromDiscord | <albassort> Is this a 2.0 thing |
20:04:03 | FromDiscord | <Phil> Essentially a single thread with a while loop inside of which it fetches and processes messages from a channel and runs its own async loop |
20:04:06 | FromDiscord | <Phil> Nope |
20:04:24 | FromDiscord | <Phil> Custom DSL on my end that I'm working on |
20:04:37 | FromDiscord | <Phil> Well, "DSL" |
20:04:44 | FromDiscord | <albassort> Ah that sounds useful you should publish that |
20:05:16 | FromDiscord | <albassort> Infact I think I can use that for mouse code |
20:05:17 | FromDiscord | <Phil> It's pretty much mid-work.↵I have the general concept down, just trying to figure out the frontend to be in a manner that I like |
20:05:42 | FromDiscord | <albassort> Code that monitors the mouse independently, in my IME. |
20:06:30 | FromDiscord | <Phil> Pretty much have got a first pre-alpha version including docs and nimibook docs and 5-6 examples, I'm in the process of overhauling its current syntax and adding support for tasks so you can inside of a thread just spawn a new thread and have it send you a message back with its results when its done |
20:06:31 | FromDiscord | <albassort> I think its just a loop that connects to xcb that sets a bool n the shared heap |
20:06:44 | FromDiscord | <albassort> (edit) "bool" => "type" | "typen the shared heap ... " added "for every click" |
20:07:03 | FromDiscord | <albassort> I could use that and remove the shared value and make it safer |
20:07:16 | FromDiscord | <albassort> For example. |
20:07:43 | FromDiscord | <Phil> Basically give me a couple weeks to polish it to not be hot garbage |
20:09:10 | FromDiscord | <Phil> Particularly since nothing of it is tested yet |
20:09:24 | FromDiscord | <Phil> Just functional examples |
20:55:24 | FromDiscord | <Phil> Man I need a good metaphor.↵Like, naming these things threadservers, you then define threadservers, prepare them and then you can init and run them.↵In terms of metaphor for wording that's... I mean it's workable, but not particularly great or memorable or intuitive |
20:55:33 | FromDiscord | <Phil> Namings things is hard |
20:56:16 | FromDiscord | <Phil> (edit) "Namings" => "Naming" |
20:59:04 | FromDiscord | <0ffh> In reply to @isofruit "Naming things is hard": The second of the two hard things, iirc. |
20:59:37 | FromDiscord | <Phil (he/him)> I know the quote but forgot what the other thing was |
20:59:46 | FromDiscord | <Phil (he/him)> I'mma just bet on concurrency since that's hard as balls |
21:00:14 | FromDiscord | <0ffh> In reply to @Phil (he/him) "I know the quote": The two things are cache invalidation, naming things, and off-by-one errors. |
21:01:08 | FromDiscord | <0ffh> (Though the last one is a jokular later addition...) |
21:24:26 | FromDiscord | <nnsee> In reply to @PMunch "<@961485620075720734>, now the JSON": very nice! |
21:25:22 | FromDiscord | <nnsee> In reply to @maker_of_mischief "i am": yo, is that a goddamn i n t e r f a c e reference |
21:25:39 | FromDiscord | <maker_of_mischief> In reply to @nnsee "yo, is that a": hell yeah |
21:25:46 | FromDiscord | <maker_of_mischief> another fellow interface fan |
21:26:10 | FromDiscord | <nnsee> interface was really good. i like all of umami's stuff |
21:26:38 | FromDiscord | <maker_of_mischief> hard for for humanity was really good |
21:26:39 | FromDiscord | <nnsee> have been following him since lmao the mcdonalds clown car video |
21:26:50 | * | koperak joined #nim |
21:26:50 | FromDiscord | <maker_of_mischief> (edit) "for" => "fork" |
21:27:28 | FromDiscord | <maker_of_mischief> he even got picked up by adult swim for some stuff |
21:28:55 | FromDiscord | <maker_of_mischief> Is there a method to poll if a Future is finished? |
21:32:15 | FromDiscord | <Phil> Poll (either by calling directly or through stuff that calls it like waitfor) is the thing that finishes the future, so kinda no 😄↵You can reduce the time given to block though. |
21:33:25 | FromDiscord | <Phil> Note that you you're likely better off using waitfor or similar.↵Poll is mostly useful if you need to set up your own event loop for an entire thread |
21:36:09 | FromDiscord | <systemonia> Been thinking quite a lot about this issue https://github.com/nim-lang/Nim/issues/23058 and the best way to solve it. The easiest way would be to define a `remoteInstall` boolean when installing anything non-local and to just check for its existence (or lack thereof) |
21:36:26 | FromDiscord | <systemonia> The only thing stopping me is that the nimble test suite is giving me an error about lock files. |
21:37:02 | FromDiscord | <systemonia> I wanna fix that ideally before I submit my PR to the nimble repo. |
21:46:17 | FromDiscord | <Phil> In reply to @pengwyns "Been thinking quite a": I feel like this issue is kinda missing a section explaining the benefit |
21:47:33 | FromDiscord | <systemonia> Im not sure either, I can only speculate. But this looked easy to implement. |
21:47:44 | FromDiscord | <systemonia> And I want to close down one more issue |
21:48:05 | FromDiscord | <Phil> Not that it's not valid, just before proposing something you typically first have a pitch to sell them on it😄 |
21:48:38 | FromDiscord | <Phil> Fair |
21:48:42 | FromDiscord | <Phil> Hm |
21:49:11 | FromDiscord | <systemonia> Im gonna ask them about it, I hope its something worth working on and not just a thing that can be solved easily. |
21:58:20 | * | koperak quit (Remote host closed the connection) |
22:06:30 | * | koperak joined #nim |
22:08:14 | * | koperak quit (Remote host closed the connection) |
22:35:40 | FromDiscord | <Phil> Man, I wonder why my async proc doesn't properly work on my client thead, and why awaiting is eternally blocking |
22:36:09 | FromDiscord | <Phil> Right up until realizing that I'm working in an example where the client has a custom-loop for which I did not include a poll-call which would make async functional |
22:58:00 | * | tiorock joined #nim |
22:58:00 | * | tiorock quit (Changing host) |
22:58:00 | * | tiorock joined #nim |
22:58:00 | * | rockcavera is now known as Guest9372 |
22:58:00 | * | Guest9372 quit (Killed (cadmium.libera.chat (Nickname regained by services))) |
22:58:00 | * | tiorock is now known as rockcavera |
23:01:49 | * | derpydoo quit (Ping timeout: 256 seconds) |