{"id":15031,"date":"2016-07-01T13:54:36","date_gmt":"2016-07-01T17:54:36","guid":{"rendered":"http:\/\/mjtsai.com\/blog\/?p=15031"},"modified":"2020-04-21T14:05:04","modified_gmt":"2020-04-21T18:05:04","slug":"why-swift-ditched-tuple-to-tuple-function-modeling","status":"publish","type":"post","link":"https:\/\/mjtsai.com\/blog\/2016\/07\/01\/why-swift-ditched-tuple-to-tuple-function-modeling\/","title":{"rendered":"Why Swift Ditched Tuple-to-Tuple Function Modeling"},"content":{"rendered":"<p><a href=\"https:\/\/forums.swift.org\/t\/review-se-0111-remove-type-system-significance-of-function-argument-labels\/3209\/41\">Jordan Rose<\/a> (via <a href=\"https:\/\/twitter.com\/JadenGeller\/status\/748730852213788673\">Jaden Geller<\/a>):<\/p>\n<blockquote cite=\"https:\/\/forums.swift.org\/t\/review-se-0111-remove-type-system-significance-of-function-argument-labels\/3209\/41\">\n<p>The real blow, however, came with that very first idea: that we could treat methods with different argument labels as simple overloads in type. This led to poor diagnostics where the compiler couldn&rsquo;t decide whether to believe the types or the argument labels, and might tell you you have the wrong argument labels rather than a type mismatch. For pretty much every Apple API, this was the wrong decision. On top of all that, it was really hard to refer to a method when you didn&rsquo;t want to call it. (Most methods with the same base name still have unique labels, so you don&rsquo;t need the types to disambiguate.)<\/p>\n<p>So we introduced the notion of &ldquo;full names&rdquo;, which are the things you see written as <code>move(from:to:)<\/code> (and which are represented by <code>DeclName<\/code> in the compiler). Almost immediately diagnostics got better, testing optional protocol requirements got shorter, and a lot of compiler implementation got simpler.<\/p>\n<p>[&#8230;]<\/p>\n<p>And then we kind of got stuck here. We have full names used throughout the compiler, but tuple labels still appear in types. They&rsquo;re still used in mangling.<\/p>\n<\/blockquote>","protected":false},"excerpt":{"rendered":"<p>Jordan Rose (via Jaden Geller): The real blow, however, came with that very first idea: that we could treat methods with different argument labels as simple overloads in type. This led to poor diagnostics where the compiler couldn&rsquo;t decide whether to believe the types or the argument labels, and might tell you you have the [&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:05:08Z","apple_news_api_id":"b0d652ce-492d-43ed-9559-2e1a04c96194","apple_news_api_modified_at":"2020-04-21T18:05:08Z","apple_news_api_revision":"AAAAAAAAAAD\/\/\/\/\/\/\/\/\/\/w==","apple_news_api_share_url":"https:\/\/apple.news\/AsNZSzkktQ-2VWS4aBMlhlA","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":[295,46,71,901],"class_list":["post-15031","post","type-post","status-publish","format-standard","hentry","category-programming-category","tag-history","tag-languagedesign","tag-programming","tag-swift-programming-language"],"apple_news_notices":[],"_links":{"self":[{"href":"https:\/\/mjtsai.com\/blog\/wp-json\/wp\/v2\/posts\/15031","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=15031"}],"version-history":[{"count":2,"href":"https:\/\/mjtsai.com\/blog\/wp-json\/wp\/v2\/posts\/15031\/revisions"}],"predecessor-version":[{"id":28742,"href":"https:\/\/mjtsai.com\/blog\/wp-json\/wp\/v2\/posts\/15031\/revisions\/28742"}],"wp:attachment":[{"href":"https:\/\/mjtsai.com\/blog\/wp-json\/wp\/v2\/media?parent=15031"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/mjtsai.com\/blog\/wp-json\/wp\/v2\/categories?post=15031"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/mjtsai.com\/blog\/wp-json\/wp\/v2\/tags?post=15031"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}