Before you initiate a pull request, please read the process document. Ideas should be thoroughly discussed on the swift-evolution mailing list first.
This repository tracks the ongoing evolution of Swift. It contains:
- Goals for upcoming Swift releases (this document).
- The Swift evolution review schedule tracking proposals to change Swift.
- The Swift evolution process that governs the evolution of Swift.
- Commonly Rejected Changes, proposals which have been denied in the past.
This document describes goals for the Swift language on a per-release basis, usually listing minor releases adding to the currently shipping version and one major release out. Each release will have many smaller features or changes independent of these larger goals, and not all goals are reached for each release.
Goals for past versions are included at the bottom of the document for historical purposes, but are not necessarily indicative of the features shipped. The release notes for each shipped version are the definitive list of notable changes in each release.
Expected release date: Late 2016
The primary goal of this release is to solidify and mature the Swift language and development experience. While source breaking changes to the language have been the norm for Swift 1 through 3, we would like the Swift 3.x (and Swift 4+) languages to be as source compatible with Swift 3.0 as reasonably possible. However, this will still be best-effort: if there is a really good reason to make a breaking change beyond Swift 3, we will consider it and find the least invasive way to roll out that change (e.g. by having a long deprecation cycle).
To achieve this end, Swift 3 focuses on getting the basics right for the long term:
-
API design guidelines: The way in which Swift is used in popular libraries has almost as much of an effect on the character of Swift code as the Swift language itself. The API naming and design guidelines are a carefully crafted set of guidelines for building great Swift APIs.
-
Automatic application of naming guidelines to imported Objective-C APIs: When importing Objective-C APIs, the Swift 3 compiler automatically maps methods into the new Swift 3 naming guidelines, and provides a number of Objective-C features to control and adapt this importing.
-
Adoption of naming guidelines in key APIs: The Swift Standard Library has been significantly overhauled to embrace these guidelines, and key libraries like Foundation and libdispatch have seen major updates, which provide the consistent development experience we seek.
-
Swiftification of imported Objective-C APIs: Beyond the naming guidelines, Swift 3 provides an improved experience for working with Objective-C APIs. This includes importing Objective-C generic classes, providing the ability to import C APIs into an "Object Oriented" style, much nicer imported string enums, safer syntax to work with selectors and keypaths, etc.
-
Focus and refine the language: Since Swift 3 is the last release to make major source breaking changes, it is also the right release to reevaluate the syntax and semantics of the core language. This means that some obscure or problematic features will be removed, we focus on improving consistency of syntax in many small ways (e.g. by revising handling of parameter labels, and focus on forward looking improvements to the type system. This serves the overall goal of making Swift a simpler, more predictable, and more consistent language over the long term.
-
Improvements to tooling quality: The overall quality of the compiler is really important to us: it directly affects the joy of developing in Swift. Swift 3 focuses on fixing bugs in the compiler and IDE features, improving the speed of compile times and incremental builds, improving the performance of the generated code, improving the precision of error and warning messages, etc.
One of the reasons that stability is important is that portability to non-Apple systems is also a strong goal of Swift 3. This release enables broad scale adoption across multiple platforms, including significant functionality in the Swift core libraries (Foundation, libdispatch, XCTest, etc). A useful Linux/x86 port is already available (enabling many interesting server-side scenarios), and work is underway across the community to bring Swift to FreeBSD, Raspberry Pi, Android, Windows, and others. While we don't know which platforms will reach a useful state by the launch of Swift 3, significant effort continues to go into making the compiler and runtime as portable as practically possible.
Finally, Swift 3 also includes a mix of relatively small but important additions to the language and standard library that make solving common problems easier and make everything feel nicer. A detailed list of accepted proposals is included below:
- SE-0002: Removing currying
func
declaration syntax - SE-0003: Removing
var
from Function Parameters - SE-0004: Remove the
++
and--
operators - SE-0005: Better Translation of Objective-C APIs Into Swift
- SE-0006: Apply API Guidelines to the Standard Library
- SE-0007: Remove C-style for-loops with conditions and incrementers
- SE-0008: Add a Lazy flatMap for Sequences of Optionals
- SE-0016: Adding initializers to Int and UInt to convert from UnsafePointer and UnsafeMutablePointer
- SE-0017: Change
Unmanaged
to useUnsafePointer
- SE-0019: Swift Testing
- SE-0023: API Design Guidelines
- SE-0028: Modernizing Swift's Debugging Identifiers (_FILE_, etc)
- SE-0029: Remove implicit tuple splat behavior from function applications
- SE-0031: Adjusting inout Declarations for Type Decoration
- SE-0032: Add
first(where:)
method toSequenceType
- SE-0033: Import Objective-C Constants as Swift Types
- SE-0034: Disambiguating Line Control Statements from Debugging Identifiers
- SE-0037: Clarify interaction between comments & operators
- SE-0039: Modernizing Playground Literals
- SE-0040: Replacing Equal Signs with Colons For Attribute Arguments
- SE-0043: Declare variables in 'case' labels with multiple patterns
- SE-0044: Import as Member
- SE-0046: Establish consistent label behavior across all parameters including first labels
- SE-0047: Defaulting non-Void functions so they warn on unused results
- SE-0048: Generic Type Aliases
- SE-0049: Move @noescape and @autoclosure to be type attributes
- SE-0053: Remove explicit use of
let
from Function Parameters - SE-0054: Abolish
ImplicitlyUnwrappedOptional
type - SE-0055: Make unsafe pointer nullability explicit using Optional
- SE-0057: Importing Objective-C Lightweight Generics
- SE-0059: Update API Naming Guidelines and Rewrite Set APIs Accordingly
- SE-0061: Add Generic Result and Error Handling to autoreleasepool()
- SE-0062: Referencing Objective-C key-paths
- SE-0064: Referencing the Objective-C selector of property getters and setters
- SE-0065: A New Model For Collections and Indices
- SE-0066: Standardize function type argument syntax to require parentheses
- SE-0069: Mutability and Foundation Value Types
- SE-0070: Make Optional Requirements Objective-C-only
- SE-0071: Allow (most) keywords in member references
- SE-0072: Fully eliminate implicit bridging conversions from Swift
- SE-0085: Package Manager Command Names
- SE-0093: Adding a public
base
property to slices - SE-0094: Add sequence(first:next:) and sequence(state:next:) to the stdlib
This is the list of proposals which have been accepted for inclusion into Swift, but they are not implemented yet, and may not have anyone signed up to implement them. If they are not implemented in time for Swift 3, they will roll into a subsequent release.
- SE-0025: Scoped Access Level
- SE-0035: Limiting
inout
capture to@noescape
contexts - SE-0036: Requiring Leading Dot Prefixes for Enum Instance Member Implementations
- SE-0038: Package Manager C Language Target Support
- SE-0042: Flattening the function type of unapplied method references
- SE-0045: Add scan, prefix(while:), drop(while:), and iterate to the stdlib
- SE-0052: Change IteratorType post-nil guarantee
- SE-0060: Enforcing order of defaulted parameters
- SE-0063: SwiftPM System Module Search Paths
- SE-0067: Enhanced Floating Point Protocols
- SE-0068: Expanding Swift
Self
to class members and value types - SE-0075: Adding a Build Configuration Import Test
- SE-0076: Add overrides taking an UnsafePointer source to non-destructive copying methods on UnsafeMutablePointer
- SE-0080: Failable Numeric Conversion Initializers
- SE-0081: Move
where
clause to end of declaration - SE-0082: Package Manager Editable Packages
- SE-0088: Modernize libdispatch for Swift 3 naming conventions
- SE-0092: Typealiases in protocols and protocol extensions
- SE-0096: Converting dynamicType from a property to an operator
- SE-0099: Restructuring Condition Clauses
This release focused on fixing bugs, improving quality-of-implementation (QoI) with better warnings and diagnostics, improving compile times, and improving performance. It put some finishing touches on features introduced in Swift 2.0, and included some small additive features that don't break Swift code or fundamentally change the way Swift is used. As a step toward Swift 3, it introduced warnings about upcoming source-incompatible changes in Swift 3 so that users can begin migrating their code sooner.
Aside from warnings, a major goal of this release was to be as source compatible as practical with Swift 2.0.
- SE-0001: Allow (most) keywords as argument labels
- SE-0011: Replace
typealias
keyword withassociatedtype
for associated type declarations - SE-0014: Constraining
AnySequence.init
- SE-0015: Tuple comparison operators
- SE-0020: Swift Language Version Build Configuration
- SE-0021: Naming Functions with Argument Labels
- SE-0022: Referencing the Objective-C selector of a method
- SE-0009: Require self for accessing instance members
- SE-0010: Add StaticString.UnicodeScalarView
- SE-0012: Add
@noescape
to public library API - SE-0013: Remove Partial Application of Non-Final Super Methods (Swift 2.2)
- SE-0024: Optional Value Setter
??=
- SE-0027: Expose code unit initializers on String
- SE-0041: Updating Protocol Naming Conventions for Conversions
- SE-0051: Conventionalizing stride semantics
- SE-0056: Allow trailing closures in
guard
conditions - SE-0073: Marking closures as executing exactly once
- SE-0074: Implementation of Binary Search functions
- SE-0084: Allow trailing commas in parameter lists and tuples
- SE-0087: Rename
lazy
to@lazy
- SE-0097: Normalizing naming for "negative" attributes
- SE-0098: Lowercase
didSet
andwillSet
for more consistent keyword casing
Swift Evolution Review Schedule
- SE-0018: Flexible Memberwise Initialization
- SE-0030: Property Behaviors
- SE-0050: Decoupling Floating Point Strides from Generic Implementations
- SE-0095: Replace
protocol<P1,P2>
syntax withAny<P1,P2>
- SE-0026: Abstract classes and methods
- SE-0058: Allow Swift types to provide custom Objective-C representations
- SE-0078: Implement a rotate algorithm, equivalent to std::rotate() in C++
- SE-0083: Remove bridging conversion behavior from dynamic casts
- SE-0090: Remove
.self
and freely allow type references in expressions