Join GitHub today
GitHub is home to over 31 million developers working together to host and review code, manage projects, and build software together.
Sign upProvide support for proposals #367
Comments
This comment has been minimized.
This comment has been minimized.
dcodeIO
commented
May 29, 2018
Sign-extension-ops and mutable-globals are something AssemblyScript can produce behind feature flags, so being able to "transpile" these for environments that do not support these specs yet seems useful, similar to how Babel transpiles things in JS-space. Multi-value hasn't been touched on the AS side yet (don't know if there are other producers emitting them already), but the expectation is that there'll be a flag for these as well (fwiw: implementation will most likely be based on returning object literals that must then be destructured by the callee). |
This comment has been minimized.
This comment has been minimized.
The first thing I learnt from implementing a partial multi-value transform is that the AST tools need to be improved, that's my current priority! Following that, I'm interested to see how some of the other later-stage proposals might be transpiled, e.g. https://github.com/WebAssembly/reference-types/blob/master/proposals/reference-types/Overview.md |
This comment has been minimized.
This comment has been minimized.
The proposal has made it to phase 4, it's going to be shipped. Should we still polyfill it? |
This comment has been minimized.
This comment has been minimized.
I have done some work on polyfilling sign extension operators #375. I think polyfills for completed proposals can still be useful (at least for us to see what's possible etc). |
xtuc commentedMay 29, 2018
•
edited
Continuing the discussion on Slack.
Here's a list of proposal that we mentioned.
Sign-extension operators
WebAssembly/design#1178
This impacts the wasm format and type-checker (validation), new instructions needs to be parsed/emitted and checked.
cc @maurobringolf
Multi-value
WebAssembly/design#1146
We can simulate multiple returns values using registers (globals). The transformation itself sounds trivial, but it may have some side effects. Our wast-parser and the typechecker should already work.
More information https://blog.scottlogic.com/2018/05/29/transpiling-webassembly.html
cc @ColinEberhardt
Import/Export of Mutable Globals
WebAssembly/design#1179
This is what is done in Webpack, we don't allow importing globals from JS. The transformation removes the imports and emit "managed" mutable globals instead.
While we can expect compiler to emit such code at the moment, we can do a smaller transformation in Webpack.
cc @xtuc
Other ideas