{"id":9865,"date":"2014-10-14T16:58:18","date_gmt":"2014-10-14T20:58:18","guid":{"rendered":"http:\/\/mjtsai.com\/blog\/?p=9865"},"modified":"2014-10-14T17:02:14","modified_gmt":"2014-10-14T21:02:14","slug":"hypothetical-objective-c-3-0","status":"publish","type":"post","link":"https:\/\/mjtsai.com\/blog\/2014\/10\/14\/hypothetical-objective-c-3-0\/","title":{"rendered":"Hypothetical Objective-C 3.0"},"content":{"rendered":"<p><a href=\"http:\/\/swiftopinions.wordpress.com\/2014\/10\/12\/an-objc-3-0-what-if\/\">Christoffer Lern&ouml;<\/a>:<\/p>\n<blockquote cite=\"http:\/\/swiftopinions.wordpress.com\/2014\/10\/12\/an-objc-3-0-what-if\/\"><p>Many had expected Swift to be more an Objective-C 3.0 than it turned out to be. But what could we have expected such a hypothetical language to look like?<\/p><\/blockquote>\n<p><a href=\"http:\/\/swiftopinions.wordpress.com\/2014\/10\/13\/objc-3-0-beyond-a-new-syntax\/\">Christoffer Lern&ouml;<\/a> (<a href=\"https:\/\/news.ycombinator.com\/item?id=8450205\">comments<\/a>):<\/p>\n<blockquote cite=\"http:\/\/swiftopinions.wordpress.com\/2014\/10\/13\/objc-3-0-beyond-a-new-syntax\/\"><p>This list is actually just a sample to get the ideas flowing, and to illustrate how some of the hurdles with ObjC 2.0 can be overcome by a successor that breaks syntax with the past, but still retains full backward compatibility.<\/p><\/blockquote>\n<p><a href=\"http:\/\/owensd.io\/2014\/10\/14\/building-a-better-objc.html\">David Owens<\/a>:<\/p>\n<blockquote cite=\"http:\/\/owensd.io\/2014\/10\/14\/building-a-better-objc.html\"><p>I think the biggest disservice we can do to the Cocoa developer community is remove the underpinnings of the ObjC runtime. It is the language&rsquo;s, and I truly believe, the platforms&rsquo; greatest strength.<\/p>\n<p>I believe if we hide the complexities of C from our source code and focus on letting the power of the ObjC runtime shine through in our code, we can create a new language that provides of the great flexibility of the ObjC runtime while still accomplishing many of the goals that Swift is attempting to solve - namely safer code by default.<\/p><\/blockquote>\n<p>Consider how much progress could have been made with Objective-C had the resources from the Swift project been applied to it instead. Swift is an immensely complicated language that still needs a long time to mature. Objective-C is a much smaller language with a solid core and seemingly a lot of low-hanging fruit (syntax improvements, increased safety).<\/p>\n<p>For example, a better blocks syntax and support for Python-style comprehensions in Objective-C would do a lot for me today, making my code more concise and readable. Swift&rsquo;s generics feature was likely more difficult to implement, and it arguably makes the code less readable and for dubious benefits.<\/p>\n<p>Additionally, an improved Objective-C could in many cases compile down to binaries that work smoothly with existing code and older OS versions. It could still use the same runtime. With Swift, Apple is instead <a href=\"http:\/\/mjtsai.com\/blog\/2014\/06\/27\/the-case-for-message-passing-in-swift\/\">dropping<\/a> some of the benefits of the Objective-C runtime and creating migration issues because some Swift elements don&rsquo;t interoperate with Objective-C, and others bridge but with performance penalties. We&rsquo;ve only seen the tip of the interoperability iceberg because so far all of Apple&rsquo;s APIs are native Objective-C.<\/p>\n<p>Apple seems to be betting that the benefits for making a whole new language will be worth the migration costs and the stagnation of the language that most of us are actually using. I&rsquo;m not convinced because most of my favorite Swift features seem like they could have fit into an Objective-C 3.0.<\/p>","protected":false},"excerpt":{"rendered":"<p>Christoffer Lern&ouml;: Many had expected Swift to be more an Objective-C 3.0 than it turned out to be. But what could we have expected such a hypothetical language to look like? Christoffer Lern&ouml; (comments): This list is actually just a sample to get the ideas flowing, and to illustrate how some of the hurdles with [&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":[46,54,71,901],"class_list":["post-9865","post","type-post","status-publish","format-standard","hentry","category-programming-category","tag-languagedesign","tag-objective-c","tag-programming","tag-swift-programming-language"],"apple_news_notices":[],"_links":{"self":[{"href":"https:\/\/mjtsai.com\/blog\/wp-json\/wp\/v2\/posts\/9865","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=9865"}],"version-history":[{"count":2,"href":"https:\/\/mjtsai.com\/blog\/wp-json\/wp\/v2\/posts\/9865\/revisions"}],"predecessor-version":[{"id":9867,"href":"https:\/\/mjtsai.com\/blog\/wp-json\/wp\/v2\/posts\/9865\/revisions\/9867"}],"wp:attachment":[{"href":"https:\/\/mjtsai.com\/blog\/wp-json\/wp\/v2\/media?parent=9865"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/mjtsai.com\/blog\/wp-json\/wp\/v2\/categories?post=9865"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/mjtsai.com\/blog\/wp-json\/wp\/v2\/tags?post=9865"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}