[Python-ideas] Tail recursion elimination

musicdenotation at gmail.com musicdenotation at gmail.com
Sun Jan 19 15:00:00 CET 2014



> On Jan 19, 2014, at 18:57, "Joao S. O. Bueno" <jsbueno at python.org.br> wrote:
> 
> OTOH, since we are at it, we'd better check
> 2009 BDLF's opinion on the subject:
> 
> http://neopythonic.blogspot.com.br/2009/04/tail-recursion-elimination.html
> 
> 
>> On 19 January 2014 09:54, Joao S. O. Bueno <jsbueno at python.org.br> wrote:
>>> On 19 January 2014 08:52, Mark Lawrence <breamoreboy at yahoo.co.uk> wrote:
>>>> On 19/01/2014 07:39, musicdenotation at gmail.com wrote:
>>>> 
>>>> I propose tail-call optimization to be added into CPython.
>>> 
>>> 
>>> Then implement it so everybody else can use it.
>> 
>> On a second though,  it actually could be done, at the VM level.
>> I am not a proponent, but after my second though I am from "-1" to "+0".
>> 
>> I believe that anytime one have the sequence:
>> 
>>             20 CALL_FUNCTION            1
>>             23 RETURN_VALUE
>> 
>> in byte code, the current stack frame could be discarded prior
>> to making the function call. Looking from 10000 meters, it feels
>> like it would not impact any other aspect of the language but for
>> enabling automatically tail recursion calls.
>> 
>>   js
>> -><-
>> 
>>> 
>>> 
>>> --
>>> My fellow Pythonistas, ask not what our language can do for you, ask what
>>> you can do for our language.
>>> 
>>> Mark Lawrence
>>> 
>>> _______________________________________________
>>> Python-ideas mailing list
>>> Python-ideas at python.org
>>> https://mail.python.org/mailman/listinfo/python-ideas
>>> Code of Conduct: http://python.org/psf/codeofconduct/
> _______________________________________________
> Python-ideas mailing list
> Python-ideas at python.org
> https://mail.python.org/mailman/listinfo/python-ideas
> Code of Conduct: http://python.org/psf/codeofconduct/
Actually, my original post is a response to his arguments.


More information about the Python-ideas mailing list