{"id":39207,"date":"2023-04-27T15:38:31","date_gmt":"2023-04-27T19:38:31","guid":{"rendered":"https:\/\/mjtsai.com\/blog\/?p=39207"},"modified":"2025-10-29T09:37:53","modified_gmt":"2025-10-29T13:37:53","slug":"swift-foundation-preview","status":"publish","type":"post","link":"https:\/\/mjtsai.com\/blog\/2023\/04\/27\/swift-foundation-preview\/","title":{"rendered":"Swift Foundation Preview"},"content":{"rendered":"<p><a href=\"https:\/\/www.swift.org\/blog\/foundation-preview-now-available\/\">Tony Parker<\/a> (<a href=\"https:\/\/twitter.com\/SwiftLang\/status\/1651338724230463489\">tweet<\/a>):<\/p>\n<blockquote cite=\"https:\/\/www.swift.org\/blog\/foundation-preview-now-available\/\"><p>This preview provides a unified implementation of Foundation, written in Swift, that is faster, safer, and more approachable to new contributors.<\/p><p>A new Foundation Workgroup will run reviews of proposed Foundation API and coordinate the needs of the Swift community with Apple engineering.<\/p><p>[&#8230;]<\/p><p>The following types are available in the preview package, with more to come later. Many types, including <code>JSONEncoder<\/code>, <code>Calendar<\/code>, <code>TimeZone<\/code>, and <code>Locale<\/code> are all-new Swift implementations. <code>FormatStyle<\/code> and <code>ParseStyle<\/code> available as open source for the first time.<\/p><\/blockquote>\n<p>Here&rsquo;s the <a href=\"https:\/\/github.com\/apple\/swift-foundation\">repo<\/a>.<\/p>\n\n<p>Previously:<\/p>\n<ul>\n<li><a href=\"https:\/\/mjtsai.com\/blog\/2022\/12\/12\/the-swifty-future-of-foundation\/\">The Swifty Future of Foundation<\/a><\/li>\n<\/ul>\n\n<p id=\"swift-foundation-preview-update-2023-05-22\">Update (2023-05-22): See also: <a href=\"https:\/\/news.ycombinator.com\/item?id=36026038\">Hacker News<\/a>.<\/p>\n\n<p>Previously:<\/p>\n<ul>\n<li><a href=\"https:\/\/mjtsai.com\/blog\/2023\/05\/04\/mojo-programming-language\/\">Mojo Programming Language<\/a><\/li>\n<\/ul>\n\n<p id=\"swift-foundation-preview-update-2023-06-09\">Update (2023-06-09): <a href=\"https:\/\/mastodon.social\/@airspeedswift\/110500010932748769\">Ben Cohen<\/a>:<\/p>\n<blockquote cite=\"https:\/\/mastodon.social\/@airspeedswift\/110500010932748769\"><p>In What&rsquo;s new in Swift I mention the performance improvements from the new Swift implementation of Foundation. Performance came up a lot when we first put the open source package live, but wasn&rsquo;t easy to talk about until the new OS betas were available.<\/p><p>One common trope at the time was &ldquo;it isn&rsquo;t faster than using Objective-C, this is just to reduce Swift bridging costs&rdquo; and while that&rsquo;s true, it&rsquo;s important to note Swift is <em>just plain faster<\/em>, as seen even when calling into it from ObjC.<\/p><\/blockquote>\n\n<p>Previously:<\/p>\n<ul>\n<li><a href=\"https:\/\/mjtsai.com\/blog\/2023\/06\/06\/wwdc-2023-links\/\">WWDC 2023 Links<\/a><\/li>\n<\/ul>","protected":false},"excerpt":{"rendered":"<p>Tony Parker (tweet): This preview provides a unified implementation of Foundation, written in Swift, that is faster, safer, and more approachable to new contributors.A new Foundation Workgroup will run reviews of proposed Foundation API and coordinate the needs of the Swift community with Apple engineering.[&#8230;]The following types are available in the preview package, with more [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"apple_news_api_created_at":"2023-04-27T19:38:34Z","apple_news_api_id":"8acd91ff-53d0-4198-900f-8c59d41d753b","apple_news_api_modified_at":"2025-10-29T13:37:56Z","apple_news_api_revision":"AAAAAAAAAAAAAAAAAAAAAw==","apple_news_api_share_url":"https:\/\/apple.news\/Ais2R_1PQQZiQD4xZ1B11Ow","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":[69,31,30,568,74,138,71,1774,2854,901],"class_list":["post-39207","post","type-post","status-publish","format-standard","hentry","category-programming-category","tag-cocoa","tag-ios","tag-mac","tag-nsdateformatter","tag-opensource","tag-optimization","tag-programming","tag-swift-codable","tag-swift-foundation","tag-swift-programming-language"],"apple_news_notices":[],"_links":{"self":[{"href":"https:\/\/mjtsai.com\/blog\/wp-json\/wp\/v2\/posts\/39207","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=39207"}],"version-history":[{"count":4,"href":"https:\/\/mjtsai.com\/blog\/wp-json\/wp\/v2\/posts\/39207\/revisions"}],"predecessor-version":[{"id":39675,"href":"https:\/\/mjtsai.com\/blog\/wp-json\/wp\/v2\/posts\/39207\/revisions\/39675"}],"wp:attachment":[{"href":"https:\/\/mjtsai.com\/blog\/wp-json\/wp\/v2\/media?parent=39207"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/mjtsai.com\/blog\/wp-json\/wp\/v2\/categories?post=39207"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/mjtsai.com\/blog\/wp-json\/wp\/v2\/tags?post=39207"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}