!WkVPhTZzbUBGGVSkoK:matrix.org

cps

35 Members
Nim CPS discussion room. Bridged to #cps on libera.chat. Please refrain from posting multi-line messages or images.6 Servers

Load older messages


SenderMessageTime
8 Mar 2024
@leorize-irc-bridge:envs.netFromIRC<disruptek> don't take our word for it, though. the impl is in user-land nim. if you want to see the differences in how they are implemented, you can literally compare the impls.22:04:33
15 Mar 2024
@noracat:nitro.chat@noracat:nitro.chat joined the room.12:36:31
@noracat:nitro.chat@noracat:nitro.chat left the room.12:36:47
17 Mar 2024
@yu-vitaqua-fer-chronos:beeper.comRobyn [She/Her]I believe Leorize talked about how my event system I made a while ago would be unnecessary with cps, but I'm not sure how exactly, could someone elaborate? https://github.com/Nimberite-Development/Pulse-Nim it has a basic example of how it works in the README20:43:35
@leorize:envs.netleorizemy comment was on how you were using them21:00:03
@leorize:envs.netleorizeiirc you were trying to dispatch read/write commands to an I/O thread then wait for a responding event21:01:42
@leorize:envs.netleorizeof which I commented that cps could render this obsolete because you can just move the "compute" to an another thread and unblock your current one, then resume once you're done21:02:14
@yu-vitaqua-fer-chronos:beeper.comRobyn [She/Her]
In reply to @leorize:envs.net
iirc you were trying to dispatch read/write commands to an I/O thread then wait for a responding event
Yeah
21:32:02
@yu-vitaqua-fer-chronos:beeper.comRobyn [She/Her]
In reply to @leorize:envs.net
of which I commented that cps could render this obsolete because you can just move the "compute" to an another thread and unblock your current one, then resume once you're done
Ah okay so then my event system is still important then? :P
21:32:33
18 Mar 2024
@leorize-irc-bridge:envs.netFromIRC<disruptek> if it works for you, keep using it. this is basically promises, which are naturally implemented in cps just as you experience them in js (which is cps under the covers).02:14:19
@leorize-irc-bridge:envs.netFromIRC<disruptek> if there's an advantage to doing it with cps, it's that all the metaprogramming of composing events and handlers and type-erasure is all performed for you by the cps transform. that's about it.02:15:16
21 Mar 2024
@yu-vitaqua-fer-chronos:beeper.comRobyn [She/Her]
In reply to @leorize-irc-bridge:envs.net
<disruptek> if there's an advantage to doing it with cps, it's that all the metaprogramming of composing events and handlers and type-erasure is all performed for you by the cps transform. that's about it.
My idea was to pass continuations across threads seeing as that's doable, which would let me push events that are supposed to happen on a specific thread (networking vs game updates)
22:28:57
@yu-vitaqua-fer-chronos:beeper.comRobyn [She/Her]Also, would Mummy + CPS make sense? I'm not too sure since I think it's using std/net under the hood so I wouldn't benefit from ioqueue, but maybe I'd still benefit from cps? But my understanding of cps is limited and I'm used to asyncdispatch and similar22:31:17
@disruptek:matrix.orgdisruptektake a look at Zevv’s actors.22:36:16
@disruptek:matrix.orgdisruptekif that doesn’t blow your mind, then you want my insideout project.22:36:42
@yu-vitaqua-fer-chronos:beeper.comRobyn [She/Her] # Wait for all the kids to finish, then kill the calculator hm... 22:47:56
@yu-vitaqua-fer-chronos:beeper.comRobyn [She/Her]Ah okay22:48:13
@yu-vitaqua-fer-chronos:beeper.comRobyn [She/Her]I think I understand22:48:17
@yu-vitaqua-fer-chronos:beeper.comRobyn [She/Her]Yeah okay I'm struggling to wrap my head around that, I'll probably end up tinkering with cps once I get a MVP23:18:58
@disruptek:matrix.orgdisruptekgo look at insideout/examples/telegram.nim23:22:00
@yu-vitaqua-fer-chronos:beeper.comRobyn [She/Her]That was what I was looking at23:38:10
@yu-vitaqua-fer-chronos:beeper.comRobyn [She/Her]It's probably a case of me using it myself and tinkering with the example to understand it23:39:01
@leorize-irc-bridge:envs.netFromIRC<disruptek> what is the app.23:39:30
@leorize-irc-bridge:envs.netFromIRC<disruptek> if you are coming from a web background, maybe phil's threadbutler appeals to your taste.23:40:08
@leorize-irc-bridge:envs.netFromIRC<disruptek> not a lot of asyncdispatch fans here, though, i'm afraid.23:40:33
@yu-vitaqua-fer-chronos:beeper.comRobyn [She/Her]
In reply to @leorize-irc-bridge:envs.net
<disruptek> if you are coming from a web background, maybe phil's threadbutler appeals to your taste.
I don't come from a web background, I've mostly tinkered on small projects here and there, currently I'm attempting to work on a chat server, I'll take a look at telegram.nim again once I've gotten a fresher head, maybe that'll help me to understand it more
23:48:08
@yu-vitaqua-fer-chronos:beeper.comRobyn [She/Her]
In reply to @leorize-irc-bridge:envs.net
<disruptek> not a lot of asyncdispatch fans here, though, i'm afraid.
To be fair, there is a reason I'm here and not using asyncdispatch, I'm looking into learning multithreading while still having the convinience that asyncdispatch or alternatives could provide me, and cps looks very versatile
23:49:26
22 Mar 2024
@leorize-irc-bridge:envs.netFromIRC<disruptek> what if it compiled faster but, like, you could only use it for coroutines.01:22:49
@varriount_:matrix.orgvarriountdisruptek: CPS looks really neat. I am curious though - doesn't the fact that any section of a continuation can be run more than once (or out of order, etc.) prevent compiler optimizations?02:59:03
@leorize-irc-bridge:envs.netFromIRC<Zevv> sure. even if you run it *in* order05:00:48

Show newer messages


Back to Room ListRoom Version: 6