sway icon indicating copy to clipboard operation
sway copied to clipboard

Support compiling `sway-core` and `forc-pkg` to WASM?

Open mitchmindtree opened this issue 2 years ago • 1 comments

This is a bit of a moonshot issue and by no means a priority, but I've been meaning to open it for a while and would likely enable some pretty cool stuff (e.g. in-browser compilation, deploying from the browser, etc).

Some steps that come to mind in enabling this:

  • Review all I/O throughout sway-core and forc-pkg and consider browser-friendly alternatives. This would likely require support for handling in-memory representation of sway files, seeing if it's possible to compile git/ipfs deps to WASM, etc.
  • Add a wasm32-unknown-unknown build job to CI. Add one package at a time to avoid having to overhaul the whole repo in one PR.

On a related note: cc @JoshuaBatty is doing something like this a requirement to support Sway in vscode.dev? Or they support native plugins somehow?

mitchmindtree avatar Jan 30 '23 04:01 mitchmindtree

I'm not sure just yet, @sdankel is going to look into this for the current milestone. In-browser compilation certainly sounds juicy though.

JoshuaBatty avatar Jan 30 '23 04:01 JoshuaBatty