Swift 4.0 is finally here! So now everyone can relax, right? 😅 Ha. ABI Stability isn’t going to implement itself! 😆 There’s a lot of work ahead. We saw some progress here this week with Jordan Roses’s proposal on non-exhaustive enums. Also, there were some improvements to KeyPaths and the start to recursive protocol constraints.
Swift 4 landed along with Xcode 9, iOS 11, tvOS 11, and watchOS 4. This only leaves macOS High Sierra, which will be out in a few days. Good lucking with migrating your code bases if you haven’t started already. Over at PlanGrid, we decided to move to Swift 3.2 during the betas and move to Swift 4.0 after the final release. I have a work-in-progress branch doing the migration now and it’s not too bad, but definitely not trivial.
Interested in sponsoring Swift Weekly Brief? Learn more here.
In Episode 29 we discuss some recent Swift Evolution proposals, Xcode 9 GM, along with a boatload of follow-ups from Ted Kremenek and Pierre Habouzit.
News and community
Swift 4 is now officially released! Swift 4 builds on the strengths of Swift 3, delivering greater robustness and stability, providing source code compatibility with Swift 3, making improvements to the standard library, and adding features like archival and serialization.
Mike Ash has a great post on The Best New Features in Swift 4, in case you forgot. 😆
Brian Gesiak continued his Swift compiler series with Reading and Understanding the CMake in apple/swift.
Commits and pull requests
Calvin Hill added initial platform support for building swiftc and the stdlib on 64bit Haiku OS, which I assume is Greg Heo’s favorite operating system. 😆 Anyway, this brings Swift one step closer to world domination.
Jordan Rose eliminated the last direct use of
Builtin.UnknownObject. “At the Swift level, this is equivalent to AnyObject, which we’ve done much more testing of. This commit paves the way for taking UnknownObject out of the SIL type system and just using it as type metadata.”
Joe Groff wrote a script to generate random type definitions. The intent is to use this to generate input for fuzzing runtime layout, ABI compatibility, layout algorithms, and more. Unfortunately, it was written in Python, not Swift.
Amr Aboelela opened a pull request for corelibs-libdispatch that adds a
build-android script, which will build libdispatch for Android.
Proposals in review
This proposal removes support for the keywords
unownedfor property declarations in a protocol.
Currently it’s possible to use the weak/unowned keywords for a property requirement in a protocol. This can lead to confusion as specifying one of these keywords does not enforce or raise any warnings in the adopting type of that protocol…
Currently, adding a new case to an enum is a source-breaking change, which is very inconvenient for library authors. This proposal aims to distinguish between enums that are exhaustive (meaning they will never get any new cases) and those that are non-exhaustive, and to ensure that clients handle any future cases when dealing with the latter. This change only affects clients from outside the original module.
Ted Kremenek announced Swift 4.0.
I am pleased to announce that Swift 4.0 has been officially released.
Swift 4 is available in Xcode 9 (which went live on the Mac App Store earlier today) and we will be posting an official toolchain shortly as well (likely early tomorrow morning).
Official builds have been posted for Linux (Ubuntu 16.10, Ubuntu 16.04 and Ubuntu 14.04). For those of you downloading the Linux builds, please note that there is a new signing key (search for ‘Swift 4.x Release Signing Key’) on the downloads page
Thank you to everyone who contributed to making this release happen!
And finally — artificial intelligence, 5 cents.