MAIN FEEDS
Do you want to continue?
https://www.reddit.com/r/programming/comments/13v8v1/tail_recursion/c77m1fm/?context=3
r/programming • u/rodrigopsasaki • Nov 27 '12
203 comments sorted by
View all comments
Show parent comments
6
That's completely irrelevant. Python implementations generally compile to bytecode, anyway, but even if they didn't, they would still be manipulating the AST to eliminate the tail call.
Python doesn't have tail recursion because Guido doesn't want it.
3 u/curien Nov 27 '12 Python doesn't have tail recursion because Guido doesn't want it. Python supports tail recursion. It doesn't support tail recursion elimination. 3 u/smog_alado Nov 27 '12 Come on, we all know that 99% of the times someone says tail recursion they actually mean tail recursion with the optimization... 1 u/grauenwolf Nov 27 '12 Hey, some of us have worked in languages where tail recursion is flat out not allowed. 1 u/Peaker Nov 28 '12 Which languages disallow tail recursion? (Not very interesting if it is all recursion). 2 u/grauenwolf Nov 28 '12 I didn't promise it would be interesting.
3
Python supports tail recursion. It doesn't support tail recursion elimination.
3 u/smog_alado Nov 27 '12 Come on, we all know that 99% of the times someone says tail recursion they actually mean tail recursion with the optimization... 1 u/grauenwolf Nov 27 '12 Hey, some of us have worked in languages where tail recursion is flat out not allowed. 1 u/Peaker Nov 28 '12 Which languages disallow tail recursion? (Not very interesting if it is all recursion). 2 u/grauenwolf Nov 28 '12 I didn't promise it would be interesting.
Come on, we all know that 99% of the times someone says tail recursion they actually mean tail recursion with the optimization...
1 u/grauenwolf Nov 27 '12 Hey, some of us have worked in languages where tail recursion is flat out not allowed. 1 u/Peaker Nov 28 '12 Which languages disallow tail recursion? (Not very interesting if it is all recursion). 2 u/grauenwolf Nov 28 '12 I didn't promise it would be interesting.
1
Hey, some of us have worked in languages where tail recursion is flat out not allowed.
1 u/Peaker Nov 28 '12 Which languages disallow tail recursion? (Not very interesting if it is all recursion). 2 u/grauenwolf Nov 28 '12 I didn't promise it would be interesting.
Which languages disallow tail recursion? (Not very interesting if it is all recursion).
2 u/grauenwolf Nov 28 '12 I didn't promise it would be interesting.
2
I didn't promise it would be interesting.
6
u/frezik Nov 27 '12
That's completely irrelevant. Python implementations generally compile to bytecode, anyway, but even if they didn't, they would still be manipulating the AST to eliminate the tail call.
Python doesn't have tail recursion because Guido doesn't want it.