Re: DIP: Tail call optimization

2016-07-13 Thread Dietrich Daroch via Digitalmars-d-announce
On Tuesday, 12 July 2016 at 10:46:01 UTC, Dmitry Olshansky wrote: On Sunday, 10 July 2016 at 05:03:46 UTC, Dietrich Daroch wrote: Hi everyone (= I've just added a new proposal to add a new attribute to ensure TCO is applied. [...] In contrast to what many folks expect, TCO is affecting

Re: DIP: Tail call optimization

2016-07-11 Thread Dietrich Daroch via Digitalmars-d-announce
On Tuesday, 12 July 2016 at 01:42:13 UTC, Andrew Godfrey wrote: On Monday, 11 July 2016 at 17:31:23 UTC, Dietrich Daroch wrote: On Monday, 11 July 2016 at 16:27:38 UTC, Andrew Godfrey wrote: [...] * It must not be ignorable by the compiler. * It must generate an error if that compiler would

Re: DIP: Tail call optimization

2016-07-11 Thread Dietrich Daroch via Digitalmars-d-announce
On Monday, 11 July 2016 at 16:27:38 UTC, Andrew Godfrey wrote: [...] * It must not be ignorable by the compiler. * It must generate an error if that compiler would be unable to do the TCO. Otherwise, the compiler *may* (not "must") apply the TCO, unless compiled under (some optimization

Re: DIP: Tail call optimization

2016-07-11 Thread Dietrich Daroch via Digitalmars-d-announce
On Monday, 11 July 2016 at 15:48:08 UTC, Ola Fosheim Grøstad wrote: On Monday, 11 July 2016 at 15:27:54 UTC, Dietrich Daroch wrote: I've been thinking about changing @tco for @boundedStack, as it'll really reflect guarantees on functions while implicitly asking for TCO on functions that

Re: DIP: Tail call optimization

2016-07-11 Thread Dietrich Daroch via Digitalmars-d-announce
On Monday, 11 July 2016 at 14:36:22 UTC, Andrew Godfrey wrote: On Monday, 11 July 2016 at 10:25:36 UTC, Tofu Ninja wrote: On Sunday, 10 July 2016 at 13:15:38 UTC, Andrew Godfrey wrote: Btw here's a thread from 2014 that touches on the idea of a "tailrec" annotation. At the time, Walter viewed

Re: DIP: Tail call optimization

2016-07-10 Thread Dietrich Daroch via Digitalmars-d-announce
On Sunday, 10 July 2016 at 17:16:10 UTC, Ola Fosheim Grøstad wrote: On Sunday, 10 July 2016 at 17:10:32 UTC, Dietrich Daroch wrote: Annotating every callsite seems uncomfortable, being able to perform TCO is a property of the function and not something that might look call-site dependant.

Re: DIP: Tail call optimization

2016-07-10 Thread Dietrich Daroch via Digitalmars-d-announce
On Sunday, 10 July 2016 at 16:52:09 UTC, Ola Fosheim Grøstad wrote: On Sunday, 10 July 2016 at 05:03:46 UTC, Dietrich Daroch wrote: Hi everyone (= I've just added a new proposal to add a new attribute to ensure TCO is applied. The proposal is really simple, but I'm clueless on how to

Re: DIP: Tail call optimization

2016-07-10 Thread Dietrich Daroch via Digitalmars-d-announce
On Sunday, 10 July 2016 at 12:01:54 UTC, Andrew Godfrey wrote: On Sunday, 10 July 2016 at 05:03:46 UTC, Dietrich Daroch wrote: Hi everyone (= I've just added a new proposal to add a new attribute to ensure TCO is applied. The proposal is really simple, but I'm clueless on how to implement

Re: DIP: Tail call optimization

2016-07-10 Thread Dietrich Daroch via Digitalmars-d-announce
On Sunday, 10 July 2016 at 06:59:21 UTC, ketmar wrote: On Sunday, 10 July 2016 at 06:44:22 UTC, Dietrich Daroch wrote: Yes, there is no cure for poor skills, but the point is to prevent the need to avoid recursion to ensure there are no stack overflows. It seems reasonable considering D

Re: DIP: Tail call optimization

2016-07-10 Thread Dietrich Daroch via Digitalmars-d-announce
On Sunday, 10 July 2016 at 06:17:08 UTC, ketmar wrote: On Sunday, 10 July 2016 at 05:55:50 UTC, Dietrich Daroch wrote: Yes, it probably does TCO. The problem is what if you think it does and it cannot do it because of a misunderstanding on when it can be applied or a bug? there can't be any

Re: DIP: Tail call optimization

2016-07-10 Thread Dietrich Daroch via Digitalmars-d-announce
On Sunday, 10 July 2016 at 06:18:41 UTC, Jack Stouffer wrote: On Sunday, 10 July 2016 at 05:55:50 UTC, Dietrich Daroch wrote: Yes, it probably does TCO. The problem is what if you think it does and it cannot do it because of a misunderstanding on when it can be applied or a bug? Then file a

Re: DIP: Tail call optimization

2016-07-10 Thread Dietrich Daroch via Digitalmars-d-announce
On Sunday, 10 July 2016 at 05:24:49 UTC, A.B wrote: On Sunday, 10 July 2016 at 05:03:46 UTC, Dietrich Daroch wrote: Hi everyone (= I've just added a new proposal to add a new attribute to ensure TCO is applied. The proposal is really simple, but I'm clueless on how to implement it and also

DIP: Tail call optimization

2016-07-09 Thread Dietrich Daroch via Digitalmars-d-announce
Hi everyone (= I've just added a new proposal to add a new attribute to ensure TCO is applied. The proposal is really simple, but I'm clueless on how to implement it and also interested on getting feedback on it. The proposal it's ready for merge on the new [DIPs