{"id":17385,"date":"2017-03-10T13:47:04","date_gmt":"2017-03-10T18:47:04","guid":{"rendered":"http:\/\/mjtsai.com\/blog\/?p=17385"},"modified":"2017-03-10T13:47:04","modified_gmt":"2017-03-10T18:47:04","slug":"rusts-language-ergonomics-initiative","status":"publish","type":"post","link":"https:\/\/mjtsai.com\/blog\/2017\/03\/10\/rusts-language-ergonomics-initiative\/","title":{"rendered":"Rust&rsquo;s Language Ergonomics Initiative"},"content":{"rendered":"<p><a href=\"https:\/\/blog.rust-lang.org\/2017\/03\/02\/lang-ergonomics.html\">Aaron Turon<\/a> (via <a href=\"https:\/\/twitter.com\/satefan\/status\/838055841672675328\">Joe Groff<\/a>, <a href=\"https:\/\/news.ycombinator.com\/item?id=13785277\">Hacker News<\/a>):<\/p>\n<blockquote cite=\"https:\/\/news.ycombinator.com\/item?id=13785277\"><p><\/p><\/blockquote>\n<blockquote cite=\"https:\/\/blog.rust-lang.org\/2017\/03\/02\/lang-ergonomics.html\"><p>There are three dimensions of the reasoning footprint for implicitness:<\/p>\n<ul>\n<li>Applicability. Where are you allowed to elide implied information? Is there any heads-up that this might be happening?<\/li>\n<li>Power. What influence does the elided information have? Can it radically change program behavior or its types?<\/li>\n<li>Context-dependence. How much of do you have to know about the rest of the code to know what is being implied, i.e. how elided details will be filled in? Is there always a clear place to look?<\/li>\n<\/ul>\n<p>The basic thesis of this post is that implicit features should balance these three dimensions. If a feature is large in one of the dimensions, it&rsquo;s best to strongly limit it in the other two.<\/p>\n<p>The <a href=\"https:\/\/blog.rust-lang.org\/2016\/11\/10\/Rust-1.13.html\"><code>?<\/code> operator<\/a> in Rust\nis a good example of this kind of tradeoff. It explicitly (but concisely) marks\na point where you will bail out of the current context on an error, possibly\ndoing an implicit conversion on the way. The fact that it&rsquo;s marked means the\nfeature has strongly limited applicability: you&rsquo;ll never be surprised that it&rsquo;s\ncoming into play. On the other hand, it&rsquo;s fairly powerful, and somewhat\ncontext-dependent, since the conversion can depend on the type where <code>?<\/code> is\nused, and the type expected in the scope it&rsquo;s jumping to. Altogether, this\ncareful balance makes error handling in Rust feels as ergonomic as working with\nexceptions while avoiding some of their well-known downsides.<\/p><\/blockquote>","protected":false},"excerpt":{"rendered":"<p>Aaron Turon (via Joe Groff, Hacker News): There are three dimensions of the reasoning footprint for implicitness: Applicability. Where are you allowed to elide implied information? Is there any heads-up that this might be happening? Power. What influence does the elided information have? Can it radically change program behavior or its types? Context-dependence. How much [&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,71,408],"class_list":["post-17385","post","type-post","status-publish","format-standard","hentry","category-programming-category","tag-languagedesign","tag-programming","tag-rust-lang"],"apple_news_notices":[],"_links":{"self":[{"href":"https:\/\/mjtsai.com\/blog\/wp-json\/wp\/v2\/posts\/17385","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=17385"}],"version-history":[{"count":1,"href":"https:\/\/mjtsai.com\/blog\/wp-json\/wp\/v2\/posts\/17385\/revisions"}],"predecessor-version":[{"id":17386,"href":"https:\/\/mjtsai.com\/blog\/wp-json\/wp\/v2\/posts\/17385\/revisions\/17386"}],"wp:attachment":[{"href":"https:\/\/mjtsai.com\/blog\/wp-json\/wp\/v2\/media?parent=17385"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/mjtsai.com\/blog\/wp-json\/wp\/v2\/categories?post=17385"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/mjtsai.com\/blog\/wp-json\/wp\/v2\/tags?post=17385"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}