[swift-evolution] [Proposal idea] Support for pure functions

Joe Groff jgroff at apple.com
Mon Dec 21 16:08:48 CST 2015


> On Dec 21, 2015, at 2:04 PM, Alex Popov via swift-evolution <swift-evolution at swift.org> wrote:
> 
> Slight tangent, would a guarantee of purity also allow for more Tail-Call Optimizations? A cursory glance at SO seems to point to TCO not always being applied, especially when ARC is involved.


I don't think any reasonable meaning for `pure` in Swift would affect the possibility of TCO. There was another thread about TCO here you might read back on; as I explained there, ARC is not a barrier to TCO, our ownership and machine-level calling conventions are. We would need to be able to use a specific calling convention for guaranteed-TCOable entry points.

-Joe



More information about the swift-evolution mailing list