diff --git a/_posts/2023-08-29-swift-5.9-released.md b/_posts/2023-08-29-swift-5.9-released.md index 3d948ec33..914cc00e7 100644 --- a/_posts/2023-08-29-swift-5.9-released.md +++ b/_posts/2023-08-29-swift-5.9-released.md @@ -6,7 +6,7 @@ title: Swift 5.9 Released! author: [alexandersandberg] --- -Swift 5.9 is now officially released! ๐ŸŽ‰ +Swift 5.9 is now officially released! ๐ŸŽ‰ Swift 5.9 is the foundation for many long-awaited features that give library authors more expressive power, including a new macro system and parameter packs, improve the debugging experience through enhanced crash logs and new features in LLDB's expression evaluator, Swift Package Manager support for a new `package` access modifier and macro targets, bi-directional interoperability with C++, Windows platform improvements, and more. Thank you to everyone in the Swift community who made this release possible. Your Swift Forums discussions, bug reports, pull requests, educational content, and other contributions are always appreciated! @@ -14,8 +14,6 @@ Thank you to everyone in the Swift community who made this release possible. You [The Swift Programming Language](https://docs.swift.org/swift-book/documentation/the-swift-programming-language/) book has been updated for Swift 5.9 and is now published with DocC. This is the official Swift guide and a great entry point for those new to Swift. The Swift community also maintains a number of [translations](/documentation/#translations). -If youโ€™re new to Swift, [The Swift Programming Language](https://docs.swift.org/swift-book/) is the official Swift guide and has been updated for version 5.9. The Swift community maintains a number of [translations](https://www.swift.org/documentation/#translations). - ## Language and Standard Library Swift 5.9 tackles three long-desired features that allow you to express things you couldn't easily do before. @@ -77,7 +75,7 @@ func all(_ optional: repeat (each Wrapped)?) -> (repeat each Wrapp What's more, these features are all usable today in Swift 5.9, but they are not finished growing. Each one is too large to fully implement in a single release; we're excited about what you can already do with them in Swift 5.9, but we're even more excited to have laid the foundations for better things to come. -In addition to these major features, Swift 5.9 also includes lots of smaller refinements to the language. The one developers will probably use most often is [`if` and `switch` expressions](https://github.com/apple/swift-evolution/blob/main/proposals/0380-if-switch-expressions.md), which lets you assign the result of a single-expression `if` or `switch` statement to a variable: +In addition to these major features, Swift 5.9 also includes smaller refinements to the language. The one developers will probably use most often is [`if` and `switch` expressions](https://github.com/apple/swift-evolution/blob/main/proposals/0380-if-switch-expressions.md), which lets you assign the result of a single-expression `if` or `switch` statement to a variable: ```swift statusBar.text = if !hasConnection { "Disconnected" } @@ -107,7 +105,7 @@ Swift expressions can now refer to generic type parameters. This allows setting Finally, the debug info produced by the Swift compiler is now more precise when it comes to scoping of local variables. -For a more detailed discussion and examples of how to use these new features we will be publishing a separate blog focussing on debugging Swift 5.9 next week! +For a more detailed discussion and examples of how to use these new features, stay tuned for a dedicated blog about debugging in Swift 5.9 coming soon! ## Ecosystem @@ -137,9 +135,9 @@ See the [Swift Package Manager changelog](https://github.com/apple/swift-package ### Swift Syntax -[swift-syntax](https://github.com/apple/swift-syntax) has become an essential tool to create macros in Swift 5.9. In addition to the introduction of the modules that allow the creation of macros, swift-syntax has received huge focus on quality: +[swift-syntax](https://github.com/apple/swift-syntax) has become an essential tool to create macros in Swift 5.9. In addition to the introduction of the modules that allow the creation of macros, swift-syntax has received major quality improvements: -- The documentation of swift-syntax has been greatly expanded and can be viewed at [swiftpackageindex.com](https://swiftpackageindex.com/apple/swift-syntax) +- The documentation of swift-syntax has been greatly expanded and can be viewed at [swiftpackageindex.com](https://swiftpackageindex.com/apple/swift-syntax). - The names of all syntax nodes and their children have been audited to be more consistent and accurately reflect the Swift language. @@ -163,7 +161,15 @@ The server workgroup has been busy driving the adoption of Swift concurrency in ### Windows Platform - +The Windows installation received new functionality to inject the module maps via a VFS overlay dynamically rather than needing to modify the Visual Studio installation. This change finally breaks the dependency order for installation. It should now be possible to install either Visual Studio or the Swift toolchain first. Additionally, there should be no need to repair the installation after an upgrade to Visual Studio. As part of the continued refinement to the installer, initial work towards versioning the toolchain installation was merged. This begins laying the foundation for the ability to have multiple parallel toolchain versions installed side-by-side on Windows. + +Alongside of this improvement of handling of Visual Studio, the Swift toolchain added new flags (`-windows-sdk-root`, `-windows-sdk-version`, `-visualc-tools-root`, `-visualc-tools-version`) to help control the Windows SDK and Visual C++ tools that it builds against. The Windows SDK (`WinSDK`) module also saw improvements in the coverage of the SDK enabling access to a wider set of system APIs. The Visual C++ (`vcruntime`) module was greatly restructured to support C++ interoperability. This change should be generally transparent to existing code. + +Structured Concurrency is now be significantly more stable on Windows. Unfortunately, this does come at the expense of backtraces as the Windows ABI currently prohibits the necessary optimizations required for the proper implementation of the feature. + +Improvements to path handling in the LSP and SPM should make both of these tools more robust on Windows. LLDB also saw initial work towards improving support for Windows. It should now be possible to use LLDB on Windows for basic debugging. While still a work in progress, this should significantly improve the developer experience on Windows. + +Small improvements continue to be made to try to reduce the size of the toolchain. Although the impact of this is minimal, some of the tools are now smaller in size due to more careful curation of linking. This also reduces the number of artifacts that are contained in a toolchain installation. ## Downloads