{"id":39643,"date":"2023-06-07T15:55:05","date_gmt":"2023-06-07T19:55:05","guid":{"rendered":"https:\/\/mjtsai.com\/blog\/?p=39643"},"modified":"2023-06-07T15:55:05","modified_gmt":"2023-06-07T19:55:05","slug":"swifts-upcoming-feature-flags","status":"publish","type":"post","link":"https:\/\/mjtsai.com\/blog\/2023\/06\/07\/swifts-upcoming-feature-flags\/","title":{"rendered":"Swift&rsquo;s Upcoming Feature Flags"},"content":{"rendered":"<p><a href=\"https:\/\/www.swift.org\/blog\/using-upcoming-feature-flags\/\">James Dempsey<\/a>:<\/p>\n<blockquote cite=\"https:\/\/www.swift.org\/blog\/using-upcoming-feature-flags\/\"><p>The idea of being able to adopt upcoming changes sooner rather than later is a good one. However, adding an ever-increasing number of separate compiler flags for each upcoming feature does not scale well.<\/p><p>To address this, Swift evolution proposal <a href=\"https:\/\/github.com\/apple\/swift-evolution\/blob\/main\/proposals\/0362-piecemeal-future-features.md\">SE-0362<\/a>, implemented in Swift 5.8, details a generalized mechanism for enabling upcoming features.<\/p><p>[&#8230;]<\/p><p>SE-0362 also introduces a new <code>hasFeature()<\/code> compilation condition that checks whether a feature is enabled. This allows you to write code that uses a feature if present or uses alternate code if not present.<\/p><\/blockquote>\n\n<p>Previously:<\/p>\n<ul>\n<li><a href=\"https:\/\/mjtsai.com\/blog\/2023\/04\/03\/swift-5-8\/\">Swift 5.8<\/a><\/li>\n<\/ul>","protected":false},"excerpt":{"rendered":"<p>James Dempsey: The idea of being able to adopt upcoming changes sooner rather than later is a good one. However, adding an ever-increasing number of separate compiler flags for each upcoming feature does not scale well.To address this, Swift evolution proposal SE-0362, implemented in Swift 5.8, details a generalized mechanism for enabling upcoming features.[&#8230;]SE-0362 also [&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-06-07T19:55:07Z","apple_news_api_id":"b1c77a3d-fc31-4454-b7be-e40cfccb2b72","apple_news_api_modified_at":"2023-06-07T19:55:07Z","apple_news_api_revision":"AAAAAAAAAAD\/\/\/\/\/\/\/\/\/\/w==","apple_news_api_share_url":"https:\/\/apple.news\/Ascd6PfwxRFS3vuQM_Msrcg","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-39643","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\/39643","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=39643"}],"version-history":[{"count":1,"href":"https:\/\/mjtsai.com\/blog\/wp-json\/wp\/v2\/posts\/39643\/revisions"}],"predecessor-version":[{"id":39644,"href":"https:\/\/mjtsai.com\/blog\/wp-json\/wp\/v2\/posts\/39643\/revisions\/39644"}],"wp:attachment":[{"href":"https:\/\/mjtsai.com\/blog\/wp-json\/wp\/v2\/media?parent=39643"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/mjtsai.com\/blog\/wp-json\/wp\/v2\/categories?post=39643"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/mjtsai.com\/blog\/wp-json\/wp\/v2\/tags?post=39643"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}