News for hackers. Stuff that matters.
Re:Rust will likely not support tail call optimization by mike_ivanov on Wednesday April 10, 2013 @05:16PM (#5528243)
A TCO-support discussion on Y combinator.

OH IRONY.

Re:Rust will likely not support tail call optimization by zxcdw on Wednesday April 10, 2013 @05:22PM (#5528285)
Elaborate for the ignorant.
Re:Rust will likely not support tail call optimization by qznc on Wednesday April 10, 2013 @05:37PM (#5528370)
The Y Combinator is something important in the theory of functional programming. It takes one function as argument and applies it to itself ad infinitum. Together with lazy evaluation this is how you can implement recursion in a language which does not natively support it, namely (lazy) lambda calculus.

http://en.wikipedia.org/wiki/Fixed-point_combinator#Y_combin...

Actually, TCO and Y are not really related with each other apart from the fact that you usually learn about them in the same course about functional programming.

Re:Rust will likely not support tail call optimization by kragen on Wednesday April 10, 2013 @08:13PM (#5529093)
If you write your loops with the Y-combinator, you need tail-call elimination to keep them from overflowing the stack when they run for enough iterations, because the way your function f goes on to the next iteration of itself is by calling the (Y f) that was passed as its first argument.
Re:Rust will likely not support tail call optimization by qznc on Thursday April 11, 2013 @09:57AM (#5531963)
You can write a lambda calculus interpreter which does beta-reduction. In this case, there is no stack which could overflow. Just a lambda expression, which is reduced to another expression.
Re:Rust will likely not support tail call optimization by kragen on Thursday April 11, 2013 @03:30PM (#5534208)
Yes, as I mentioned in another comment in this thread, TCE falls out automatically from combinator-graph reduction.
Re:Rust will likely not support tail call optimization by kd0amg on Wednesday April 10, 2013 @05:33PM (#5528351)
The Y combinator is a way to express recursion in lambda calculus. Tail call optimization (turning certain function calls into GOTOs) is the traditional way to keep from overflowing the control stack in languages based on lambda calculus.