Issue #81 03 Aug 2017
Written by: Jesse Squires
I can’t believe it’s already August! This means we are only one or two months away from a final release of Xcode 9, Swift 4, and all of the Apple OSes. We usually see a GM around late August or September. There are still a number of proposals that have not been implemented and I think it’s safe to say they will not be included in Swift 4. Anyway, this week there were some changes to SourceKit that will make SwiftLint users happy and an initial implementation of Swift bindings to libSyntax. On the mailing list, Jordan Rose discussed his 99 problems — spoiler, all of them are inheritance and initializers.
Harfang Apps is proud to sponsor this newsletter again with its newly-launched Mac App built with Swift! Regis is a powerful Redis client with a flexible multi-windows, multi-tabs-per-window UI where each tab is an independent Redis session. It supports all Redis features including the new Redis modules, pub-sub, pipelining and much more. Buy it now on the Mac App Store.
In Episode 22: ABI Stability — The Big Picture, we clear up some of the misconceptions around what ABI stability means, how we’ll get there and why it’s important.
Commits and pull requests
Marcelo Fabri merged changes to SourceKit to address SR-2487. The issue here was that Swift 2.3 removed the “
source.decl.attribute.__raw_doc_comment” attribute from structures returned by SourceKit. This was used by SwiftLint (everyone’s favorite Swift linter 😄) to implement
MissingDocsRule. Marcelo’s pull request not only restores the functionality, but takes it a step further and adds the range of a doc comment for each declaration. This would make possible to add back those rules (and their implementation could possibly even be simpler now). Nice work Mercelo! 🙌
Harlan Haskins opened a pull request with an initial implementation of the Swift libSyntax API, which aims to provide all features of the C++ API but exposed to Swift — that is, Swift bindings to libSyntax. libSyntax is a library in the Swift compiler that provides a full source-preserving Syntax tree that can be easily transformed and re-printed as a file. Why is this exciting? Let JP Simard explain: “this should eventually make it easier to write Swift tools in Swift.” 😱
Roman Levenstein implemented a more robust way to avoid infinite generic specialization loops.
Nate Cook merged documentation revisions for the stdlib.
Kelvin Ma completed and merged the first draft of SE-0184: Improved pointers which was pitched on the mailing lists last week. It is not yet scheduled for a review and I am highly skeptical it will even be reviewed in the Swift 4 time frame, much less implemented if it gets accepted.
Jordan Rose sent out a great explanation on
required initializers in response to a discussion on twitter. He outlines the intricacies of Swift initializers and eventually refers readers to this doc on Initializer Problems. The TL;DR is that there’s not really a great answer and initializers are hard, but there are a few potential directions to explore in the future. Or, as Alexis Beingessner put it, it’s “a great piece on why inheritance continues to be a nightmare when you try to mix it with traits/protocols/typeclasses.” 😄
Why you can’t make someone else’s class
Decodable: a long-winded explanation of
David Hart recently asked on Twitter if there was a good way to add
Decodablesupport to somebody else’s class. The short answer is “no, because you don’t control all the subclasses”, but David already understood that and wanted to know if there was anything working to mitigate the problem. So I decided to write up a long email about it instead. (Well, actually I decided to write a short email and then failed at doing so.)
Nicole Jacque announced some planned downtown for Swift.org:
We will have some downtime for swift.org resources over the weekend as we upgrade our infrastructure.
The outage schedule will be as follows:
- bugs.swift.org will become unavailable starting at 9 PM Thursday, Aug 3 (Pacific) until the upgrade is completed on Saturday, Aug 5
- swift.org mailing lists (including this list) will become unavailable starting at 3 PM Friday, Aug 4 until the upgrade is completed on Saturday
- ci.swift.org and all CI infrastructure will become unavailable starting at 3 PM Friday, Aug 4 until the upgrade is completed on Saturday. We will also be locking the repos at this time until CI is back up.
- The swift.org website will be unavailable for a short time on Saturday afternoon.
We expect the upgrade to be complete on Saturday afternoon or evening. We will send out email when the upgrade is complete.
And finally — I got two words for you.