Actors are reference types, but why classes?
The recently announced Swift Concurrency Roadmap includes the proposal of an Actor reference type, similar to a class type. In this whitepaper, Chris Lattner explores the behavior and requirements of actors and proposes that Actor types be modeled as a new kind of nominal reference type in Swift.
Posted on December 16, 2020
#concurrency
#evolution
#actor
Codable synthesis for enums with associated values
Swift 4 introduced support for automatically synthesizing conformance to the Encodable and Decodable protocols. It's a useful feature, most likely used by any application which handles JSON-based network requests. This Swift evolution pitch from Dario Rexin proposes extending auto-synthesis of these conformances to enums with associated values. I'm sure we will see this in an upcoming Swift version.
Posted on December 8, 2020
#evolution
#enum
#codable
Availability checking for protocol conformances
Swift's availability checking feature currently allows us to check if a referenced declaration is available at runtime. In this post from the official Swift forums, Slava Pestov details an extension to this feature which provides the ability to check the availability of protocol conformances.
Posted on November 30, 2020
#evolution
#protocol
[Proposal] Static member lookup on protocol metatypes
Swift currently supports static member lookup on concrete types. This improves call-site legibility by enabling us to use leading dot syntax when accessing static values. In this Swift evolution pitch, Sam Lazarus proposes extending static member lookup to protocol metatypes. This would be a nice addition, and would not have any effect of source of API stability.
Posted on November 22, 2020
#evolution
#protocol
Swift Concurrency Roadmap
This post from the official Swift forums outlines the Swift Concurrency Roadmap. The goal of this roadmap is to make concurrent programming in Swift convenient, efficient, and safe. There is a lot to unpack in this post, but it's definitely worth reading, and there are some great language features planned for the first phase of the roadmap.
Posted on November 9, 2020
#concurrency
#evolution
Placeholder types
Building on a previous Swift evolution thread, Frederick Kellison-Linn pitches a proposal to add what he calls placeholder types to Swift. These placeholder types could be used when we want to explicitly provide some type information but also want the compiler to infer some type information.
Posted on November 4, 2020
#evolution
#compiler
Unlock Existential Types for All Protocols
Swift currently allows protocols that meet certain criteria to be used as types. Using a protocol in such a way essentially creates an existential type. However, protocols with associated type or self requirements cannot currently be used to create such existential types. This Swift evolution pitch proposes removing this restriction.
Posted on October 22, 2020
#evolution
#protocol
#existential
Result builders
This Swift evolution proposal outlines the motivation and design for Result Builders, the Swift language feature previously known as Function Builders. Result Builders have been an available feature since Swift 5.1, albeit slightly hidden, and its implementation and capabilities have evolved since then.
Posted on October 18, 2020
#evolution
#result builders
Announcing Swift Algorithms
Swift Algorithms is a new open-source Swift package of sequence and collection algorithms. In this post, Nate Cook from the Swift standard library team at Apple gives a brief tour of this package and describes its relation to the Swift standard library.
Posted on October 15, 2020
#open-source
#collection
#sequence
#algorithm
#evolution
Standard library behavior change for LazyMapCollection prefix to act as a Sequence
The Swift standard library provides lazy variations of its Sequence and Collection types, on which operations such as map and filter are implemented lazily. This means that the actual computations will only occur when the results are needed. In this Swift evolution pitch, Greg Titus proposes an addition to the standard library that improves the behavior of the LazyMapCollection type.
Posted on September 16, 2020
#evolution
#collection
#sequence