{"action":"created","issue":{"url":"https://api.github.com/repos/WebAssembly/design/issues/474","labels_url":"https://api.github.com/repos/WebAssembly/design/issues/474/labels{/name}","comments_url":"https://api.github.com/repos/WebAssembly/design/issues/474/comments","events_url":"https://api.github.com/repos/WebAssembly/design/issues/474/events","html_url":"https://github.com/WebAssembly/design/issues/474","id":118207646,"number":474,"title":"Why is select a \"type-parameterized\" operation?","user":{"login":"AndrewScheidecker","id":2691804,"avatar_url":"https://avatars.githubusercontent.com/u/2691804?v=3","gravatar_id":"","url":"https://api.github.com/users/AndrewScheidecker","html_url":"https://github.com/AndrewScheidecker","followers_url":"https://api.github.com/users/AndrewScheidecker/followers","following_url":"https://api.github.com/users/AndrewScheidecker/following{/other_user}","gists_url":"https://api.github.com/users/AndrewScheidecker/gists{/gist_id}","starred_url":"https://api.github.com/users/AndrewScheidecker/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/AndrewScheidecker/subscriptions","organizations_url":"https://api.github.com/users/AndrewScheidecker/orgs","repos_url":"https://api.github.com/users/AndrewScheidecker/repos","events_url":"https://api.github.com/users/AndrewScheidecker/events{/privacy}","received_events_url":"https://api.github.com/users/AndrewScheidecker/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":33,"created_at":"2015-11-21T16:46:47Z","updated_at":"2016-01-26T16:57:45Z","closed_at":null,"body":"Since it's just a strict form of `if_else`, it seems like it should be parametric like `if_else`: e.g. instead of writing `i32.select` you just write `select` and the `i32` is inferred from the context."},"comment":{"url":"https://api.github.com/repos/WebAssembly/design/issues/comments/175114973","html_url":"https://github.com/WebAssembly/design/issues/474#issuecomment-175114973","issue_url":"https://api.github.com/repos/WebAssembly/design/issues/474","id":175114973,"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},"created_at":"2016-01-26T16:57:45Z","updated_at":"2016-01-26T16:57:45Z","body":"@JSStats @rossberg-chromium In practical terms, it doesn't make sense for `select` to have any-type, the empty type, or whatever wasm ends up having. Since it's strict, its only purpose is to deliver a meaningful return value.\r\n\r\nI propose we address @lukewagner's concern above about user-defined types as follows:\r\n - `i32.select`: select between two i32 values\r\n - `i64.select`: select between two i64 values\r\n - `f32.select`: select between two f32 values\r\n - `f64.select`: select between two f64 values\r\n - `gc.select`: select between two values of the same user-defined GC type (parametric)\r\n etc.\r\n\r\nThis defines select exactly for the types for which it makes sense, it lets JITs avoid overloading behavior in practice (even if there's a language-theoretical sense in which we don't *call* it overloading), and it supports user-defined types in a practical way.\r\n"}}