{"id":38944,"date":"2023-04-03T14:01:39","date_gmt":"2023-04-03T18:01:39","guid":{"rendered":"https:\/\/mjtsai.com\/blog\/?p=38944"},"modified":"2023-04-03T14:01:39","modified_gmt":"2023-04-03T18:01:39","slug":"swift-5-8","status":"publish","type":"post","link":"https:\/\/mjtsai.com\/blog\/2023\/04\/03\/swift-5-8\/","title":{"rendered":"Swift 5.8"},"content":{"rendered":"<p><a href=\"https:\/\/www.swift.org\/blog\/swift-5.8-released\/\">Alexander Sandberg<\/a>:<\/p>\n<blockquote cite=\"https:\/\/www.swift.org\/blog\/swift-5.8-released\/\"><p>Swift 5.8 enables you to start incrementally preparing your projects for Swift 6 by <a href=\"https:\/\/github.com\/apple\/swift-evolution\/blob\/main\/proposals\/0362-piecemeal-future-features.md\">using <em>upcoming features<\/em><\/a>. By default, upcoming features are disabled. To enable a feature, pass the compiler flag <code>-enable-upcoming-feature<\/code> followed by the feature&rsquo;s identifier.<\/p><p>[&#8230;]<\/p><p>The result builder implementation has been reworked in Swift 5.8 to greatly improve compile-time performance, code completion results, and diagnostics. The Swift 5.8 result builder implementation enforces stricter type inference that matches the semantics in <a href=\"https:\/\/github.com\/apple\/swift-evolution\/blob\/main\/proposals\/0289-result-builders.md\">SE-0289: Result Builders<\/a>, which has an impact on some existing code that relied on invalid type inference.<\/p><p>[&#8230;]<\/p><ul><li>SE-0274: <a href=\"https:\/\/github.com\/apple\/swift-evolution\/blob\/main\/proposals\/0274-magic-file.md\">Concise magic file names<\/a><\/li><li>SE-0362: <a href=\"https:\/\/github.com\/apple\/swift-evolution\/blob\/main\/proposals\/0362-piecemeal-future-features.md\">Piecemeal adoption of upcoming language improvements<\/a><\/li><li>SE-0365: <a href=\"https:\/\/github.com\/apple\/swift-evolution\/blob\/main\/proposals\/0365-implicit-self-weak-capture.md\">Allow implicit self for weak self captures, after self is unwrapped<\/a><\/li><li>SE-0367: <a href=\"https:\/\/github.com\/apple\/swift-evolution\/blob\/main\/proposals\/0367-conditional-attributes.md\">Conditional compilation for attributes<\/a><\/li><li>SE-0368: <a href=\"https:\/\/github.com\/apple\/swift-evolution\/blob\/main\/proposals\/0368-staticbigint.md\">StaticBigInt<\/a><\/li><li>SE-0369: <a href=\"https:\/\/github.com\/apple\/swift-evolution\/blob\/main\/proposals\/0369-add-customdebugdescription-conformance-to-anykeypath.md\">Add CustomDebugStringConvertible conformance to AnyKeyPath<\/a><\/li><li>SE-0370: <a href=\"https:\/\/github.com\/apple\/swift-evolution\/blob\/main\/proposals\/0370-pointer-family-initialization-improvements.md\">Pointer Family Initialization Improvements and Better Buffer Slices<\/a><\/li><li>SE-0372: <a href=\"https:\/\/github.com\/apple\/swift-evolution\/blob\/main\/proposals\/0372-document-sorting-as-stable.md\">Document Sorting as Stable<\/a><\/li><li>SE-0373: <a href=\"https:\/\/github.com\/apple\/swift-evolution\/blob\/main\/proposals\/0373-vars-without-limits-in-result-builders.md\">Lift all limitations on variables in result builders<\/a><\/li><li>SE-0375: <a href=\"https:\/\/github.com\/apple\/swift-evolution\/blob\/main\/proposals\/0375-opening-existential-optional.md\">Opening existential arguments to optional parameters<\/a><\/li><li>SE-0376: <a href=\"https:\/\/github.com\/apple\/swift-evolution\/blob\/main\/proposals\/0376-function-back-deployment.md\">Function Back Deployment<\/a><\/li><\/ul><\/blockquote>\n\n<p><a href=\"https:\/\/github.com\/apple\/swift-evolution\/blob\/main\/proposals\/0365-implicit-self-weak-capture.md\">SE-0365<\/a>:<\/p>\n<blockquote cite=\"https:\/\/github.com\/apple\/swift-evolution\/blob\/main\/proposals\/0365-implicit-self-weak-capture.md\"><p>As of <a href=\"https:\/\/github.com\/apple\/swift-evolution\/blob\/main\/proposals\/0269-implicit-self-explicit-capture.md\">SE-0269<\/a>, implicit <code>self<\/code> is permitted in closures when <code>self<\/code> is written explicitly in the capture list. We should extend this support to <code>weak self<\/code> captures, and permit implicit <code>self<\/code> as long as <code>self<\/code> has been unwrapped.<\/p><\/blockquote>\n\n<p><a href=\"https:\/\/www.hackingwithswift.com\/articles\/256\/whats-new-in-swift-5-8\">Paul Hudson<\/a>:<\/p>\n<blockquote cite=\"https:\/\/www.hackingwithswift.com\/articles\/256\/whats-new-in-swift-5-8\">\n<p>In this article I&rsquo;m going to walk you through the most important changes this time around, providing code examples and explanations so you can try it all yourself.<\/p>\n<\/blockquote>\n\n<p>Previously:<\/p>\n<ul>\n<li><a href=\"https:\/\/mjtsai.com\/blog\/2023\/04\/03\/xcode-14-3\/\">Xcode 14.3<\/a><\/li>\n<li><a href=\"https:\/\/mjtsai.com\/blog\/2022\/11\/18\/swift-proposal-function-back-deployment\/\">Swift Proposal: Function Back Deployment<\/a><\/li>\n<li><a href=\"https:\/\/mjtsai.com\/blog\/2022\/09\/12\/swift-5-7\/\">Swift 5.7<\/a><\/li>\n<li><a href=\"https:\/\/mjtsai.com\/blog\/2022\/05\/18\/weak-self-closure-rules-of-thumb\/\">Weak Self: Closure Rules of Thumb<\/a><\/li>\n<\/ul>","protected":false},"excerpt":{"rendered":"<p>Alexander Sandberg: Swift 5.8 enables you to start incrementally preparing your projects for Swift 6 by using upcoming features. By default, upcoming features are disabled. To enable a feature, pass the compiler flag -enable-upcoming-feature followed by the feature&rsquo;s identifier.[&#8230;]The result builder implementation has been reworked in Swift 5.8 to greatly improve compile-time performance, code completion [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"apple_news_api_created_at":"2023-04-03T18:01:42Z","apple_news_api_id":"f538dfd6-bbca-4627-8f26-6110339ccd74","apple_news_api_modified_at":"2023-04-03T18:01:42Z","apple_news_api_revision":"AAAAAAAAAAD\/\/\/\/\/\/\/\/\/\/w==","apple_news_api_share_url":"https:\/\/apple.news\/A9Tjf1rvKRiePJmEQM5zNdA","apple_news_coverimage":0,"apple_news_coverimage_caption":"","apple_news_is_hidden":false,"apple_news_is_paid":false,"apple_news_is_preview":false,"apple_news_is_sponsored":false,"apple_news_maturity_rating":"","apple_news_metadata":"\"\"","apple_news_pullquote":"","apple_news_pullquote_position":"","apple_news_slug":"","apple_news_sections":"\"\"","apple_news_suppress_video_url":false,"apple_news_use_image_component":false,"footnotes":""},"categories":[4],"tags":[46,71,901],"class_list":["post-38944","post","type-post","status-publish","format-standard","hentry","category-programming-category","tag-languagedesign","tag-programming","tag-swift-programming-language"],"apple_news_notices":[],"_links":{"self":[{"href":"https:\/\/mjtsai.com\/blog\/wp-json\/wp\/v2\/posts\/38944","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/mjtsai.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/mjtsai.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/mjtsai.com\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/mjtsai.com\/blog\/wp-json\/wp\/v2\/comments?post=38944"}],"version-history":[{"count":1,"href":"https:\/\/mjtsai.com\/blog\/wp-json\/wp\/v2\/posts\/38944\/revisions"}],"predecessor-version":[{"id":38945,"href":"https:\/\/mjtsai.com\/blog\/wp-json\/wp\/v2\/posts\/38944\/revisions\/38945"}],"wp:attachment":[{"href":"https:\/\/mjtsai.com\/blog\/wp-json\/wp\/v2\/media?parent=38944"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/mjtsai.com\/blog\/wp-json\/wp\/v2\/categories?post=38944"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/mjtsai.com\/blog\/wp-json\/wp\/v2\/tags?post=38944"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}