{"id":35299,"date":"2022-03-16T16:20:40","date_gmt":"2022-03-16T20:20:40","guid":{"rendered":"https:\/\/mjtsai.com\/blog\/?p=35299"},"modified":"2022-05-05T13:44:26","modified_gmt":"2022-05-05T17:44:26","slug":"swift-5-6-released","status":"publish","type":"post","link":"https:\/\/mjtsai.com\/blog\/2022\/03\/16\/swift-5-6-released\/","title":{"rendered":"Swift 5.6 Released"},"content":{"rendered":"<p><a href=\"https:\/\/www.swift.org\/blog\/swift-5.6-released\/\">Ted Kremenek<\/a>:<\/p>\n<blockquote cite=\"https:\/\/www.swift.org\/blog\/swift-5.6-released\/\"><p>Swift 5.6 enhances the language through a number of proposals from the <a href=\"https:\/\/github.com\/apple\/swift-evolution\">Swift Evolution<\/a> process, including:<\/p><ul><li><a href=\"https:\/\/github.com\/apple\/swift-evolution\/blob\/main\/proposals\/0290-negative-availability.md\">SE-0290<\/a> - Unavailability Condition<\/li><li><a href=\"https:\/\/github.com\/apple\/swift-evolution\/blob\/main\/proposals\/0315-placeholder-types.md\">SE-0315<\/a> - Type placeholders (formerly, &ldquo;Placeholder types&rdquo;)<\/li><li><a href=\"https:\/\/github.com\/apple\/swift-evolution\/blob\/main\/proposals\/0320-codingkeyrepresentable.md\">SE-0320<\/a> - Allow coding of non <code>String<\/code> \/ <code>Int<\/code> keyed <code>Dictionary<\/code> into a <code>KeyedContainer<\/code><\/li><li><a href=\"https:\/\/github.com\/apple\/swift-evolution\/blob\/main\/proposals\/0322-temporary-buffers.md\">SE-0322<\/a> - Temporary uninitialized buffers<\/li><li><a href=\"https:\/\/github.com\/apple\/swift-evolution\/blob\/main\/proposals\/0324-c-lang-pointer-arg-conversion.md\">SE-0324<\/a> - Relax diagnostics for pointer arguments to C functions<\/li><li><a href=\"https:\/\/github.com\/apple\/swift-evolution\/blob\/main\/proposals\/0331-remove-sendable-from-unsafepointer.md\">SE-0331<\/a> - Remove Sendable conformance from unsafe pointer types<\/li><li><a href=\"https:\/\/github.com\/apple\/swift-evolution\/blob\/main\/proposals\/0335-existential-any.md\">SE-0335<\/a> - Introduces existential <code>any<\/code><\/li><li><a href=\"https:\/\/github.com\/apple\/swift-evolution\/blob\/main\/proposals\/0337-support-incremental-migration-to-concurrency-checking.md\">SE-0337<\/a> - Incremental migration to concurrency checking<\/li><\/ul><\/blockquote>\n\n<p><a href=\"https:\/\/twitter.com\/nicklockwood\/status\/1503502107407790080\">Nick Lockwood<\/a>:<\/p>\n<blockquote cite=\"https:\/\/twitter.com\/nicklockwood\/status\/1503502107407790080\">\n<p>I have very mixed feelings about the introduction of the <code>any<\/code> keyword for protocols in Swift[&#8230;]<\/p>\n<p>Of all the changes in recent memory, this is probably the most disruptive to code compatibility (yes, technically it&rsquo;s only a warning, but warnings matter)<\/p>\n<p>[&#8230;]<\/p>\n<p>I don&rsquo;t necessarily disagree that this makes it clearer what&rsquo;s going on, but aside from the effect on existing code, it impacts API compatibility forevermore.<\/p>\n<p>A common refactor as APIs evolve is to convert concrete types in the interface to protocols (e.g. to make them testable)<\/p>\n<p>That used to be a mostly non source-breaking change, but now it would require all call sites to be updated.<\/p>\n<\/blockquote>\n\n<p>Previously:<\/p>\n<ul>\n<li><a href=\"https:\/\/mjtsai.com\/blog\/2022\/02\/22\/swift-5-6-features-in-xcode-13-3-beta-3\/\">Swift 5.6 Features in Xcode 13.3 Beta 3<\/a><\/li>\n<li><a href=\"https:\/\/mjtsai.com\/blog\/2021\/09\/21\/swift-5-5-released\/\">Swift 5.5 Released<\/a><\/li>\n<\/ul>\n\n<p id=\"swift-5-6-released-update-2022-03-23\">Update (2022-03-23): <a href=\"https:\/\/twitter.com\/stroughtonsmith\/status\/1504190301644148748\">Steve Troughton-Smith<\/a>:<\/p>\n<blockquote cite=\"https:\/\/twitter.com\/stroughtonsmith\/status\/1504190301644148748\"><p>This is a pretty crummy bug to ship<\/p><\/blockquote>\n\n<p><a href=\"https:\/\/twitter.com\/dmartincy\/status\/1504154612634431499\">Daniel Mart&iacute;n<\/a>:<\/p>\n<blockquote cite=\"https:\/\/twitter.com\/dmartincy\/status\/1504154612634431499\">\n<p>Xcode 13.3 has a new tool, xcdebug, which allows you to quickly debug programs or Xcode schemes from a Unix shell.<\/p>\n<\/blockquote>\n\n<p id=\"swift-5-6-released-update-2022-04-11\">Update (2022-04-11): <a href=\"https:\/\/forums.swift.org\/t\/large-increase-in-compilation-time-in-swift-5-6-on-enums-with-associated-values\/56115\">TheCodingart<\/a>:<\/p>\n<blockquote cite=\"https:\/\/forums.swift.org\/t\/large-increase-in-compilation-time-in-swift-5-6-on-enums-with-associated-values\/56115\">\n<p>FB9963451 Has been filed due to a bug found in Swift 5.6 when compiling enums with mixed associated types (some with and some without associated types) causing exponentially large compilation time increases.<\/p>\n<\/blockquote>\n\n<p><a href=\"https:\/\/twitter.com\/olebegemann\/status\/1508860424464314372\">Ole Begemann<\/a>:<\/p>\n<blockquote cite=\"https:\/\/twitter.com\/olebegemann\/status\/1508860424464314372\">\n<p>I can bring macOS to beachball on an M1 Pro by building the Swift compiler in Terminal. It&rsquo;s great that this uses all 10 cores at 100%, but it seems the scheduler should leave some cycles to other apps?<\/p>\n<\/blockquote>\n\n<p><a href=\"https:\/\/augmentedcode.io\/2022\/04\/04\/is-existential-any-a-performance-problem-in-swift\/\">Toomas Vahter<\/a>:<\/p>\n<blockquote cite=\"https:\/\/augmentedcode.io\/2022\/04\/04\/is-existential-any-a-performance-problem-in-swift\/\">\n<p>Therefore, when reading about existential any it is possible that we get a feeling like we should, because of performance, replace everything, what is possible, with generics. But that should not be a case. Performance becomes relevant only in areas where we need to call a loooot of functions in a very short time.<\/p>\n<\/blockquote>","protected":false},"excerpt":{"rendered":"<p>Ted Kremenek: Swift 5.6 enhances the language through a number of proposals from the Swift Evolution process, including:SE-0290 - Unavailability ConditionSE-0315 - Type placeholders (formerly, &ldquo;Placeholder types&rdquo;)SE-0320 - Allow coding of non String \/ Int keyed Dictionary into a KeyedContainerSE-0322 - Temporary uninitialized buffersSE-0324 - Relax diagnostics for pointer arguments to C functionsSE-0331 - Remove [&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":"2022-03-16T20:20:42Z","apple_news_api_id":"dc9b1ba4-8f6a-4c1e-9bfe-9857a02f593a","apple_news_api_modified_at":"2022-04-11T19:40:57Z","apple_news_api_revision":"AAAAAAAAAAAAAAAAAAAAAg==","apple_news_api_share_url":"https:\/\/apple.news\/A3JsbpI9qTB6b_phXoC9ZOg","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":[131,46,30,2077,71,2200,901,226],"class_list":["post-35299","post","type-post","status-publish","format-standard","hentry","category-programming-category","tag-bug","tag-languagedesign","tag-mac","tag-macos-12","tag-programming","tag-swift-concurrency","tag-swift-programming-language","tag-xcode"],"apple_news_notices":[],"_links":{"self":[{"href":"https:\/\/mjtsai.com\/blog\/wp-json\/wp\/v2\/posts\/35299","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=35299"}],"version-history":[{"count":4,"href":"https:\/\/mjtsai.com\/blog\/wp-json\/wp\/v2\/posts\/35299\/revisions"}],"predecessor-version":[{"id":35520,"href":"https:\/\/mjtsai.com\/blog\/wp-json\/wp\/v2\/posts\/35299\/revisions\/35520"}],"wp:attachment":[{"href":"https:\/\/mjtsai.com\/blog\/wp-json\/wp\/v2\/media?parent=35299"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/mjtsai.com\/blog\/wp-json\/wp\/v2\/categories?post=35299"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/mjtsai.com\/blog\/wp-json\/wp\/v2\/tags?post=35299"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}