[pypy-dev] Delimited Continuations in PyPy?

Timothy Baldridge tbaldridge at gmail.com
Thu Aug 3 19:08:41 EDT 2017


I recently came across this paper:
https://www.microsoft.com/en-us/research/publication/implementing-algebraic-effects-c/

The gist is that they use setjmp/longjmp to create delimited continuations
in compliant C99.

It seems like this method is fairly close to what PyPy already does with
stacklets. Any reason why this couldn't be ported to PyPy? Of course
there'd have to be some sort of stack integration as with stacklets, but it
seems that that mostly boils down to making sure the GC has a way to trace
the bits of the stack contained in the continuations.

I'm considering trying my hand at using their library via rffi, and copying
what I need from _stacklet_shadowstack.py. But perhaps there's something
I'm missing that makes this a no-go from the start.


Thanks,

Timothy Baldridge
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/pypy-dev/attachments/20170803/64b8faaa/attachment.html>


More information about the pypy-dev mailing list