The last two weeks were rather busy at Apple. A new Xcode 11.4 beta, Swift Crypto library releases and making Swift Playgrounds available for Mac.

On top of that, the Swift repository now has more than 100,000 commits!

Interested in sponsoring Swift Weekly Brief? Learn more here.

Starter tasks

  • SR-12129 swift-driver fails to diagnose a lack of input files
  • TF-1134 [Autodiff] [Stlib] Define derivatives for Float and Double maximum and minimum methods

Podcasts

In episode 84 of Swift Unwrapped, Jesse and JP discuss Swift in 2020.

In episode 7 of the Swift Community Podcast, Tim Condon talks with Kaitlin Mahar, Siemen Sikkema, Tanner Nelson and Ian Partridge about the current state of Swift on the server, and what the future might have in store.

News and community

Xcode 11.4 beta is out with Swift 5.2, which has a ton of compiler performance and quality of life improvements, including the new diagnostic engine, tweeted Joe Groff.

Cory Benfield released Swift Crypto at dotSwift conference stage. He wrote an article on the Swift.org website. As well some folks started a discussion.

Swift Crypto is a new Swift package that brings the fantastic APIs of Apple CryptoKit to the wider Swift community. This will allow Swift developers, regardless of the platform on which they deploy their applications, to access these APIs for a common set of cryptographic operations.

Apple released Swift Playgrounds for Mac - making it fun to learn and experiment with code. Previously it was available only for iPad.

The release of Swift 5.1.4 for Linux was announced. New downloads are available on swift.org. Official Docker images are also available. Later Johannes Weiss informed that development is now open for Swift 5.1.5 for Linux.

Ole Begemann wrote two great articles. One about automatic test discovery in Swift on Linux and another on how to test Swift packages on Linux using Docker.

John Sundell wrote an article explaining slicing Swift Collections.

Antoine van der Lee explained in his blog post how to create the Swift Package framework in Xcode.

The Point-Free folks announced a library called CasePaths that brings the power and ergonomics of key paths to enums.

Alejandro tweeted that Swift nightly builds are now available on swift.godbolt.org. Godbolt is a compiler explorer tool.

Paul Hudson tweeted that whatsnewinswift.com now covers Swift 5.2 and other changes between the versions. Along with that, he released a tool called Sitrep that is a source code analyzer for Swift projects, giving you a high-level overview of your code.

Mattt wrote two awesome articles about Language Server Protocol and Swift Development with Visual Studio Code.

Johannes Weiss tweeted that AsyncHTTPClient version 1.1.0 has been released.

Commits and pull requests

Slava Pestov merged a pull request that fixes computeSelfParam() to respect __consuming on class methods.

He also tweeted:

Dodged an ABI bullet here. Underscored keyword was broken… but thankfully the broken case wasn’t exercised in the standard library

Tim opened [a pull request] that overhauls swift_dynamicCast. David Smith tweeted:

Swift’s runtime casting infrastructure has been… “scary and organic” I guess? For quite a while. This rewrites it to be properly structured, and cleans up a ton of edge case behavior in the process.

Doug Gregor merged a pull request which adds function builders support for declaring local variables within a function builder closure.

Slava Pestov merged a pull request where he and CodaFi were able to fix the remaining cases where name lookup in imported types would force loading all the members of a type or extension in order to find a single member.

Doug Gregor merged a pull request that makes it easy to extend Swift function builders to support local let’s.

Sink the constraint generation and solution application of initialization patterns, including all of the logic for property wrappers, from the high-level entry point typeCheckBinding down into the lower-level handling for solution application targets.

Accepted proposals

SE-0270: Add Collection Operations on Noncontiguous Elements was accepted. See the discussions here.

We can use a Range<Index> to refer to a group of consecutive positions in a collection, but the standard library doesn’t currently provide a way to refer to discontiguous positions in an arbitrary collection. I propose the addition of a RangeSet type that can represent any number of positions, along with collection algorithms that operate on those positions.

Proposals in review

SE-0277: Float16 is under review.

Introduce the Float16 type conforming to the BinaryFloatingPoint and SIMDScalar protocols, binding the IEEE 754 binary16 format (aka float16, half-precision, or half), and bridged by the compiler to the C _Float16 type.

Old pitch thread: Add Float16.

SE-0274: Concise magic file names is under a second review.

Swift Forums

Tino Heth started an interesting discussion about Jargon & acronyms vs. accessible language.

When it comes to naming, I think it’s best to keep the majority in mind, and not trying to please a very small group by preferring their jargon. An expert may prefer his wording, but would certainly also understand common language easily.

Jeffrey Macko informed in a forum thread that support for semantic highlighting is moving on Microsoft’s end.

Matt Rips started a discussion about special case protocol conformance by explaining long-term tradeoffs for near-term conformance.

In short, the original pitch was to create a special-case, compiler-level mechanism to generate Equatable conformance for all tuples whose elements themselves conform to Equatable. The conformance would be automatic, without any means to opt-in or opt-out.

There exists a fairly wide-spread and long-standing desire to enable protocol conformance for tuples and perhaps other structural types, and especially so with respect to ubiquitous protocols, like Equatable, Comparable, Hashable and Codable. Presently, we are not in a position to facilitate custom protocol conformance as a general feature for tuples or other structural types. It is anticipated that that sort of feature will be created, eventually.

Taneer Nelson shared Swift on Server WorkGroup January 23rd, 2020 meeting notes. And Tom Doron February 6th, 2020 meeting recap.

Finally

Should a Swift library include a lot of Swift code? 🤔

A small change, but big impact. 🙃