New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Provide support for proposals #367

xtuc opened this Issue May 29, 2018 · 4 comments


None yet
4 participants
Copy link

xtuc commented May 29, 2018

Continuing the discussion on Slack.

Here's a list of proposal that we mentioned.

Sign-extension operators


This impacts the wasm format and type-checker (validation), new instructions needs to be parsed/emitted and checked.

cc @maurobringolf



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

cc @ColinEberhardt

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.

cc @xtuc

Other ideas

  • I64 lower to i32, i32?

This comment has been minimized.

Copy link

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.

Copy link

ColinEberhardt commented May 29, 2018

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.


This comment has been minimized.

Copy link
Owner Author

xtuc commented May 29, 2018

Sign-extension operators

The proposal has made it to phase 4, it's going to be shipped. Should we still polyfill it?


This comment has been minimized.

Copy link

maurobringolf commented May 31, 2018

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).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment