Issue #171 22 Oct 2020
Written by: Kristaps Grinbergs
The last two weeks were somewhat slow in the Swift open source world but then Apple published yet another open-source library - Swift Service Discovery. Apart from the announcement of the new iPhones we had some weird times with Xcode 12.1 and 12.2 beta 3 🤔.
To continue sending out this newsletter to your emails, we are looking for sponsors to cover the cost of the platform we are using. More info about that can be found here. Or you can reach out to me personally on Twitter @fassko. Thanks! 🙏
Interested in sponsoring Swift Weekly Brief? Learn more here.
Podcasts
In the latest episode of Swift Unwrapped, Jesse and JP talk about Implementing the Swift Runtime in Swift, with Jordan Rose.
News and community
Yim Lee wrote a blog post to announce a new open-source project for the Swift Server ecosystem, Swift Service Discovery.
The vapor team announced notable core team changes.
David Smith tweeted a refresher about copy-on-write values in Swift.
Commits and pull requests
Slava Pestov merged a pull request that removes 3 of our name lookup implementations in favor of the shiny new ASTScope
, the 4th implementation to rule them all. Now, 1 is gone entirely and 1 is off by default. Also, this six-year old (!) feature request fell out easily. This fixes SR-10069.
Zoe Carver opened a pull request that adds rudimentary support for C++ template functions in Swift.
Keith Smiley created a pull request that adds a check validating the current Xcode version is supported for building. It also fixes SR-13497.
Luciano Almeida merged a pull request fixes the crash on simplifyFix
constraint for tuple mismatch and fixes SR-13732.
tbkka created a pull request that replaces the current implementation of description
and
debugDescription
for the standard floating-point types with a new
formatting routine that provides both improved performance and
better results. It fixes multiple bugs - SR-106, SR-454, SR-491, SR-3131.
Swift Forums
ArtemC shared [an update] about swift-driver project.
After its announcement almost exactly a year ago, the swift-driver project is moving full-steam-ahead towards the goal of replacing its C++ predecessor. Recent weeks saw a large amount of activity on the swift-driver repository towards achieving that goal.
staticVoidMan started a discussion about proposal to pad Arrays
till a certain minimum length.
This will be useful when the array is of an arbitrary length but we need at least some minimum length to work with, so padding the array with default values is a conventional way to handle such a scenario.
let arr = [10,20,30] let res = arr.padding(repeating: 0, inLength: 7) print(res) // -> [10,20,30,0,0,0,0]
Morten Bek Ditlevsen asked a question how to test stdlib
. Lot of people replied with information that can be helpful in future.
Frederick Kellison-Linn pitched a proposal about placeholder types (formerly “partial type annotations”).
When Swift’s type inference is unable to work out the type of a particular expression, it requires the programmer to provide the necessary type context explicitly. However, all mechanisms for doing this require the user to write out the entire type signature, even if only one portion of that type is actually needed by the compiler.
Swift-evolution thread: Partial type annotations
Finally
Imagine doctors being like “side project checkkkkk 🥼😷👩⚕️”