Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Swift 5.10 release blog post #542

Merged
merged 15 commits into from
Mar 5, 2024
Merged

Conversation

hborla
Copy link
Member

@hborla hborla commented Feb 15, 2024

No description provided.

_posts/NNNN-NN-NN-swift-5.10-released.md Outdated Show resolved Hide resolved
_posts/NNNN-NN-NN-swift-5.10-released.md Outdated Show resolved Hide resolved
_posts/NNNN-NN-NN-swift-5.10-released.md Outdated Show resolved Hide resolved
_posts/NNNN-NN-NN-swift-5.10-released.md Outdated Show resolved Hide resolved

Full data isolation in Swift 5.10 is the precursor to Swift 6. Swift 6 will enforce full data isolation by default, and we will embark upon the transition to eliminate data races across the Swift ecosystem.

Read on to learn about full data isolation in Swift 5.10, new unsafe opt outs for actor isolation checking, and the remaining concurrency evolution ahead of Swift 6.
Copy link
Contributor

@dempseyatgithub dempseyatgithub Feb 19, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe this would be where to add the call to action, possibly replacing "and the remaining concurrency evolution ahead of Swift 6." with "and how you can prepare for Swift 6 and provide feedback by enabling complete concurrency checking in your projects."

Co-authored-by: James Dempsey <dempsey@tapas-software.net>
@hborla
Copy link
Member Author

hborla commented Mar 3, 2024

@dempseyatgithub thank you so much for the thorough constructive feedback!

@hborla
Copy link
Member Author

hborla commented Mar 3, 2024

Marking as ready for review, though I'm still working through a few more bits of feedback in the introduction and next steps.

@hborla hborla marked this pull request as ready for review March 3, 2024 19:09
_posts/NNNN-NN-NN-swift-5.10-released.md Outdated Show resolved Hide resolved
_posts/NNNN-NN-NN-swift-5.10-released.md Outdated Show resolved Hide resolved
_posts/NNNN-NN-NN-swift-5.10-released.md Outdated Show resolved Hide resolved
_posts/NNNN-NN-NN-swift-5.10-released.md Outdated Show resolved Hide resolved
_posts/NNNN-NN-NN-swift-5.10-released.md Outdated Show resolved Hide resolved
_posts/NNNN-NN-NN-swift-5.10-released.md Outdated Show resolved Hide resolved
documentation/concurrency/index.md Show resolved Hide resolved
)
```

When using Swift 6.0 tools or later, use [`SwiftSetting.enableUpcomingFeature`](https://developer.apple.com/documentation/packagedescription/swiftsetting/enableupcomingfeature(_:_:)) in the Swift settings for the given target:
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
When using Swift 6.0 tools or later, use [`SwiftSetting.enableUpcomingFeature`](https://developer.apple.com/documentation/packagedescription/swiftsetting/enableupcomingfeature(_:_:)) in the Swift settings for the given target:
When using Swift 6.0 tools or later in Swift 5 language mode, use [`SwiftSetting.enableUpcomingFeature`](https://developer.apple.com/documentation/packagedescription/swiftsetting/enableupcomingfeature(_:_:)) in the Swift settings for the given target:

I believe it is the case that Swift 6.0 tools using Swift 6 languages mode will always have strict concurrency checking. So this flag would only be useful for Swift 5 language mode. I proposed that change to clarify for the reader.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'll clarify this at the start of the document, because all of these instructions only apply when building with -swift-version 5.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hmm, I already tried to say this in the intro of the document

Data-race safety in the Swift 6 language mode is designed for incremental migration. You can address data-race safety issues in your projects module-by-module, and you can enable the compiler's actor isolation and Sendable checking as warnings in the Swift 5 language mode, allowing you to assess your progress toward eliminating data races before turning on the Swift 6 language mode.

Complete data-race safety checking can be enabled as warnings in the Swift 5 language mode using the -strict-concurrency compiler flag.

Do you think this is not sufficient? I understand that a lot of folks don't really understand the difference between Swift tools version vs Swift language version, but is this the right document to explain that difference?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't think it would hurt to include it here for clarity. I think sometimes people skim or skip the overview and skip down to the 'how to' instructions.

I agree this isn't the right place to explain the difference between compiler version and language mode, but I think mentioning it here lets readers know it exists.

@dempseyatgithub
Copy link
Contributor

There should be an entry added to the Articles section of _data/documentation.yaml so the new Enabling Complete Concurrency Checking article appears in the list of articles on the documentation page.

If time is of the essence, this could be done as a follow-on PR after the initial posting.

  - title: Enabling Complete Concurrency Checking
    url: /documentation/concurrency/
    description: |
      Enable complete concurrency checking in your SwiftPM packages, Xcode projects, and CI scripts to prepare for Swift 6.

@shahmishal
Copy link
Member

@swift-ci test

@shahmishal shahmishal changed the title Add a draft of the 5.10 release blog post. Swift 5.10 release blog post Mar 5, 2024
@shahmishal shahmishal merged commit f09b975 into swiftlang:main Mar 5, 2024
1 check passed
cthielen pushed a commit to Joannis/swift-org-website that referenced this pull request Mar 26, 2024
* Add a draft of the 5.10 release blog post.

* Grammar correction: opt out -> opt-out

Co-authored-by: James Dempsey <dempsey@tapas-software.net>

* Improve the structure of the introduction.

* Explain why unsafe opt-outs are important.

* Add a link to instructions for enabling complete concurrency checking.

* Improve the Next Steps section.

* Separate out the content on language evolution ahead of Swift 6 from the
next steps.

* Provide more context about data races in the introduction.

* Improve the instructions for enabling strict concurrency in SwiftPM.

* Add a few more explanations to the code examples in the data race safety
section.

* Clarify that the Swift 6 language mode is opt-in in the intro.

* Correct the name of the Xcode build setting for strict concurrency.

* Editorial pass

* Update the `nonisolated(unsafe)` code example to avoid a compiler bug.

* Update the date for the blog post

---------

Co-authored-by: James Dempsey <dempsey@tapas-software.net>
Co-authored-by: Mishal Shah <shahmishal@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

7 participants