It was a busy week on the main apple/swift repo. Here are some stats from GitHub Insights:

Excluding merges, 39 authors have pushed 156 commits to master and 284 commits to all branches. On master, 401 files have changed and there have been 12,589 additions and 9,215 deletions..

It’s great to see so much work being done so soon after WWDC. The core team and other contributors are making significant progress on the road to the official Swift 4 launch.

iOS 11 beta 2, tvOS 11 beta 2, and Swift Playgrounds 2 beta 2 were all released. Download them here, and keep filing radars!

Swift Unwrapped

In Episode 17: Testing in Swift, Jesse and JP discuss how Swift and its set of open source tools are tested to ensure that every release breaks as little as possible. 😜

News and community

Greg Heo wrote a post that looks at how Swift Encoder and Encodable work. There’s been a lot of open source activity related to this new feature, so understanding how it works will help when trying to digest related PRs.

Matt Godbolt’s Compiler Explorer now supports Swift.

David Owens released a preview for an extension to Visual Studio Code that supports Swift.

The Swift backend for the Swift-Evolution app, Evo, is now open source.

Steven Hepting explains how Swift’s sort() method is optimized. Find the source code here.

Learn Swift Queens & Learn Swift Portland, just launched. That’s 11 Learn Swift {CITY} meet ups worldwide! Which city will be next?

Brisk, a macOS app for submitting radars released version 1.0 and a quick 1.0.1 follow-up release. Check out the release notes and keeping filing radars!

More fallout from Tuplegate. This was interesting to me because I use this exact same pattern. As Slava points out in the thread, there’s still room for improvement.

Commits and pull requests

Ben Cohen opened a pull request to add Substring affordances to Hashable containers (See below for mailing list discussion).

Itai Ferber merged a pull request that fixes SR-5277. This allows classes to share an Encoder/Decoder with its super class. For further explanation, check out this thread.

Philippe Hausler merged a pull request that fixes SR-5292. This fixes a crasher in Foundation when working with slices of slices.

Joe Groff merged a pull request that adds support for optional chaining / force unwrapping when dealing with KeyPaths.

Doug Gregor merged a pull request that improves the handling of concrete types, type aliases, and recursion, and which fixes SR-4295, SR-4757, SR-4786, SR-5014, and SR-4737.

Dave Abrahams opened a pull request that implements SE-0180, the String index Overhaul (See below).

The manual displayed when running man swift on the command line has been updated.

Maxim Moiseev merged a pull request that fixes backward compatibility for flatMap on [String]. Check out this related Swift Puzzle by Robert Widmann.

David Farler merged a pull request that upstreams Apple’s (previously) internal index-while-building changes released with Xcode 9.

If you ever wonder what the details are for a rdar:// that a particular PR fixes, feel free to ask.

Proposals in review

SE-0180: String Index Overhaul is back in review after some revisions.

Mailing lists

Erica Sadun made a pitch for a !! operator, which she calls “Unwrap or Die”. You can find a draft in this gist.

Using an operator to provide feedback on the context of a failed unwrap has become a commonly implemented approach in the Swift developer Community. What are your thoughts about adopting this widely-used operator into the standard library?

Ben Cohen made a pitch regarding Substring performance affordances.

As outlined in SE-0163, the more general question of implicit conversion from Substring to String was deferred pending feedback on the initial implementation. To date, the feedback we’ve received hasn’t suggested that such an implicit conversion is necessary — that migrations from 3.2 to 4.0 haven’t led to an extensive need to perform Substring -> String conversion. Any further input, either on or off list, about this particular aspect of migration would be very gratefully received.

[…]

Itai Ferber sent a message on Swift-Evolution asking for feedback regarding SE-0166 and SE-0167 and letting the community know that suggestions have already been implemented and will continue to be considered.

Robert Bennett made an interesting pitch for declaring let in protocols. I didn’t realize this problem existed.

I’m bumping into an annoying problem with protocols. In a class or struct it is common to have a let instance variable and assign it in init. Unfortunately there is no way to translate this into a protocol with init in an extension.

[…]

Finally

Taking can sometimes feel as good as giving.