[Python-ideas] CPS transform for Python

Laurens Van Houtven _ at lvh.cc
Sat Nov 10 12:57:57 CET 2012


The README suggests that doing this optimization on a bytecode level may be
better than doing it on a source/AST level. Can you explain why?


On Sat, Nov 10, 2012 at 4:06 AM, Sam Rushing <
sam-pydeas at rushing.nightmare.com> wrote:

> The discussion last week with Greg Ewing got me to thinking about the
> CPS transform, and how it might be a useful technique for
> callback/event-driven code like asyncore & Twisted.  I'm pretty sure
> when I first thought about this eons ago it was before Python had
> closures.  They definitely make it a bit easier!
>
> I put some simple demo code together, I think it demonstrates that the
> idea is feasible, I'm curious to know if anyone is interested.
>
> Don't get hung up on the poor quality of the generated code, big
> improvements could be made with a little bit of work.
>
> https://github.com/samrushing/cps-python/
>
> -Sam
>
>
>
> _______________________________________________
> Python-ideas mailing list
> Python-ideas at python.org
> http://mail.python.org/mailman/listinfo/python-ideas
>
>


-- 
cheers
lvh
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/python-ideas/attachments/20121110/1ae8218d/attachment.html>


More information about the Python-ideas mailing list