Give your simulator superpowers

RocketSim: An Essential Developer Tool
as recommended by Apple

Swift Evolution: Reading and learning from proposals

The Swift Programming Language constantly evolves, and most of its changes result from public proposals inside the Swift Evolution repository. The proposals can tell you what changes are coming up next, which is excellent if you want to stay updated with the latest developments.

Swift Evolution Proposals can also help you understand newly released features. Each proposal contains several sections like motivation, proposed solution, and alternatives considered. My journey always starts with the relevant proposal whenever I’m exploring a new language feature.

What is Swift Evolution?

The Swift Programming Language is open-sourced, and anyone with a good idea can help shape future features and directions. All suggested language proposals are discussed on the public forum to get to the best possible solution. Eventually, a proposal will be refined and approved, before it becomes a release goal. All the release goals are tracked as a feature of an upcoming version of Swift and can be explored via the official Swift site:

You can explore Swift Evolution proposals via the official Swift website.
You can explore Swift Evolution proposals via the official Swift website.

The Swift Evolution repository contains all the goals and proposals for upcoming major and minor Swift releases. Each proposal has to follow the Swift Evolution Process instructions to ensure consistency between ideas, resulting in similar documents and structured steps toward proposing, discussing, reviewing, and accepting language improvements. The Swift core team defines goals for both minor and major releases.

How do you stay current as a Swift developer?

Let me do the hard work and join 19,144 developers that stay up to date using my weekly newsletter:

Who creates and reviews the proposals?

Anyone can create the proposals if they follow the Swift Evolution Process instructions. Once made, proposals are discussed on the forums where anyone can share their opinion.

For example, SE-0199 by Chris Eidhof proposed the introduction of a new toggle method:

/// Toggling a boolean. 
/// Instead of writing:
isPro = !isPro

/// The proposal suggested to introduce:
isPro.toggle()

Ben Cohen became the review manager and started a forum review thread. While the core team and workgroups make final decisions, everyone can share their opinion and influence the direction by replying in the review thread. If you decide to reply, make sure to follow the proposal review instructions.

The road from opening a proposal to getting it into a Swift Release

Each proposal can be in several states. The Swift Evolution Process documentation contains the following image:

Each Swift Evolution Proposal can be in different states.
Each Swift Evolution Proposal can be in different states.

As you can see, a proposal must go through several states before being implemented or withdrawn. I recommend reading the states section in the process document for an up-to-date overview of all states and their descriptions.

Exploring Vision documents

The Swift Evolution repository doesn’t only contains proposals. There are three kinds of documents commonly used in the evolution process:

  • Proposals that describe a proposed improvement in detail (e.g. boolean toggle)
  • Roadmaps to describe a concrete plan for complex, potentially more significant changes
  • Vision documents to describe a high-level design for a broad topic

Vision documents interest me, especially when a feature has already been released. For example, I’ve been looking into Swift Macros lately, and the Vision for Macros in Swift has been a great resource for better understanding the idea behind macros. Take the following quote as an example:

As a project, a macro system should reduce the desire for new syntactic-sugar features, leaving more time for more transformative feature work.

In other words, Macros help the core team focus on more transformative and fundamental work while the community can work on syntactic-sugar features. The vision document even mentions existing features like Codable and Property Wrappers that might have been macros if they existed before.

Conclusion

While you’re not required to read through proposals or vision documents to get the most out of Swift, it can be a great way to fully understand the idea behind a specific language improvement. The Swift Evolution process allows anyone to propose language changes while maintaining a structured way of handling proposals. The Swift forums are a great way to stay up to date on new progress or to share your opinion on a potential change.

If you like to improve your Swift knowledge, even more, check out the Swift category page. Feel free to contact me or tweet to me on Twitter if you have any additional tips or feedback.

Thanks!

 
Antoine van der Lee

Written by

Antoine van der Lee

iOS Developer since 2010, former Staff iOS Engineer at WeTransfer and currently full-time Indie Developer & Founder at SwiftLee. Writing a new blog post every week related to Swift, iOS and Xcode. Regular speaker and workshop host.

Are you ready to

Turn your side projects into independence?

Learn my proven steps to transform your passion into profit.