Issue #19 21 Apr 2016
Written by: Jesse Squires
As you must know by now, WWDC 2016 has been announced! What’s most surprising and exciting to me is the emphasis on Swift — it’s all over the WWDC pages on Apple’s site. I certainly did not expect this strong of a focus on Swift. Usually there are teasers about the upcoming OS and hardware releases. Of course, it’s no surprise that Swift 3.0 is coming so it makes me wonder, what else is planned for Swift that we don’t know about?
In other news, the Xcode 7.3.1 GM seed was released. It includes a bunch of bug fixes and Swift 2.2.1. However, the release notes didn’t specify the Swift version and the version number did not get bumped in Xcode. But don’t worry, the fixes are in there. 😄
- SR-1266: Remove duplication between
swift/validation-testconfiguration files. This is a good introduction to the Swift build system, its test suite, and CMake.
- SR-1263: Compiler wrongfully complains of illegal syntax when declaring multiple conformances for a protocol’s associated type.
- SR-1238: UnsafePointer and UnsafeMutablePointer should conform to Comparable
Commits and pull requests
Anna Zaks merged some fixes and improvements to the
swift_demangle API. 🤓
Brian Gesiak opened a pull request to begin adding testing support for Android.
Max Howell merged changes that add a flag to make the build output location of SwiftPM configurable.
Daniel Eggert’s implementation of
NSHTTPURLResponse has merged. 🎉
Brian Gesiak opened a pull request to expand the Linux/FreeBSD check to include Android. It’s so weird to see
#if os(Android). 😄
Joe Groff merged changes that allow Objective-C generic extensions to perform
@objc operations involving generics. “This should allow an extension to use the generic class’s own API to some degree, as it would if defined on the non-generic form.”
John Holdsworth submitted a pull request with an implementation of a swift-format tool to indent swift source code from the command line using the new libIDE API (SR-146). 👏 Unfortunately, it looks like it was closed due to some git rebasing problems. 😅 It looks like John will open a fresh pull request soon.
Mauricio Meirelles submitted a pull request that begins implementing
- Robert F. Dickerson updated
- Pushkar N Kulkarni updated
- @saiHemak updated
- Bhaktavatsal Reddy updated
It was a big week for proposals! 🎉
This proposal only received light commentary from the community, but that feedback was universally positive. The core team agrees that this is will greatly improve the expressivity of imported Objective-C APIs into Swift. The implementation work is quite far along, and while there are still a couple engineering-level questions left, the design is solid, so we are comfortable accepting it at this point.
Chris Lattner’s proposal, SE-0049: Move
@autoclosure to be type attributes, has been accepted for Swift 3. “Feedback on the proposal was light but positive.” The work for this was tracked at SR-1235 and it looks like Chris has finished most of the work. 👏
Erica Sadun’s and Chris Lattner’s proposal, SE-0036: Requiring Leading Dot Prefixes for
enum Instance Member Implementations, has been accepted for Swift 3. “We welcome an implementation of this proposal.” As mentioned above, Alex Hoppen already submitted a pull request for this. 🎉
The proposal is accepted, with one adjustment to the handling of collections: rather than support any SequenceType as a collection, the core team wants a narrower rule for only the primary Cocoa collection types (
NSSet) and their Swift-bridged equivalents (
Set), due to implementation concerns. Feedback on this proposal was generally positive, and the proposal fits well with
David Hart’s proposal, SE-0064: Referencing the Objective-C selector of property getters and setters, has been accepted for Swift 3. “Feedback was light but positive, with many considering this to effectively be an obviously missing piece of the
#selector proposal SE-0022.” Work is being tracked at SR-1239. Alex Hoppen is working on an implementation.
Max Howell’s proposal, SE-0063: SwiftPM System Module Search Paths, has been accepted for Swift 3. “Feedback was light but positive, which was not surprising since there had been email discussions of this topic for some time and there was general agreement about the need.”
There was much debate, both before and during the review, over the “InPlace” suffix / “form” prefix, and at this point any answer will be objectionable to some. The core team has opted to accept the proposal as-is, keeping the “form” prefix to describe the mutating counterpart to an operation naturally described by a noun (e.g., “formUnion” for the mutating variant of “union”), for the reasons described in the proposal itself. Thanks all for the spirited discussion!
Proposal SE-0056: Allow trailing closures in
guard conditions has been rejected. “The core team felt that the benefits from this change were outweighed by the inconsistency it would introduce with
Proposals in review
FloatingPointprotocol is quite limited, and provides only a small subset of the features expected of an IEEE 754 conforming type. This proposal expands the protocol to cover most of the expected basic operations, and adds a second protocol,
BinaryFloatingPoint, that provides a number of useful tools for generic programming with the most commonly used types.
Within a class scope,
Selfmeans “the dynamic class of self”. This proposal extends that courtesy to value types and to the bodies of class members by renaming
Self. This establishes a universal and consistent way to refer to the dynamic type of the current receiver.
Max Howell started a discussion on allowing further module organization in SwiftPM. Currently the module layout rules prevent you from grouping related modules in subdirectories, Max discusses possible solutions to allow this. He also notes that package authors have a clear preference toward a root
Sources/ directory and suggests making this required, that is, using
src/ and other variants would be errors.
Nate Cook asked for feedback on a draft proposal to expand the
max() sequence methods. “This proposal would expand on the
max() sequence methods to add methods that return the corresponding index for a collection, efficiently find the minimum and maximum elements or indices at the same time, and provide extension points for sorted collections to provide all these results more efficiently.”
And finally — if you needed help decoding that WWDC announcement, Erica Sadun can help. 😄