Do whatever's needed to get CPS (existing implementation 
<https://github.com/disruptek/cps> ) into the core+stdlib. If this requires a 
small breaking change, it's probably worth it;. CPS is incredibly useful for 
introspection, async, suspend to disk, migration between threads, migration 
between machines, millions of connections, logical-in-process-"fork", gluing 
with other languages, etc.

@disruptek built something that does a CPS transformation on (essentially any) 
Nim code, and then implements on top of that: try/catch, iterators, coroutines, 
"goto", and a bumch of other things with very short and simple implementations 
(tiny fractions of what it would take to implement them each on their own) and 
all at the user level (and without any backend-specific features).

I recommend reading @disruptek 's doc, code and examples, and NOT look at 
Wikipedia/Matt Might's description/whatever google gives you. It's not that 
they are not wrong, but they are more often than not "can't see the forest for 
the trees". (and, in most cases, are complicated by the lack of facilities in 
the languages)

Reply via email to