DIP: Tail call optimization

Dmitry Olshansky via Digitalmars-d-announce digitalmars-d-announce at puremagic.com
Tue Jul 12 03:46:01 PDT 2016


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 interested on getting feedback on it.
>

In contrast to what many folks expect, TCO is affecting program 
semantics in a way that changes stack overflow to normal 
execution.

Therefore it's not an optimization but part of semantics, and 
there should be a way to mark a call as a tail-call in any 
optimization level.

It was a big road block for me when I tried to implement 
threaded-code interpreter, because it will stack overflow in 
debug mode.

>
> The proposal it's ready for merge on the new [DIPs 
> repo](https://github.com/dlang/DIPs/pull/6)
>
> --
> Dietrich




More information about the Digitalmars-d-announce mailing list