Re: [rust-dev] Are tail calls dispensable?

2011-09-26 Thread Lindsey Kuper
On Sun, Jul 31, 2011 at 4:55 PM, Marijn Haverbeke mari...@gmail.com wrote: I've been throwing around some ideas about a simpler way to 'alias' (non-owning reference) things with Patrick, and am in the process of working out some ideas. A bunch of the possible directions, and the ones that seem

Re: [rust-dev] Are tail calls dispensable?

2011-08-22 Thread David Herman
I understand that tail calls aren't working with the current state of things, and I won't get in the way. Fair warning: I am not promising I won't argue for bringing them back at some point in the future. - The alias-optimizing issues discussed earlier in this thread I've been chatting with

Re: [rust-dev] Are tail calls dispensable?

2011-08-09 Thread David Herman
I'll try to stick up for tail calls, at least down the road (I'd say having them in the first release doesn't really matter). A few points: - As you guys have said, this issue seems pretty tied in with the memory management semantics, particularly with refcounting. But I'm still not convinced

Re: [rust-dev] Are tail calls dispensable?

2011-08-03 Thread Graydon Hoare
On 11-08-01 07:45 PM, Rafael Ávila de Espíndola wrote: On 11-08-01 10:18 AM, Marijn Haverbeke wrote: Ah, I see what you mean now. But this kind of rewriting requires knowledge of the tail-called function (which may be in another module, or passed in by value), and a bunch of extra complexity.

Re: [rust-dev] Are tail calls dispensable?

2011-08-01 Thread Noel Grandin
Perhaps it would be possible to apply some compile-time transformation to mitigate the problem: Transform void f() { . f(); } into void f() { take ownership f1(); drop ownership } void f1() { f1(); } Marijn Haverbeke wrote: I've been throwing

Re: [rust-dev] Are tail calls dispensable?

2011-08-01 Thread Marijn Haverbeke
Perhaps it would be possible to apply some compile-time transformation to mitigate the problem: I don't really understand your transformation, but it seems like the resulting code would still consume stack space for the 'tail' call. ___ Rust-dev

Re: [rust-dev] Are tail calls dispensable?

2011-08-01 Thread Noel Grandin
Hi You are correct, my original transformation was not very well spelled out. Effectively, I'm transforming a normal method into a method where the take happens in the caller and the drop happens in the callee. It'll consume two stack frames - one for the original method, and one for the extra

Re: [rust-dev] Are tail calls dispensable?

2011-08-01 Thread Tim Chevalier
On Mon, Aug 1, 2011 at 7:56 AM, Noel Grandin noelgran...@gmail.com wrote: That kind of coding is easily modelled by returning closures to a core event loop routine. Maybe I'm missing something here, but closures are typically heap-allocated, whereas in Sebastian's scenario: Sebastian

Re: [rust-dev] Are tail calls dispensable?

2011-08-01 Thread Rafael Ávila de Espíndola
On 11-08-01 10:18 AM, Marijn Haverbeke wrote: Ah, I see what you mean now. But this kind of rewriting requires knowledge of the tail-called function (which may be in another module, or passed in by value), and a bunch of extra complexity. It doesn't really have the elegance of classical tail

[rust-dev] Are tail calls dispensable?

2011-07-31 Thread Marijn Haverbeke
I've been throwing around some ideas about a simpler way to 'alias' (non-owning reference) things with Patrick, and am in the process of working out some ideas. A bunch of the possible directions, and the ones that seem most promising to me at the moment, work poorly with tail calls. Having the