{"action":"created","issue":{"url":"https://api.github.com/repos/WebAssembly/design/issues/681","repository_url":"https://api.github.com/repos/WebAssembly/design","labels_url":"https://api.github.com/repos/WebAssembly/design/issues/681/labels{/name}","comments_url":"https://api.github.com/repos/WebAssembly/design/issues/681/comments","events_url":"https://api.github.com/repos/WebAssembly/design/issues/681/events","html_url":"https://github.com/WebAssembly/design/pull/681","id":152566028,"number":681,"title":"Simplify br_if by removing its value operand.","user":{"login":"sunfishcode","id":4503403,"avatar_url":"https://avatars.githubusercontent.com/u/4503403?v=3","gravatar_id":"","url":"https://api.github.com/users/sunfishcode","html_url":"https://github.com/sunfishcode","followers_url":"https://api.github.com/users/sunfishcode/followers","following_url":"https://api.github.com/users/sunfishcode/following{/other_user}","gists_url":"https://api.github.com/users/sunfishcode/gists{/gist_id}","starred_url":"https://api.github.com/users/sunfishcode/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/sunfishcode/subscriptions","organizations_url":"https://api.github.com/users/sunfishcode/orgs","repos_url":"https://api.github.com/users/sunfishcode/repos","events_url":"https://api.github.com/users/sunfishcode/events{/privacy}","received_events_url":"https://api.github.com/users/sunfishcode/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":3,"created_at":"2016-05-02T14:34:39Z","updated_at":"2016-05-02T16:05:06Z","closed_at":null,"pull_request":{"url":"https://api.github.com/repos/WebAssembly/design/pulls/681","html_url":"https://github.com/WebAssembly/design/pull/681","diff_url":"https://github.com/WebAssembly/design/pull/681.diff","patch_url":"https://github.com/WebAssembly/design/pull/681.patch"},"body":"#677 is the latest in a long and complex discussion (https://github.com/WebAssembly/spec/issues/179, https://github.com/WebAssembly/spec/pull/180, https://github.com/WebAssembly/spec/pull/271, and others) about how to impose high-level typing rules on an assembly-style branch instruction. I and several other people actively involved in WebAssembly's design have been confused about what the rules are, which is not auspicious for its broader adventures.\r\n\r\nThe current state, where `br_if` has a value operand, but no return value, may satisfy certain properties relevant to the high-level typing system, but it is awkward from an assembly perspective, which is the perspective that motivated the instruction in the first place. It's essentially creating an optimized path for the case where a value is live on the branch-taken side of the branch but not the fallthrough side.\r\n\r\nThe bigger picture is that I don't think we've had the appropriate chance to figure out how we really want this instruction to work. I propose that `br_if`'s arity be limited to 0 in the MVP. We can change it to permit 1 in the future when we work out how we want it to work.\r\n\r\nAddressing the concern of code size, the numbers being quoted for block return values in general are in the neighborhood of 1%. I don't know the specific fraction of that which involves `br_if`, but even in the worst case, I claim this is rounding error when compared to the broader concern of designing a clean language."},"comment":{"url":"https://api.github.com/repos/WebAssembly/design/issues/comments/216277896","html_url":"https://github.com/WebAssembly/design/pull/681#issuecomment-216277896","issue_url":"https://api.github.com/repos/WebAssembly/design/issues/681","id":216277896,"user":{"login":"rossberg-chromium","id":4247099,"avatar_url":"https://avatars.githubusercontent.com/u/4247099?v=3","gravatar_id":"","url":"https://api.github.com/users/rossberg-chromium","html_url":"https://github.com/rossberg-chromium","followers_url":"https://api.github.com/users/rossberg-chromium/followers","following_url":"https://api.github.com/users/rossberg-chromium/following{/other_user}","gists_url":"https://api.github.com/users/rossberg-chromium/gists{/gist_id}","starred_url":"https://api.github.com/users/rossberg-chromium/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/rossberg-chromium/subscriptions","organizations_url":"https://api.github.com/users/rossberg-chromium/orgs","repos_url":"https://api.github.com/users/rossberg-chromium/repos","events_url":"https://api.github.com/users/rossberg-chromium/events{/privacy}","received_events_url":"https://api.github.com/users/rossberg-chromium/received_events","type":"User","site_admin":false},"created_at":"2016-05-02T16:05:06Z","updated_at":"2016-05-02T16:05:06Z","body":"Not simplify \"more\", but at all. ;) FWIW, I mentioned that very option on #677 a couple of days ago, where Alon replied \"I certainly hope not\".\r\n\r\nThat other `br_if` \"problem\" you mention could as well be solved by adding a return value, like you proposed a while ago. On the other hand, the discussion about removing implicit dropping also involved making more operators void, including sets and stores. That means that this \"problematic\" case would actually become the rule. Are you opposed to that as well?"}}