{"action":"created","comment":{"url":"https://api.github.com/repos/WebAssembly/design/pulls/comments/41423074","id":41423074,"diff_hunk":"@@ -0,0 +1,216 @@\n+# Design Rationale\n+\n+WebAssembly was designed incrementally, and desisions were made with a solid\n+rationale which may turn out to be incorrect in the future. Sometimes, decisions\n+were made without the luxury of data, and the designers would like to revisit\n+certain decisions once real end-to-end usecases are met and Science can be\n+performed.\n+\n+You, the reader, may also be interested in understanding why\n+[Abstract Syntax Tree (AST)](AstSemantics.md) semantics are the way they are,\n+and digging through github's issues and pull requests becomes difficult.\n+\n+This rationale document tries to list how decisions were made, and where\n+tradeoffs were made for the sake of language ergonomics, portability,\n+performance, security, and Getting Things Done.\n+\n+[Limited local nondeterminism](Nondeterminism.md) is detailed in its own\n+document, its rationale is also explained here.\n+\n+\n+## Why AST?\n+\n+Why not a stack-, register- or SSA-based bytecode?\n+* Trees allow a smaller binary encoding: [JSZap][], [Slim Binaries][].\n+* [Polyfill prototype][] shows simple and efficient translation to asm.js.\n+\n+  [JSZap]: https://research.microsoft.com/en-us/projects/jszap/\n+  [Slim Binaries]: https://citeseerx.ist.psu.edu/viewdoc/summary?doi=10.1.1.108.1711\n+  [Polyfill prototype]: https://github.com/WebAssembly/polyfill-prototype-1\n+\n+\n+## Basic Types Only\n+\n+WebAssembly only represents [a few types](AstSemantics.md#Types).\n+* More complex types can be formed from these basic types. It's up to the source\n+  language compiler to express its own types in terms of the basic machine\n+  types. This allows WebAssembly to present itself as a virtual ISA, and lets\n+  compilers target it as they would any other ISA.\n+* These types are efficiently executed by all modern architectures.\n+* Smaller types (such as `i8` and `i16`) are no more efficient and are only\n+  semantically meaningful for memory accesses.\n+* Other types (such as `f16`, `f80`, `i128`) aren't widely supported by existing\n+  hardware and can be supported by runtime libraries if developers wish to use\n+  them. They can be added to WebAssembly later without compromising MVP.","path":"Rationale.md","position":44,"original_position":44,"commit_id":"9357074551f2b74acb810f5933f010ec7548c287","original_commit_id":"9357074551f2b74acb810f5933f010ec7548c287","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},"body":"I'd take `f80` out of this list, or if you really want to mention it, address it separately, because there would be significant hurdles to adding it to WebAssembly later, if it even could be considered.\r\n\r\nx86-style `f80` is not portable to non-x86 machines, and even on x86 machines it requires specialized codegen support because of the stack-based register file, so it's a significant implementation burden. And as a soft-float type, it's less desirable than other soft-float types, in part because it has \"unsupported\" bit patterns sometimes known by names as pseudo-NaNs.","created_at":"2015-10-07T17:56:13Z","updated_at":"2015-10-07T17:56:13Z","html_url":"https://github.com/WebAssembly/design/pull/390#discussion_r41423074","pull_request_url":"https://api.github.com/repos/WebAssembly/design/pulls/390","_links":{"self":{"href":"https://api.github.com/repos/WebAssembly/design/pulls/comments/41423074"},"html":{"href":"https://github.com/WebAssembly/design/pull/390#discussion_r41423074"},"pull_request":{"href":"https://api.github.com/repos/WebAssembly/design/pulls/390"}}},"pull_request":{"url":"https://api.github.com/repos/WebAssembly/design/pulls/390","id":46954586,"html_url":"https://github.com/WebAssembly/design/pull/390","diff_url":"https://github.com/WebAssembly/design/pull/390.diff","patch_url":"https://github.com/WebAssembly/design/pull/390.patch","issue_url":"https://api.github.com/repos/WebAssembly/design/issues/390","number":390,"state":"open","locked":false,"title":"Add Rationale.md","user":{"login":"jfbastien","id":298127,"avatar_url":"https://avatars.githubusercontent.com/u/298127?v=3","gravatar_id":"","url":"https://api.github.com/users/jfbastien","html_url":"https://github.com/jfbastien","followers_url":"https://api.github.com/users/jfbastien/followers","following_url":"https://api.github.com/users/jfbastien/following{/other_user}","gists_url":"https://api.github.com/users/jfbastien/gists{/gist_id}","starred_url":"https://api.github.com/users/jfbastien/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jfbastien/subscriptions","organizations_url":"https://api.github.com/users/jfbastien/orgs","repos_url":"https://api.github.com/users/jfbastien/repos","events_url":"https://api.github.com/users/jfbastien/events{/privacy}","received_events_url":"https://api.github.com/users/jfbastien/received_events","type":"User","site_admin":false},"body":"Move some of AstSemantics.md to that document. I left things pretty much as-is for now, and will defer more contended discussions to subsequent (and more targetted) edits.","created_at":"2015-10-06T20:39:09Z","updated_at":"2015-10-07T17:56:13Z","closed_at":null,"merged_at":null,"merge_commit_sha":"3f6fc686df6d2cf0b2ceb4edf071d76a9f84de2e","assignee":null,"milestone":{"url":"https://api.github.com/repos/WebAssembly/design/milestones/2","html_url":"https://github.com/WebAssembly/design/milestones/MVP","labels_url":"https://api.github.com/repos/WebAssembly/design/milestones/2/labels","id":1138963,"number":2,"title":"MVP","description":"See [here](https://github.com/WebAssembly/design/blob/master/MVP.md) for details.","creator":{"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},"open_issues":37,"closed_issues":16,"state":"open","created_at":"2015-05-29T00:13:49Z","updated_at":"2015-10-06T20:39:09Z","due_on":null,"closed_at":null},"commits_url":"https://api.github.com/repos/WebAssembly/design/pulls/390/commits","review_comments_url":"https://api.github.com/repos/WebAssembly/design/pulls/390/comments","review_comment_url":"https://api.github.com/repos/WebAssembly/design/pulls/comments{/number}","comments_url":"https://api.github.com/repos/WebAssembly/design/issues/390/comments","statuses_url":"https://api.github.com/repos/WebAssembly/design/statuses/9357074551f2b74acb810f5933f010ec7548c287","head":{"label":"WebAssembly:rationale","ref":"rationale","sha":"9357074551f2b74acb810f5933f010ec7548c287","user":{"login":"WebAssembly","id":11578470,"avatar_url":"https://avatars.githubusercontent.com/u/11578470?v=3","gravatar_id":"","url":"https://api.github.com/users/WebAssembly","html_url":"https://github.com/WebAssembly","followers_url":"https://api.github.com/users/WebAssembly/followers","following_url":"https://api.github.com/users/WebAssembly/following{/other_user}","gists_url":"https://api.github.com/users/WebAssembly/gists{/gist_id}","starred_url":"https://api.github.com/users/WebAssembly/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/WebAssembly/subscriptions","organizations_url":"https://api.github.com/users/WebAssembly/orgs","repos_url":"https://api.github.com/users/WebAssembly/repos","events_url":"https://api.github.com/users/WebAssembly/events{/privacy}","received_events_url":"https://api.github.com/users/WebAssembly/received_events","type":"Organization","site_admin":false},"repo":{"id":34808241,"name":"design","full_name":"WebAssembly/design","owner":{"login":"WebAssembly","id":11578470,"avatar_url":"https://avatars.githubusercontent.com/u/11578470?v=3","gravatar_id":"","url":"https://api.github.com/users/WebAssembly","html_url":"https://github.com/WebAssembly","followers_url":"https://api.github.com/users/WebAssembly/followers","following_url":"https://api.github.com/users/WebAssembly/following{/other_user}","gists_url":"https://api.github.com/users/WebAssembly/gists{/gist_id}","starred_url":"https://api.github.com/users/WebAssembly/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/WebAssembly/subscriptions","organizations_url":"https://api.github.com/users/WebAssembly/orgs","repos_url":"https://api.github.com/users/WebAssembly/repos","events_url":"https://api.github.com/users/WebAssembly/events{/privacy}","received_events_url":"https://api.github.com/users/WebAssembly/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/WebAssembly/design","description":"WebAssembly Design Documents","fork":false,"url":"https://api.github.com/repos/WebAssembly/design","forks_url":"https://api.github.com/repos/WebAssembly/design/forks","keys_url":"https://api.github.com/repos/WebAssembly/design/keys{/key_id}","collaborators_url":"https://api.github.com/repos/WebAssembly/design/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/WebAssembly/design/teams","hooks_url":"https://api.github.com/repos/WebAssembly/design/hooks","issue_events_url":"https://api.github.com/repos/WebAssembly/design/issues/events{/number}","events_url":"https://api.github.com/repos/WebAssembly/design/events","assignees_url":"https://api.github.com/repos/WebAssembly/design/assignees{/user}","branches_url":"https://api.github.com/repos/WebAssembly/design/branches{/branch}","tags_url":"https://api.github.com/repos/WebAssembly/design/tags","blobs_url":"https://api.github.com/repos/WebAssembly/design/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/WebAssembly/design/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/WebAssembly/design/git/refs{/sha}","trees_url":"https://api.github.com/repos/WebAssembly/design/git/trees{/sha}","statuses_url":"https://api.github.com/repos/WebAssembly/design/statuses/{sha}","languages_url":"https://api.github.com/repos/WebAssembly/design/languages","stargazers_url":"https://api.github.com/repos/WebAssembly/design/stargazers","contributors_url":"https://api.github.com/repos/WebAssembly/design/contributors","subscribers_url":"https://api.github.com/repos/WebAssembly/design/subscribers","subscription_url":"https://api.github.com/repos/WebAssembly/design/subscription","commits_url":"https://api.github.com/repos/WebAssembly/design/commits{/sha}","git_commits_url":"https://api.github.com/repos/WebAssembly/design/git/commits{/sha}","comments_url":"https://api.github.com/repos/WebAssembly/design/comments{/number}","issue_comment_url":"https://api.github.com/repos/WebAssembly/design/issues/comments{/number}","contents_url":"https://api.github.com/repos/WebAssembly/design/contents/{+path}","compare_url":"https://api.github.com/repos/WebAssembly/design/compare/{base}...{head}","merges_url":"https://api.github.com/repos/WebAssembly/design/merges","archive_url":"https://api.github.com/repos/WebAssembly/design/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/WebAssembly/design/downloads","issues_url":"https://api.github.com/repos/WebAssembly/design/issues{/number}","pulls_url":"https://api.github.com/repos/WebAssembly/design/pulls{/number}","milestones_url":"https://api.github.com/repos/WebAssembly/design/milestones{/number}","notifications_url":"https://api.github.com/repos/WebAssembly/design/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/WebAssembly/design/labels{/name}","releases_url":"https://api.github.com/repos/WebAssembly/design/releases{/id}","created_at":"2015-04-29T17:36:05Z","updated_at":"2015-10-07T16:40:53Z","pushed_at":"2015-10-07T16:24:00Z","git_url":"git://github.com/WebAssembly/design.git","ssh_url":"git@github.com:WebAssembly/design.git","clone_url":"https://github.com/WebAssembly/design.git","svn_url":"https://github.com/WebAssembly/design","homepage":"","size":3813,"stargazers_count":4441,"watchers_count":4441,"language":null,"has_issues":true,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":224,"mirror_url":null,"open_issues_count":83,"forks":224,"open_issues":83,"watchers":4441,"default_branch":"master"}},"base":{"label":"WebAssembly:master","ref":"master","sha":"4a6b3a3d137b402149ee12216d4c62e3d44b8ca3","user":{"login":"WebAssembly","id":11578470,"avatar_url":"https://avatars.githubusercontent.com/u/11578470?v=3","gravatar_id":"","url":"https://api.github.com/users/WebAssembly","html_url":"https://github.com/WebAssembly","followers_url":"https://api.github.com/users/WebAssembly/followers","following_url":"https://api.github.com/users/WebAssembly/following{/other_user}","gists_url":"https://api.github.com/users/WebAssembly/gists{/gist_id}","starred_url":"https://api.github.com/users/WebAssembly/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/WebAssembly/subscriptions","organizations_url":"https://api.github.com/users/WebAssembly/orgs","repos_url":"https://api.github.com/users/WebAssembly/repos","events_url":"https://api.github.com/users/WebAssembly/events{/privacy}","received_events_url":"https://api.github.com/users/WebAssembly/received_events","type":"Organization","site_admin":false},"repo":{"id":34808241,"name":"design","full_name":"WebAssembly/design","owner":{"login":"WebAssembly","id":11578470,"avatar_url":"https://avatars.githubusercontent.com/u/11578470?v=3","gravatar_id":"","url":"https://api.github.com/users/WebAssembly","html_url":"https://github.com/WebAssembly","followers_url":"https://api.github.com/users/WebAssembly/followers","following_url":"https://api.github.com/users/WebAssembly/following{/other_user}","gists_url":"https://api.github.com/users/WebAssembly/gists{/gist_id}","starred_url":"https://api.github.com/users/WebAssembly/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/WebAssembly/subscriptions","organizations_url":"https://api.github.com/users/WebAssembly/orgs","repos_url":"https://api.github.com/users/WebAssembly/repos","events_url":"https://api.github.com/users/WebAssembly/events{/privacy}","received_events_url":"https://api.github.com/users/WebAssembly/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/WebAssembly/design","description":"WebAssembly Design Documents","fork":false,"url":"https://api.github.com/repos/WebAssembly/design","forks_url":"https://api.github.com/repos/WebAssembly/design/forks","keys_url":"https://api.github.com/repos/WebAssembly/design/keys{/key_id}","collaborators_url":"https://api.github.com/repos/WebAssembly/design/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/WebAssembly/design/teams","hooks_url":"https://api.github.com/repos/WebAssembly/design/hooks","issue_events_url":"https://api.github.com/repos/WebAssembly/design/issues/events{/number}","events_url":"https://api.github.com/repos/WebAssembly/design/events","assignees_url":"https://api.github.com/repos/WebAssembly/design/assignees{/user}","branches_url":"https://api.github.com/repos/WebAssembly/design/branches{/branch}","tags_url":"https://api.github.com/repos/WebAssembly/design/tags","blobs_url":"https://api.github.com/repos/WebAssembly/design/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/WebAssembly/design/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/WebAssembly/design/git/refs{/sha}","trees_url":"https://api.github.com/repos/WebAssembly/design/git/trees{/sha}","statuses_url":"https://api.github.com/repos/WebAssembly/design/statuses/{sha}","languages_url":"https://api.github.com/repos/WebAssembly/design/languages","stargazers_url":"https://api.github.com/repos/WebAssembly/design/stargazers","contributors_url":"https://api.github.com/repos/WebAssembly/design/contributors","subscribers_url":"https://api.github.com/repos/WebAssembly/design/subscribers","subscription_url":"https://api.github.com/repos/WebAssembly/design/subscription","commits_url":"https://api.github.com/repos/WebAssembly/design/commits{/sha}","git_commits_url":"https://api.github.com/repos/WebAssembly/design/git/commits{/sha}","comments_url":"https://api.github.com/repos/WebAssembly/design/comments{/number}","issue_comment_url":"https://api.github.com/repos/WebAssembly/design/issues/comments{/number}","contents_url":"https://api.github.com/repos/WebAssembly/design/contents/{+path}","compare_url":"https://api.github.com/repos/WebAssembly/design/compare/{base}...{head}","merges_url":"https://api.github.com/repos/WebAssembly/design/merges","archive_url":"https://api.github.com/repos/WebAssembly/design/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/WebAssembly/design/downloads","issues_url":"https://api.github.com/repos/WebAssembly/design/issues{/number}","pulls_url":"https://api.github.com/repos/WebAssembly/design/pulls{/number}","milestones_url":"https://api.github.com/repos/WebAssembly/design/milestones{/number}","notifications_url":"https://api.github.com/repos/WebAssembly/design/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/WebAssembly/design/labels{/name}","releases_url":"https://api.github.com/repos/WebAssembly/design/releases{/id}","created_at":"2015-04-29T17:36:05Z","updated_at":"2015-10-07T16:40:53Z","pushed_at":"2015-10-07T16:24:00Z","git_url":"git://github.com/WebAssembly/design.git","ssh_url":"git@github.com:WebAssembly/design.git","clone_url":"https://github.com/WebAssembly/design.git","svn_url":"https://github.com/WebAssembly/design","homepage":"","size":3813,"stargazers_count":4441,"watchers_count":4441,"language":null,"has_issues":true,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":224,"mirror_url":null,"open_issues_count":83,"forks":224,"open_issues":83,"watchers":4441,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/WebAssembly/design/pulls/390"},"html":{"href":"https://github.com/WebAssembly/design/pull/390"},"issue":{"href":"https://api.github.com/repos/WebAssembly/design/issues/390"},"comments":{"href":"https://api.github.com/repos/WebAssembly/design/issues/390/comments"},"review_comments":{"href":"https://api.github.com/repos/WebAssembly/design/pulls/390/comments"},"review_comment":{"href":"https://api.github.com/repos/WebAssembly/design/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/WebAssembly/design/pulls/390/commits"},"statuses":{"href":"https://api.github.com/repos/WebAssembly/design/statuses/9357074551f2b74acb810f5933f010ec7548c287"}}}}