{"id":13106,"date":"2015-12-15T09:31:24","date_gmt":"2015-12-15T14:31:24","guid":{"rendered":"http:\/\/mjtsai.com\/blog\/?p=13106"},"modified":"2015-12-15T21:14:11","modified_gmt":"2015-12-16T02:14:11","slug":"craig-federighi-on-swift","status":"publish","type":"post","link":"https:\/\/mjtsai.com\/blog\/2015\/12\/15\/craig-federighi-on-swift\/","title":{"rendered":"Craig Federighi on Swift"},"content":{"rendered":"<p><a href=\"http:\/\/daringfireball.net\/thetalkshow\/2015\/12\/14\/ep-139\">John Gruber<\/a>:<\/p>\n<blockquote cite=\"http:\/\/daringfireball.net\/thetalkshow\/2015\/12\/14\/ep-139\">\n<p>Apple senior vice president of software engineering Craig Federighi joins the show for a wide-ranging half-hour discussion about Swift &mdash; Apple&rsquo;s new programming language that just went open source.<\/p>\n<\/blockquote>\n<p><a href=\"http:\/\/arstechnica.com\/staff\/2005\/09\/1372\/\">John Siracusa<\/a> provides follow up (of course).<\/p>\n<p><a href=\"http:\/\/daringfireball.net\/thetalkshow\/139\/federighi-gruber-transcript\">Craig Federighi<\/a>:<\/p>\n<blockquote cite=\"http:\/\/daringfireball.net\/thetalkshow\/139\/federighi-gruber-transcript\"><p>And slowly we&rsquo;ve also been bringing back much of the dynamism. Now there are some things that are impossible in Objective-C, and most of the dynamism that you really want is the ability to figure out what classes this really needs, to be able to cast the class dynamically to a particular protocol, to be able to do a kind of response to select or perform selector check. All of these things are possible in Swift today. And there are some other things that aren&rsquo;t, but certainly we consider important to ultimately bring to the language. So, this thing about a dynamic programming model is still very important to us.<\/p>\n<p>Now there are still some very unsafe things that people do in Objective-C, and I&rsquo;ve been guilty of this myself, where you walk the Objective-C runtime and hack the method table &mdash; and that&rsquo;s cool. But it is highly unsafe and doesn&rsquo;t lead to very maintainable, scalable large programs.<\/p><\/blockquote>\n<p>There&rsquo;s a lot of <a href=\"http:\/\/mjtsai.com\/blog\/2014\/08\/18\/its-a-coup\/\">dynamic<\/a> <a href=\"http:\/\/mjtsai.com\/blog\/2014\/06\/27\/the-case-for-message-passing-in-swift\/\">behavior<\/a> between <code>-respondsToSelector:<\/code> and <a href=\"https:\/\/twitter.com\/mpweiher\/status\/676901080421257217\">dangerous<\/a> <a href=\"https:\/\/twitter.com\/milend\/status\/676702703406436352\">swizzling<\/a>, for example <a href=\"https:\/\/developer.apple.com\/library\/mac\/documentation\/Cocoa\/Conceptual\/CoreData\/index.html\">adding methods at runtime<\/a> and <a href=\"https:\/\/developer.apple.com\/library\/mac\/documentation\/Cocoa\/Reference\/Foundation\/Classes\/NSUndoManager_Class\/\">capturing messages<\/a> <a href=\"https:\/\/developer.apple.com\/library\/mac\/documentation\/Cocoa\/Conceptual\/DistrObjects\/DistrObjects.html\">as objects<\/a>. It&rsquo;s also worth noting that much of what did make it into Swift doesn&rsquo;t work with pure Swift. So it won&rsquo;t work on Linux or if your code is using the more advanced language features. For example, pure Swift protocols don&rsquo;t support optional methods, and <code>dynamic<\/code> properties imply <code>@objc<\/code>, which comes with lots of limitations. Hopefully this will <a href=\"https:\/\/twitter.com\/mjtsai\/status\/675708926306992128\">change<\/a>.<\/p>","protected":false},"excerpt":{"rendered":"<p>John Gruber: Apple senior vice president of software engineering Craig Federighi joins the show for a wide-ranging half-hour discussion about Swift &mdash; Apple&rsquo;s new programming language that just went open source. John Siracusa provides follow up (of course). Craig Federighi: And slowly we&rsquo;ve also been bringing back much of the dynamism. Now there are some [&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":"","apple_news_api_id":"","apple_news_api_modified_at":"","apple_news_api_revision":"","apple_news_api_share_url":"","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":[629,31,46,30,966,54,760,991,71,901],"class_list":["post-13106","post","type-post","status-publish","format-standard","hentry","category-programming-category","tag-craig-federighi","tag-ios","tag-languagedesign","tag-mac","tag-message-passing","tag-objective-c","tag-objective-c-runtime","tag-open-source-software","tag-programming","tag-swift-programming-language"],"apple_news_notices":[],"_links":{"self":[{"href":"https:\/\/mjtsai.com\/blog\/wp-json\/wp\/v2\/posts\/13106","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=13106"}],"version-history":[{"count":7,"href":"https:\/\/mjtsai.com\/blog\/wp-json\/wp\/v2\/posts\/13106\/revisions"}],"predecessor-version":[{"id":13116,"href":"https:\/\/mjtsai.com\/blog\/wp-json\/wp\/v2\/posts\/13106\/revisions\/13116"}],"wp:attachment":[{"href":"https:\/\/mjtsai.com\/blog\/wp-json\/wp\/v2\/media?parent=13106"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/mjtsai.com\/blog\/wp-json\/wp\/v2\/categories?post=13106"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/mjtsai.com\/blog\/wp-json\/wp\/v2\/tags?post=13106"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}