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 up
Provide support for proposals #367
Continuing the discussion on Slack.
Here's a list of proposal that we mentioned.
This impacts the wasm format and type-checker (validation), new instructions needs to be parsed/emitted and checked.
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
Import/Export of Mutable Globals
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.
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).
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