[swift-evolution] Pure functions

2018-01-16 Thread Daryle Walker via swift-evolution
Should we add support for recognition of pure functions? These functions don’t refer to any global state; their return values / outgoing in-out parameter states depend solely on the incoming argument values. I know at least the D programming language acknowledges them. - Should they be

Re: [swift-evolution] pure functions

2017-09-29 Thread Andrew Bennett via swift-evolution
> As Andy says, the major problem is that public API (which you can't see the implementation of in general) would all need to be marked up properly. The use-case I'm most interested in is reducing programmer error, I'm personally not too concerned about optimisations achieved by "pure" at this

Re: [swift-evolution] pure functions

2017-09-09 Thread David Sweeris via swift-evolution
> On Sep 9, 2017, at 10:48 AM, Dave Abrahams via swift-evolution > wrote: > > on Wed Aug 23 2017, Joe Groff wrote: On Aug 18, 2017, at 12:10 PM, Chris Lattner via swift-evolution wrote: Splitting

Re: [swift-evolution] pure functions

2017-09-09 Thread Dave Abrahams via swift-evolution
on Wed Aug 23 2017, Joe Groff wrote: On Aug 18, 2017, at 12:10 PM, Chris Lattner via swift-evolution wrote: Splitting this out from the concurrency thread: On Aug 18, 2017, at 6:12 AM, Matthew Johnson

Re: [swift-evolution] pure functions

2017-08-23 Thread Joe Groff via swift-evolution
> On Aug 18, 2017, at 12:10 PM, Chris Lattner via swift-evolution > wrote: > > Splitting this out from the concurrency thread: > >> >> On Aug 18, 2017, at 6:12 AM, Matthew Johnson wrote: >>> On Aug 17, 2017, at 11:53 PM, Chris Lattner

Re: [swift-evolution] pure functions

2017-08-18 Thread Chris Lattner via swift-evolution
As Andy says, the major problem is that public API (which you can't see the implementation of in general) would all need to be marked up properly. -Chris > On Aug 18, 2017, at 2:45 PM, David Sweeris wrote: > > >> On Aug 18, 2017, at 12:11, Chris Lattner via

Re: [swift-evolution] pure functions

2017-08-18 Thread Andrew Trick via swift-evolution
> On Aug 18, 2017, at 2:45 PM, David Sweeris via swift-evolution > wrote: > > If we define our semantics carefully enough, could we realistically make it > so that "@pure" or "@impure" (or whatever) would simply be a note to the > compiler, letting it skip that bit

Re: [swift-evolution] pure functions

2017-08-18 Thread David Sweeris via swift-evolution
> On Aug 18, 2017, at 12:11, Chris Lattner via swift-evolution > wrote: > > Splitting this out from the concurrency thread: > >> >>> On Aug 18, 2017, at 6:12 AM, Matthew Johnson wrote: On Aug 17, 2017, at 11:53 PM, Chris Lattner

Re: [swift-evolution] pure functions

2017-08-18 Thread Chris Lattner via swift-evolution
Splitting this out from the concurrency thread: > > On Aug 18, 2017, at 6:12 AM, Matthew Johnson wrote: >> On Aug 17, 2017, at 11:53 PM, Chris Lattner wrote: >> >>> In the manifesto you talk about restrictions on passing functions across an >>>