A packed week with some exciting announcements. And an Apple event coming up on October 30th. And Swift Unwrapped is back! Cool stuff.

Interested in sponsoring Swift Weekly Brief? Learn more here.

Starter tasks

  • SR-8788 [Compiler] Rethrowing/convenience initializer does not compile
  • SR-8811 [Compiler] Diagnosing Implicit Accessors for Uninhabited Types Should Be Smarter
  • SR-8905 [Standard Library] Gaps in String benchmarking
  • SR-8908 [Standard Library] Add insert(_:Character) benchmarks in RangeReplaceableCollection

Swift Unwrapped

Swift Unwrapped is back! In episode 67, Jesse and JP discuss Raw Strings.

News and community

FoundationDB has announced official Swift bindings!

Jetbrains added support for the Swift Package Manager in their C IDE, CLion.

Ankit Aggarwal wrote a blog post now that Swift Packages have Read Evaluate Print Loop (REPL) support!

Richard Wei wrote a manifesto on first-class automatic differentiation in Swift, written for both the machine learning community and the Swift programming language design community, with a strong focus on language design.

Commits and pull requests

Slava Pestov merged a pull request that fixes crashes and allows both spellings for protocols with where clauses. If you would like to know more, see this thread.

Doug Gregor merged a pull request replacing associated type metadata accessors with mangled strings, bringing both code size and runtime performance improvements!

Returned proposals

SE-0229: SIMD Vectors is intended to be accepted.

The core team feels this is an important addition to the language that will open up SIMD programming to a wide audience in an approachable way.

The majority of the feedback received during the thread was regarding the alternate “generic” spelling: Vector3<Int8> rather than Int8.Vector3.

It is still unclear which is the better form. However, in order to better make the decision, the core team has asked the proposal author to implement a prototype showing the alternate form. Reviewers will then be able to try out either form in order to help make the decision.

In addition, the proposal should be revised to spell out more explicitly some of the details, for example, of what masks are and the role they play.

Proposals in review

SE-0231: Optional Iteration is under review.

Optionals are a key feature of Swift and a powerful tool that seamlessly interacts with code. In particular, they serve a great means in expressing “act accordingly if there’s a value, skip otherwise”. Some vivid examples of such behavior are optional chaining, optional invocation foo?(), if let, optional patterns, optional assignments and guard let. This proposal considers further supporting this convenience in for-in loops.

Swift Forums

Argyrios Kyrtzidis announced Language Service Protocol support for Swift and C-family languages!

At Apple we are making it a priority to support high-quality tooling for all Swift developers, including those working on non-Apple platforms. We want to collaborate with the open-source community and focus our efforts on building common infrastructure that can be shared by Xcode and other editors and platforms.

To that end, I’m excited to announce that we are going to start a new open-source project for a Swift and C-family language service based on the Language Server Protocol. We’ve chosen to adopt LSP so we can benefit from its active community and wide adoption across other editors and platforms. This means that Visual Studio Code, Atom, Sublime Text, or whatever your favorite editor happens to be, can use the same service as Xcode, and any improvements we make to the service will benefit them all.

To add to what Ben mentioned, the new service will be written in Swift so it could use SwiftSyntax and any other functionality written on top of SwiftSyntax, like formatting.

Xi Ge announced an ABI stability checker for the Swift standard library.

We’ve started testing the ABI stability of the Swift standard library as part of Swift regression testing.

[It] will check whether the change has broken the ABI stability of a previously checked-in baseline. If it does, a test failure will occur in stability-stdlib-abi.swift. To resolve this test failure, we can either update the expected ABI breakage list in stability-stdlib-abi.swift.expected or update the PR to remedy those breakages.

Steve Canon pitched [a proposal(https://forums.swift.org/t/comparable-and-floatingpoint-types/16886) regarding comparability of Floating point types.

The Comparable and Equatable protocols want to imply a total order. This is mostly satisfied by FloatingPoint types, except for the behavior with NaNs. A total order requires that for any a and b, either a ≤ b or a ≥ b is true. But IEEE 754 requires that if either a or b is NaN, both of those comparisons are false.


How to write a proposal.