{"id":24582,"date":"2019-03-12T16:50:07","date_gmt":"2019-03-12T20:50:07","guid":{"rendered":"https:\/\/mjtsai.com\/blog\/?p=24582"},"modified":"2019-03-13T15:15:08","modified_gmt":"2019-03-13T19:15:08","slug":"software-ics-binary-compatibility-and-objective-swift","status":"publish","type":"post","link":"https:\/\/mjtsai.com\/blog\/2019\/03\/12\/software-ics-binary-compatibility-and-objective-swift\/","title":{"rendered":"Software-ICs, Binary Compatibility, and Objective-Swift"},"content":{"rendered":"<p><a href=\"https:\/\/blog.metaobject.com\/2019\/03\/software-ics-binary-compatibility-and.html\">Marcel Weiher<\/a>:<\/p>\n<blockquote cite=\"https:\/\/blog.metaobject.com\/2019\/03\/software-ics-binary-compatibility-and.html\">\n<p>Swift recently achieved ABI stability, meaning that we can now ship Swift binaries without having to ship the corresponding\nSwift libraries.  While it&rsquo;s been a long time coming, it&rsquo;s also great to have finally reached this point.  However, it\nturns out that this does <em>not<\/em> mean you can reasonably ship binary Swift frameworks, for reasons <a href=\"https:\/\/pspdfkit.com\/blog\/2018\/binary-frameworks-swift\/\">described<\/a> very\nwell by Peter Steinberger of <a href=\"https:\/\/pspdfkit.com\">PSPDFKit<\/a> and the good folks at <a href=\"https:\/\/instabug.com\/blog\/no-swift-instabug\/\">instabug<\/a>.<\/p>\n<p>To reach this not-quite-there-yet state took almost 5 years, which is pretty much the total time NeXT shipped their hardware, and it mirrors the state with C++, which is still not generally suitable for binary distribution of libraries. Objective-C didn&rsquo;t have these problems, and as it turns out this is not a coincidence.<\/p>\n<p>[&#8230;]<\/p>\n<p>Swift is designed as a programming language, not as middleware with language features. Therefore its modularity features are an add-on to the language, and try to transport the full richness of that programming model. And Swift&rsquo;s programming model is very rich.<\/p>\n<p>[&#8230;]<\/p>\n<p>Did I mention that Objective-C is middleware with language features?<\/p>\n<\/blockquote>\n\n<p>Previously:<\/p>\n<ul>\n<li><a href=\"https:\/\/mjtsai.com\/blog\/2019\/02\/07\/swift-abi-stability-and-more\/\">Swift ABI Stability and More<\/a><\/li>\n<li><a href=\"https:\/\/mjtsai.com\/blog\/2017\/01\/26\/swift-abi-stability-manifesto\/\">Swift ABI Stability Manifesto<\/a><\/li>\n<\/ul>\n\n<p id=\"software-ics-binary-compatibility-and-objective-swift-update-2019-03-13\">Update (2019-03-13): <a href=\"https:\/\/pspdfkit.com\/blog\/2019\/swift-and-pspdfkit\/\">Peter Steinberger<\/a>:<\/p>\n<blockquote cite=\"https:\/\/pspdfkit.com\/blog\/2019\/swift-and-pspdfkit\/\">\n<p>Given the above constraints, PSPDFKit will likely never fully move to Swift. First and foremost, we still have many clients with applications built in Objective-C. There&rsquo;s rarely a good reason to do a rewrite of battle-tested code, and we cannot force our partners to rewrite just for the sake of rewriting. Secondly, moving to Swift would heavily limit our subclassing system &mdash; currently, developers can register almost any exposed class and offer a subclass that PSPDFKit will initialize internally in place of our default base class. But seeing as Swift classes can no longer be subclassed in Objective-C, these capabilities would be greatly restricted if we switched to Swift.<\/p>\n<p>This limits us to using Swift internally &mdash; which is the worst kind of Swift usage.<\/p>\n<\/blockquote>","protected":false},"excerpt":{"rendered":"<p>Marcel Weiher: Swift recently achieved ABI stability, meaning that we can now ship Swift binaries without having to ship the corresponding Swift libraries. While it&rsquo;s been a long time coming, it&rsquo;s also great to have finally reached this point. However, it turns out that this does not mean you can reasonably ship binary Swift frameworks, [&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":"2019-03-12T20:50:09Z","apple_news_api_id":"e916111e-b7a4-4f2c-90cb-acfa97c657ee","apple_news_api_modified_at":"2019-03-13T19:15:13Z","apple_news_api_revision":"AAAAAAAAAAAAAAAAAAAAAQ==","apple_news_api_share_url":"https:\/\/apple.news\/A6RYRHrekTyyQy6z6l8ZX7g","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,966,54,71,1424,901],"class_list":["post-24582","post","type-post","status-publish","format-standard","hentry","category-programming-category","tag-languagedesign","tag-message-passing","tag-objective-c","tag-programming","tag-pspdfkit","tag-swift-programming-language"],"apple_news_notices":[],"_links":{"self":[{"href":"https:\/\/mjtsai.com\/blog\/wp-json\/wp\/v2\/posts\/24582","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=24582"}],"version-history":[{"count":2,"href":"https:\/\/mjtsai.com\/blog\/wp-json\/wp\/v2\/posts\/24582\/revisions"}],"predecessor-version":[{"id":24587,"href":"https:\/\/mjtsai.com\/blog\/wp-json\/wp\/v2\/posts\/24582\/revisions\/24587"}],"wp:attachment":[{"href":"https:\/\/mjtsai.com\/blog\/wp-json\/wp\/v2\/media?parent=24582"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/mjtsai.com\/blog\/wp-json\/wp\/v2\/categories?post=24582"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/mjtsai.com\/blog\/wp-json\/wp\/v2\/tags?post=24582"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}