Skip to content

Commit 02ad2bc

Browse files
authored
Update README, process, and proposal template for Swift 4 stage 1. (#541)
* Update README, process, and proposal template for Swift 4 stage 1. * Fix minor review comments * Move information about previous releases into separate files. Moving out information about Swift 2.2 and Swift 3.0 allows us to be more verbody there (about which proposals were implemented in a release) and keep the README more forward-looking. * Fix a typo in the README
1 parent 318d1df commit 02ad2bc

File tree

5 files changed

+296
-97
lines changed

5 files changed

+296
-97
lines changed

0000-template.md

Lines changed: 49 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -44,13 +44,55 @@ comments detailing what it does. The detail in this section should be
4444
sufficient for someone who is *not* one of the authors to be able to
4545
reasonably implement the feature.
4646

47-
## Impact on existing code
48-
49-
Describe the impact that this change will have on existing code. Will some
50-
Swift applications stop compiling due to this change? Will applications still
51-
compile but produce different behavior than they used to? Is it
52-
possible to migrate existing Swift code to use a new feature or API
53-
automatically?
47+
## Source compatibility
48+
49+
Relative to the Swift 3 evolution process, the source compatibility
50+
requirements for Swift 4 are *much* more stringent: we should only
51+
break source compatibility if the Swift 3 constructs were actively
52+
harmful in some way, the volume of affected Swift 3 code is relatively
53+
small, and we can provide source compatibility (in Swift 3
54+
compatibility mode) and migration.
55+
56+
Will existing correct Swift 3 or Swift 4 applications stop compiling
57+
due to this change? Will applications still compile but produce
58+
different behavior than they used to? If "yes" to either of these, is
59+
it possible for the Swift 4 compiler to accept the old syntax in its
60+
Swift 3 compatibility mode? Is it possible to automatically migrate
61+
from the old syntax to the new syntax? Can Swift applications be
62+
written in a common subset that works both with Swift 3 and Swift 4 to
63+
aid in migration?
64+
65+
## Effect on ABI stability
66+
67+
Does the proposal change the ABI of existing language features? The
68+
ABI comprises all aspects of the code generation model and interaction
69+
with the Swift runtime, including such things as calling conventions,
70+
the layout of data types, and the behavior of dynamic features in the
71+
language (reflection, dynamic dispatch, dynamic casting via `as?`,
72+
etc.). Purely syntactic changes rarely change existing ABI. Additive
73+
features may extend the ABI but, unless they extend some fundamental
74+
runtime behavior (such as the aforementioned dynamic features), they
75+
won't change the existing ABI.
76+
77+
Features that don't change the existing ABI are considered out of
78+
scope for [Swift 4 stage 1](README.md). However, additive features
79+
that would reshape the standard library in a way that changes its ABI,
80+
such as [where clauses for associated
81+
types](https://github.com/apple/swift-evolution/blob/master/proposals/0142-associated-types-constraints.md),
82+
can be in scope. If this proposal could be used to improve the
83+
standard library in ways that would affect its ABI, describe them
84+
here.
85+
86+
## Effect on API resilience
87+
88+
API resilience describes the changes one can make to a public API
89+
without breaking its ABI. Does this proposal introduce features that
90+
would become part of a public API? If so, what kinds of changes can be
91+
made without breaking ABI? Can this feature be added/removed without
92+
breaking ABI? For more information about the resilience model, see the
93+
[library evolution
94+
document](https://github.com/apple/swift/blob/master/docs/LibraryEvolution.rst)
95+
in the Swift repository.
5496

5597
## Alternatives considered
5698

README.md

Lines changed: 75 additions & 89 deletions
Original file line numberDiff line numberDiff line change
@@ -20,94 +20,80 @@ historical purposes, but are not necessarily indicative of the
2020
features shipped. The release notes for each shipped version are the
2121
definitive list of notable changes in each release.
2222

23-
## Development major version: Swift 3.0
24-
25-
Expected release date: Late 2016
26-
27-
The primary goal of this release is to solidify and mature the Swift language and
28-
development experience. While source breaking changes to the language have been
29-
the norm for Swift 1 through 3, we would like the Swift 3.x (and Swift 4+)
30-
languages to be as *source compatible* with Swift 3.0 as reasonably possible.
31-
However, this will still be best-effort: if there is a really good reason to
32-
make a breaking change beyond Swift 3, we will consider it and find the least
33-
invasive way to roll out that change (e.g. by having a long deprecation cycle).
34-
35-
To achieve this end, Swift 3 focuses on getting the basics right for the
36-
long term:
37-
38-
* **API design guidelines**: The way in which Swift is used in popular
39-
libraries has almost as much of an effect on the character of Swift
40-
code as the Swift language itself. The [API naming and design
41-
guidelines](https://swift.org/documentation/api-design-guidelines/) are a
42-
carefully crafted set of guidelines for building great Swift APIs.
43-
44-
* **Automatic application of naming guidelines to imported Objective-C APIs**:
45-
When importing Objective-C APIs, the Swift 3 compiler
46-
[automatically maps](proposals/0005-objective-c-name-translation.md) methods
47-
into the new Swift 3 naming guidelines, and provides a number of Objective-C
48-
features to control and adapt this importing.
49-
50-
* **Adoption of naming guidelines in key APIs**: The Swift Standard Library has
51-
been significantly overhauled to embrace these guidelines, and key libraries
52-
like [Foundation](proposals/0069-swift-mutability-for-foundation.md) and
53-
[libdispatch](proposals/0088-libdispatch-for-swift3.md) have seen major
54-
updates, which provide the consistent development experience we seek.
55-
56-
* **Swiftification of imported Objective-C APIs**: Beyond the naming guidelines,
57-
Swift 3 provides an improved experience for working with Objective-C APIs.
58-
This includes importing
59-
[Objective-C generic classes](proposals/0057-importing-objc-generics.md),
60-
providing the ability to [import C APIs](proposals/0044-import-as-member.md)
61-
into an "Object Oriented" style, much nicer
62-
[imported string enums](proposals/0033-import-objc-constants.md), safer
63-
syntax to work with [selectors](proposals/0022-objc-selectors.md) and
64-
[keypaths](proposals/0062-objc-keypaths.md), etc.
65-
66-
* **Focus and refine the language**: Since Swift 3 is the last release to make
67-
major source breaking changes, it is also the right release to reevaluate the
68-
syntax and semantics of the core language. This means that some obscure or
69-
problematic features will be removed, we focus on improving consistency of
70-
syntax in many small ways (e.g. by
71-
[revising handling of parameter labels](proposals/0046-first-label.md), and
72-
focus on forward looking improvements to the type system. This serves the
73-
overall goal of making Swift a simpler, more predictable, and more consistent
74-
language over the long term.
75-
76-
* **Improvements to tooling quality**: The overall quality of the compiler is
77-
really important to us: it directly affects the joy of developing in Swift.
78-
Swift 3 focuses on fixing bugs in the compiler and IDE features, improving the
79-
speed of compile times and incremental builds, improving the performance of
80-
the generated code, improving the precision of error and warning messages, etc.
81-
82-
One of the reasons that stability is important is that **portability** to non-Apple
83-
systems is also a strong goal of Swift 3. This release enables
84-
broad scale adoption across multiple platforms, including significant
85-
functionality in the [Swift core libraries](https://swift.org/core-libraries/)
86-
(Foundation, libdispatch, XCTest, etc). A useful Linux/x86 port is
87-
already available (enabling many interesting server-side scenarios), and work is
88-
underway across the community to bring Swift to FreeBSD, Raspberry Pi, Android,
89-
Windows, and others. While we don't know which platforms will reach a useful
90-
state by the launch of Swift 3, significant effort continues to go into making
91-
the compiler and runtime as portable as practically possible.
92-
93-
Finally, Swift 3 also includes a mix of relatively small but important additions
94-
to the language and standard library that make solving common problems easier and
95-
make everything feel nicer. A detailed list of accepted proposals is included
96-
on the [proposal status page][proposal-status].
97-
98-
99-
## Swift 2.2 - Released on March 21, 2016
100-
101-
[This release](https://swift.org/blog/swift-2-2-released/) focused on fixing
102-
bugs, improving quality-of-implementation (QoI)
103-
with better warnings and diagnostics, improving compile times, and improving
104-
performance. It put some finishing touches on features introduced in Swift 2.0,
105-
and included some small additive features that don't break Swift code or
106-
fundamentally change the way Swift is used. As a step toward Swift 3, it
107-
introduced warnings about upcoming source-incompatible changes in Swift 3
108-
so that users can begin migrating their code sooner.
109-
110-
Aside from warnings, a major goal of this release was to be as source compatible
111-
as practical with Swift 2.0.
23+
## Development major version: Swift 4.0
24+
25+
Expected release date: Late 2017
26+
27+
The Swift 4 release is designed around two primary goals: to provide
28+
source stability for Swift 3 code and to provide ABI stability for the
29+
Swift standard library. To that end, the Swift 4 release will be
30+
divided into two stages.
31+
32+
Stage 1 focuses on the essentials required for source and ABI
33+
stability. Features that don't fundamentally change the ABI of
34+
existing language features or imply an ABI-breaking change to the
35+
standard library will not be considered in this stage.
36+
37+
Stage 2 will commence once the implementation work on the Stage 1
38+
features is cresting, and can contain a few other large and small
39+
features. We expect that stage 2 will commence some time in Spring
40+
2017.
41+
42+
The high-priority features supporting stage 1's source and ABI
43+
stability goals are:
44+
45+
* Source stability features: the Swift language will need [some
46+
accommodations](https://github.com/apple/swift-evolution/blob/master/proposals/0141-available-by-swift-version.md)
47+
to support code bases that target different language versions, to
48+
help Swift deliver on its source-compatibility goals while still
49+
enabling rapid progress.
50+
51+
* Resilience: resilience provides a way for public APIs to evolve over
52+
time, while maintaining a stable ABI. For example, resilience
53+
eliminates the [fragile base class
54+
problem](https://en.wikipedia.org/wiki/Fragile_base_class) that
55+
occurs in some object-oriented languages (e.g., C++) by describing
56+
the types of API changes that can be made without breaking ABI
57+
(e.g., "a new stored property or method can be added to a class").
58+
59+
* Stabilizing the ABI: There are a ton of small details that need to
60+
be audited and improved in the code generation model, including
61+
interaction with the Swift runtime. While not specifically
62+
user-facing, the decisions here affect performance and (in some rare
63+
cases) the future evolution of Swift.
64+
65+
* Generics improvements needed by the standard library: the standard
66+
library has a number of workarounds for language deficiencies, many
67+
of which manifest as extraneous underscored protocols and
68+
workarounds. If the underlying language deficiencies remain, they
69+
become a permanent part of the stable ABI. [Conditional
70+
conformances](https://github.com/apple/swift-evolution/blob/master/proposals/0143-conditional-conformances.md),
71+
[recursive protocol
72+
requirements](https://github.com/apple/swift/blob/master/docs/GenericsManifesto.md#recursive-protocol-constraints-),
73+
and [where clauses for associated
74+
types](https://github.com/apple/swift-evolution/blob/master/proposals/0142-associated-types-constraints.md)
75+
are known to be in this category, but it's plausible that other
76+
features will be in scope if they would be used in the standard
77+
library.
78+
79+
* String re-evaluation: String is one of the most important
80+
fundamental types in the language. Swift 4 seeks to make strings more
81+
powerful and easier-to-use, while retaining Unicode correctness by
82+
default.
83+
84+
* Memory ownership model: an (opt-in) Cyclone/Rust-inspired memory
85+
ownership model is highly desired by systems programmers and for
86+
other high-performance applications that want predictible and
87+
deterministic performance. This feature will fundamentally shape the
88+
ABI, from low-level language concerns such as "inout" and low-level
89+
"addressors" to its impact on the standard library. While a full
90+
memory ownership model is likely too large for Swift 4 stage 1, we
91+
need a comprehensive design to understand how it will change the
92+
ABI.
93+
94+
## Previous releases
95+
96+
* [Swift 3.0](releases/swift-3_0.md) - Released on September 13, 2016
97+
* [Swift 2.2](releases/swift-2_2.md) - Released on March 21, 2016
11298

11399
[proposal-status]: https://apple.github.io/swift-evolution/

process.md

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,12 @@ Please state explicitly whether you believe that the proposal should be accepted
4545
## How to propose a change
4646

4747
* **Check prior proposals**: many ideas come up frequently, and may either be in active discussion on the mailing list, or may have been discussed already and have joined the [Commonly Rejected Proposals](commonly_proposed.md) list. Please check the mailing list archives and this list for context before proposing something new.
48-
48+
* **Consider the goals of the upcoming Swift release**: Each major
49+
Swift release is focused on a [specific set of goals](README.md)
50+
described early in the release cycle. When proposing a change to
51+
Swift, please consider how your proposal fits in with the larger goals
52+
of the upcoming Swift release. Proposals that are clearly out of scope
53+
for the upcoming Swift release will not be brought up for review. If you can't resist discussing a proposal that you know is out of scope, please include the tag `[Out of scope]` in the subject.
4954
* **Socialize the idea**: propose a rough sketch of the idea on the [swift-evolution mailing list][swift-evolution-mailing-list], the problems it solves, what the solution looks like, etc., to gauge interest from the community.
5055
* **Develop the proposal**: expand the rough sketch into a complete proposal, using the [proposal template](0000-template.md), and continue to refine the proposal on the evolution mailing list. Prototyping an implementation and its uses along with the proposal is encouraged, because it helps ensure both technical feasibility of the proposal as well as validating that the proposal solves the problems it is meant to solve.
5156
* **Request a review**: initiate a pull request to the [swift-evolution repository][swift-evolution-repo] to indicate to the core team that you would like the proposal to be reviewed. When the proposal is sufficiently detailed and clear, and addresses feedback from earlier discussions of the idea, the pull request will be accepted. The proposal will be assigned a proposal number as well as a core team member to manage the review.

releases/swift-2_2.md

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
# Swift 2.2 - Released on March 21, 2016
2+
3+
[This release](https://swift.org/blog/swift-2-2-released/) focused on fixing
4+
bugs, improving quality-of-implementation (QoI)
5+
with better warnings and diagnostics, improving compile times, and improving
6+
performance. It put some finishing touches on features introduced in Swift 2.0,
7+
and included some small additive features that don't break Swift code or
8+
fundamentally change the way Swift is used. As a step toward Swift 3, it
9+
introduced warnings about upcoming source-incompatible changes in Swift 3
10+
so that users can begin migrating their code sooner.
11+
12+
Aside from warnings, a major goal of this release was to be as source compatible
13+
as practical with Swift 2.0.
14+
15+
## Evolution proposals included in Swift 2.2
16+
17+
* [SE-0001: Allow (most) keywords as argument labels](https://github.com/apple/swift-evolution/blob/master/proposals/0001-keywords-as-argument-labels.md)
18+
* [SE-0015: Tuple comparison operators](https://github.com/apple/swift-evolution/blob/master/proposals/0015-tuple-comparison-operators.md)
19+
* [SE-0014: Constraining `AnySequence.init`](https://github.com/apple/swift-evolution/blob/master/proposals/0014-constrained-AnySequence.md)
20+
* [SE-0011: Replace `typealias` keyword with `associatedtype` for associated type declarations](https://github.com/apple/swift-evolution/blob/master/proposals/0011-replace-typealias-associated.md)
21+
* [SE-0021: Naming Functions with Argument Labels](https://github.com/apple/swift-evolution/blob/master/proposals/0021-generalized-naming.md)
22+
* [SE-0022: Referencing the Objective-C selector of a method](https://github.com/apple/swift-evolution/blob/master/proposals/0022-objc-selectors.md)
23+
* [SE-0020: Swift Language Version Build Configuration](https://github.com/apple/swift-evolution/blob/master/proposals/0020-if-swift-version.md)

0 commit comments

Comments
 (0)