{"action":"created","issue":{"url":"https://api.github.com/repos/WebAssembly/binaryen/issues/33","labels_url":"https://api.github.com/repos/WebAssembly/binaryen/issues/33/labels{/name}","comments_url":"https://api.github.com/repos/WebAssembly/binaryen/issues/33/comments","events_url":"https://api.github.com/repos/WebAssembly/binaryen/issues/33/events","html_url":"https://github.com/WebAssembly/binaryen/issues/33","id":123648301,"number":33,"title":"Use zero based local symbol naming","user":{"login":"JSStats","id":11826073,"avatar_url":"https://avatars.githubusercontent.com/u/11826073?v=3","gravatar_id":"","url":"https://api.github.com/users/JSStats","html_url":"https://github.com/JSStats","followers_url":"https://api.github.com/users/JSStats/followers","following_url":"https://api.github.com/users/JSStats/following{/other_user}","gists_url":"https://api.github.com/users/JSStats/gists{/gist_id}","starred_url":"https://api.github.com/users/JSStats/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/JSStats/subscriptions","organizations_url":"https://api.github.com/users/JSStats/orgs","repos_url":"https://api.github.com/users/JSStats/repos","events_url":"https://api.github.com/users/JSStats/events{/privacy}","received_events_url":"https://api.github.com/users/JSStats/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":1,"created_at":"2015-12-23T12:06:52Z","updated_at":"2015-12-24T04:30:37Z","closed_at":null,"body":"The asm2wasm output labels the locals with symbols using the pattern `$i<n>` starting with `$i1`. The wast spec allows these to be named by index, starting at zero. If the naming also started at `$i0` then the index would match, and this might be handy when comparing it to the encoded files."},"comment":{"url":"https://api.github.com/repos/WebAssembly/binaryen/issues/comments/167039929","html_url":"https://github.com/WebAssembly/binaryen/issues/33#issuecomment-167039929","issue_url":"https://api.github.com/repos/WebAssembly/binaryen/issues/33","id":167039929,"user":{"login":"kripken","id":173661,"avatar_url":"https://avatars.githubusercontent.com/u/173661?v=3","gravatar_id":"","url":"https://api.github.com/users/kripken","html_url":"https://github.com/kripken","followers_url":"https://api.github.com/users/kripken/followers","following_url":"https://api.github.com/users/kripken/following{/other_user}","gists_url":"https://api.github.com/users/kripken/gists{/gist_id}","starred_url":"https://api.github.com/users/kripken/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/kripken/subscriptions","organizations_url":"https://api.github.com/users/kripken/orgs","repos_url":"https://api.github.com/users/kripken/repos","events_url":"https://api.github.com/users/kripken/events{/privacy}","received_events_url":"https://api.github.com/users/kripken/received_events","type":"User","site_admin":false},"created_at":"2015-12-24T04:30:37Z","updated_at":"2015-12-24T04:30:37Z","body":"The local names should be the same as in asm.js. There, `i1` etc. are int32s, while `d1` etc. are doubles, etc.\r\n\r\nI agree it might be nice to be zero-based for comparison to the encoded files, but the comparison to the original asm.js would suffer if we rename locals in asm2wasm. Instead, we could write a pass to do that renaming, although it would actually be equivalent to converting to binary and back, so I don't think it's necessary."}}