[swift-evolution] Proposal: Add generator functions to the language

Douglas Gregor dgregor at apple.com
Mon Dec 14 17:59:49 CST 2015



Sent from my iPhone

On Dec 12, 2015, at 1:36 PM, David Waite <david at alkaline-solutions.com <mailto:david at alkaline-solutions.com>> wrote:

> I proposed it because 
> - Only a few named language features (like Concurrency) were explicit non-goals
> - Its a feature I’m willing to try to implement (although I would probably want to work on several smaller changes to get up to speed first on SIL and the codebase)
> 
> Is there a possibility for larger features like this or macros to be done in parallel with the 2.2/3.0 development effort?

Yes, design and experimental implementation can certainly proceed on the side. However, we are bandwidth-constrained on how much design we can do, so (for example) the core team may not be able to engage as deeply as we would like and we would not be able to bring a proposal for a review until time permits. Swift 3 is pretty ambitious as is, and losing focus can be a serious problem for a release.

> Or perhaps a desire to have this sort of working group approach (similar to C++’s Technical Subcommittees), but not until 3.0 is released?

We can evaluate this again at some point, but I don't want to "fan out" to having multiple working groups until we've had more experience with this process through Swift 3. In part, this is because of my experiences with the ISO C++ process. Particularly now, where there are a significant number of active subgroups in the C++ committee, it is very hard to even keep track of all of the different pieces under discussion, much less establish and maintain a coherent vision going forward. And that’s in a fairly mature language (C++) where the community has had a longer time to get a feel for what the language is; it’s harder for a younger language like Swift where the philosophy isn’t as widely understood.

  - Doug

> 
> -DW
> 
>> On Dec 12, 2015, at 1:35 PM, Douglas Gregor via swift-evolution <swift-evolution at swift.org <mailto:swift-evolution at swift.org>> wrote:
>> 
>> 
>>> On Dec 11, 2015, at 10:48 PM, Kevin Ballard via swift-evolution <swift-evolution at swift.org <mailto:swift-evolution at swift.org>> wrote:
>>> 
>>> I'd love to have first-class support for generators like this, but it's a lot of work. It's a lot easier to do this sort of thing in a scripting language like Python than it is to do in a language like Swift, because it requires reifying the stack into a data structure that can be passed around. And I suspect there's a lot of non-trivial questions that have to get answered before you can even propose an implementation for this.
>>>  
>>> For context, this sort of thing is something that people have been talking about doing in Rust for quite a while, and it keeps getting punted because of the amount of work and the unanswered questions about how it would actually be implemented.
>>>  
>>> So I'll give this a general +1, but I think it should also be deferred until after Swift 3 at the earliest.
>> 
>> Right. This is a major add-on feature that doesn’t fit in with the stated goals for Swift 3 (README of https://github.com/apple/swift-evolution <https://github.com/apple/swift-evolution>), so I think we should proactively defer it.
>> 
>> 	- Doug
>> 
>> 
>> _______________________________________________
>> swift-evolution mailing list
>> swift-evolution at swift.org <mailto:swift-evolution at swift.org>
>> https://lists.swift.org/mailman/listinfo/swift-evolution <https://lists.swift.org/mailman/listinfo/swift-evolution>
> 
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.swift.org/pipermail/swift-evolution/attachments/20151214/11385d33/attachment.html>


More information about the swift-evolution mailing list