Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.python > #93837

Re: Possibly Pythonic Tail Call Optimization (TCO/TRE)

From Mark Lawrence <breamoreboy@yahoo.co.uk>
Subject Re: Possibly Pythonic Tail Call Optimization (TCO/TRE)
Date 2015-07-15 01:14 +0100
References <mailman.460.1436783918.3674.python-list@python.org> <lf5twt8mhec.fsf@ling.helsinki.fi> <mo1f4q$3fa$1@ger.gmane.org> <mo46l7$3nd$1@ger.gmane.org>
Newsgroups comp.lang.python
Message-ID <mailman.517.1436919290.3674.python-list@python.org> (permalink)

Show all headers | View raw


On 15/07/2015 00:40, Mark Lawrence wrote:
> On 13/07/2015 23:46, Terry Reedy wrote:
>>
>> Optimizing specific tail calls is tricker.  For one thing, calls to a
>> recursion-replacement function, such as recur, add a stack frame that
>> must also be popped. A CPython bytecode manimpuation solution was given
>> years ago as a recipe on the ActiveState Python Cookbook site.  MacroPy
>> at pypi.python.org "provides a mechanism for user-defined functions
>> (macros) to perform transformations on the abstract syntax tree(AST) of
>> Python code at module import time".  Among many included examples, it
>> has a tco decorator.
>>
>
> A direct link https://github.com/lihaoyi/macropy#tail-call-optimization
> for anybody who is interested.
>

And I've just stumbled across this https://github.com/baruchel/tco which 
was only put up two days ago.

-- 
My fellow Pythonistas, ask not what our language can do for you, ask
what you can do for our language.

Mark Lawrence

Back to comp.lang.python | Previous | NextPrevious in thread | Find similar | Unroll thread


Thread

Re: Possibly Pythonic Tail Call Optimization (TCO/TRE) Jussi Piitulainen <jpiitula@ling.helsinki.fi> - 2015-07-13 14:22 +0300
  Re: Possibly Pythonic Tail Call Optimization (TCO/TRE) Chris Angelico <rosuav@gmail.com> - 2015-07-13 21:47 +1000
  Re: Possibly Pythonic Tail Call Optimization (TCO/TRE) Terry Reedy <tjreedy@udel.edu> - 2015-07-13 18:46 -0400
  Re: Possibly Pythonic Tail Call Optimization (TCO/TRE) Mark Lawrence <breamoreboy@yahoo.co.uk> - 2015-07-15 00:40 +0100
  Re: Possibly Pythonic Tail Call Optimization (TCO/TRE) Mark Lawrence <breamoreboy@yahoo.co.uk> - 2015-07-15 01:14 +0100

csiph-web