!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
22 Mar 2024
@leorize-irc-bridge:envs.netFromIRC<Zevv> locals get lifted so memory localization is worse05:01:07
@leorize-irc-bridge:envs.netFromIRC<Zevv> and your code gets split into n little functions, so there are less assumptions the compiler can depend on05:01:49
@leorize-irc-bridge:envs.netFromIRC<Zevv> otoh: first measure05:02:19
@leorize-irc-bridge:envs.netFromIRC<Zevv> in practice, this has not yet hit me. tight inner loops that dont call out to CPS are left as they were05:03:05
@varriount_:matrix.orgvarriountI wonder if the compiler could support a kind of "optimizations API" that would allow CPS code generation to create iterators, and actually say "yes, these are only going to be run once, in-order".06:41:52
@varriount_:matrix.orgvarriountZevv: What are you currently using CPS for?06:42:38
@leorize-irc-bridge:envs.netFromIRC<Zevv> nothing, actually.06:58:19
@leorize-irc-bridge:envs.netFromIRC<Zevv> im not nimming at all. i just hang around here for the sick jokes and frgrancy of social awkwardness06:59:03
@leorize-irc-bridge:envs.netFromIRC<disruptek> varriount: which compiler.12:46:53
25 Mar 2024
@leorize-irc-bridge:envs.netFromIRC<emery_> yet another CPS dispatcher https://git.sr.ht/~ehmry/solo5_dispatcher17:08:13
@leorize-irc-bridge:envs.netFromIRC<emery_> I'm sitting on a Solo5 unikernel port for Nim, I can port it over to Nimskull as well17:08:40
@leorize-irc-bridge:envs.netFromIRC<emery_> still working out the bugs in the TCP stack17:09:39
@leorize-irc-bridge:envs.netFromIRC<disruptek> was it hard to do.17:10:10
@leorize-irc-bridge:envs.netFromIRC<emery_> not at all, solo5 just has timers and nonblocking read on ethernet devices to worry about, so it was a lot easier than trying to make it work with asyncdispatch17:17:11
@leorize-irc-bridge:envs.netFromIRC<disruptek> do you have any recommendations for how we should convey this to other users who are intimidated by the prospect of authoring a dispatcher.17:50:42
@leorize-irc-bridge:envs.netFromIRC<Zevv> yeah excellent question18:19:50
@leorize-irc-bridge:envs.netFromIRC<Zevv> the thing is, it *is* not hard to do.18:19:56
@leorize-irc-bridge:envs.netFromIRC<Zevv> we've made a dozen by now.18:20:01
@leorize-irc-bridge:envs.netFromIRC<Zevv> yours are complicated only because of the threading involved18:20:20
@leorize-irc-bridge:envs.netFromIRC<disruptek> we're obviously missing /something/.18:28:21
@leorize-irc-bridge:envs.netFromIRC<Zevv> people don't want to make dispatchers18:32:09
@leorize-irc-bridge:envs.netFromIRC<Zevv> they want ready made ones with documentation18:33:25
@saem:matrix.orgsaemMaybe the word dispatcher is scary, try calling it a run-loop or some more benign sounding thing.18:40:24
@leorize-irc-bridge:envs.netFromIRC<Zevv> CPS also sounds scary19:53:56
@leorize-irc-bridge:envs.netFromIRC<Zevv> cally it something fuzzy and warm19:54:11
@leorize-irc-bridge:envs.netFromIRC<Zevv> like 'monad' or something19:54:18
@leorize-irc-bridge:envs.netFromIRC<emery_> well initially I thought I was going to use a Continuation type from one library and then define my own for my application and do handoffs from one type to another, and choosing a dispatcher was a big deal20:21:58
@leorize-irc-bridge:envs.netFromIRC<emery_> but now I just think of CPS as some calling code later, with slightly different environment than a {.closure.}20:22:55
@leorize-irc-bridge:envs.netFromIRC<emery_> my syndicate library is ported over to nim-sys but I don't expose CPS through the library API, it's just used internally for scheduling20:24:31
@leorize-irc-bridge:envs.netFromIRC<emery_> in short, using the {.cps.} and {.cpsMagic.} in a few places is easier than allocating futures and setting callbacks on them20:25:52

Show newer messages


Back to Room ListRoom Version: 6