{"id":15448,"date":"2016-07-28T11:54:39","date_gmt":"2016-07-28T15:54:39","guid":{"rendered":"http:\/\/mjtsai.com\/blog\/?p=15448"},"modified":"2020-04-21T14:04:05","modified_gmt":"2020-04-21T18:04:05","slug":"end-of-source-breaking-changes-for-swift-3","status":"publish","type":"post","link":"https:\/\/mjtsai.com\/blog\/2016\/07\/28\/end-of-source-breaking-changes-for-swift-3\/","title":{"rendered":"End of Source-breaking Changes for Swift 3"},"content":{"rendered":"<p><a href=\"https:\/\/forums.swift.org\/t\/end-of-source-breaking-changes-for-swift-3\/3573\">Ted Kremenek<\/a>:<\/p>\n<blockquote cite=\"https:\/\/forums.swift.org\/t\/end-of-source-breaking-changes-for-swift-3\/3573\"><p>The Swift team at Apple has reflected on this and decided what it &ldquo;means&rdquo; for Swift 3 to be source compatible with Swift 4 and later releases going forward. Our goal is to allow app developers to combine a mix of Swift modules (e.g., SwiftPM packages), where each module is known to compile with a specific version of the language (module A works with Swift 3, module B works with Swift 3.1, etc.), then combine those modules into a single binary. The key feature is that a module can be migrated from Swift 3 to 3.1 to 4 (and beyond) independently of its dependencies.<\/p><p>While the exact details of how we will accomplish this feat are still being discussed, here is a sketch of how this will likely work in the Swift 4 timeframe. The key enabler is a new compiler flag that indicates the language version to compile for (e.g., similar to the clang -std=c99 flag). The compiler flag will be provided by the build system you are using (e.g., Xcode, SwiftPM, etc.) on a per-module basis[&#8230;]<\/p><p>[&#8230;]<\/p><p>The great thing about this approach is that a single Swift 4 compiler is building all of the sources in an application. This allows us to roll out this approach before achieving full ABI stability &mdash; something that will be a goal for Swift 4, but is impractical to achieve for a Swift 3.x release. It also provides us a general framework in the future for handling source compatibility as Swift evolves.<\/p><\/blockquote>\n<p>See also: <a href=\"http:\/\/apple.github.io\/swift-evolution\/\">Swift Programming Language Evolution: Proposal Status<\/a> (via <a href=\"https:\/\/twitter.com\/jtbandes\/status\/753509110629343232\">Jacob Bandes-Storch<\/a>).<\/p>","protected":false},"excerpt":{"rendered":"<p>Ted Kremenek: The Swift team at Apple has reflected on this and decided what it &ldquo;means&rdquo; for Swift 3 to be source compatible with Swift 4 and later releases going forward. Our goal is to allow app developers to combine a mix of Swift modules (e.g., SwiftPM packages), where each module is known to compile [&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":"2020-04-21T18:04:13Z","apple_news_api_id":"e63c923f-1f08-4d8a-8a6b-f11ff8f801fb","apple_news_api_modified_at":"2020-04-21T18:04:13Z","apple_news_api_revision":"AAAAAAAAAAD\/\/\/\/\/\/\/\/\/\/w==","apple_news_api_share_url":"https:\/\/apple.news\/A5jySPx8ITYqKa_Ef-PgB-w","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-15448","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\/15448","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=15448"}],"version-history":[{"count":2,"href":"https:\/\/mjtsai.com\/blog\/wp-json\/wp\/v2\/posts\/15448\/revisions"}],"predecessor-version":[{"id":28740,"href":"https:\/\/mjtsai.com\/blog\/wp-json\/wp\/v2\/posts\/15448\/revisions\/28740"}],"wp:attachment":[{"href":"https:\/\/mjtsai.com\/blog\/wp-json\/wp\/v2\/media?parent=15448"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/mjtsai.com\/blog\/wp-json\/wp\/v2\/categories?post=15448"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/mjtsai.com\/blog\/wp-json\/wp\/v2\/tags?post=15448"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}