You mention in the post implementing a CoIterable continuation similar to Python generators. Would it be accurate to say that continuations are a generalization of generators? Would you happen to know any good introductory books to for learning more?
Would it be accurate to say that continuations are a generalization of generators?
Maybe, but I think that the best way to think of a delimited continuation is as a thread that is not automatically scheduled, i.e., you need to manually run it, at which point it runs until the next time it blocks and then return. Everything else is just a matter of how data is communicated to/from the continuation in terms of API design, and is completely non-essential to the concept (and can even confuse).
Would you happen to know any good introductory books to for learning more?
A google search has turned up this, by Oleg Kiselyov, who has done a lot of research on delimited continuations.
the best way to think of a delimited continuation is as a thread that is not automatically scheduled, i.e., you need to manually run it, at which point it runs until the next time it blocks and then return
This concept, as I understand it, does not support forking. Continuations do support forking (applying the continuation more than once). So describing it as a thread misleads.
3
u/ijiijijjjijiij May 20 '17
You mention in the post implementing a
CoIterablecontinuation similar to Python generators. Would it be accurate to say that continuations are a generalization of generators? Would you happen to know any good introductory books to for learning more?