DIP: Tail call optimization

Andrew Godfrey via Digitalmars-d-announce digitalmars-d-announce at puremagic.com
Sun Jul 10 05:01:54 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.
>
>
> The proposal it's ready for merge on the new [DIPs 
> repo](https://github.com/dlang/DIPs/pull/6)
>
> --
> Dietrich

I'll chime in to give a counterpoint to the ... I'll say 
"immature" discussion this generated.

Just my opinion:

Yes, an attribute to express something you expect the compiler to 
do, has value. (Clearly some people on here don't have experience 
with a codebase that is maintained by thousands of people).

Even if compilers aren't required to implement TCO, it could work 
(compilers which didn't, would always give an error if you used 
the attribute). But it would then feel weird to me to use this 
attribute, knowing that some compilers would pass it and some 
would fail it.

And compilers which always fail it, would feel pressure to do 
better. Whether this is good depends on your outlook. D does 
think of itself as "multi-paradigm", so maybe it should push on 
this.

Personally I could see myself making use of this, but not being 
very sad if it didn't happen.

I do prefer your more verbose proposals over "@tco" - a short 
abbreviation doesn't feel appropriate.


More information about the Digitalmars-d-announce mailing list