News for hackers. Stuff that matters.
Re:Python to Scheme to Assembly (2014) by Dewie on Monday March 23, 2015 @08:11PM (#9254145)
> , but my CS professors made it clear that iteration is basically just a special case of recursion.

That seems a bit disingenuous, since iteration and general recursion are fundamentally equivalent. So you could say that "recursion is just a special case of iteration".

Unless we're talking about specific iterations like iterating over a list, I guess.

Re:Python to Scheme to Assembly (2014) by danking00 on Monday March 23, 2015 @09:13PM (#9254349)
I feel that it is a bit disingenuous to claim they are equivalent if the solution to maintaining a call stack is to explicitly maintain a stack structure.

Iterating over lists, or integers in a range is pretty straightforward. Iterating over a tree? What does that even mean? I suppose we could take "iterate" to mean a catamorphism. Under that interpretation, structural recursion and "iteration" seem pretty equivalent.

Just feels like quite an extension of what "iteration" usually refers to in a language like C.

Re:Python to Scheme to Assembly (2014) by rdc12 on Tuesday March 24, 2015 @12:59AM (#9254979)
But with TCO it is no longer needed to maintain a stack structure, so it would probably be a better stated as a tail-call recursive function is equivalent to iteration (assuming TCO)
Re:Python to Scheme to Assembly (2014) by agumonkey on Tuesday March 24, 2015 @12:03AM (#9254835)
Good point. I always felt that iteration was 1-dimensional, when recursion is more fractal / N-dimensional.

ps: Also, a lot of programming is often conflated into 1-D. sed, grep, awk are mostly init ; iterate{ [PRED] FN }; exit

Re:Python to Scheme to Assembly (2014) by Dewie on Tuesday March 24, 2015 @05:02AM (#9255502)
> I feel that it is a bit disingenuous to claim they are equivalent if the solution to maintaining a call stack is to explicitly maintain a stack structure.

You're funny.

Equivalent in a computational sense.

Re:Python to Scheme to Assembly (2014) by danking00 on Wednesday April 01, 2015 @04:09PM (#9306497)
But by that standard ruby is python is C is assembler.

Turing-completeness is a not very interesting standard.