Open mitchmindtree opened 1 year ago
I'm not sure just yet, @sdankel is going to look into this for the current milestone. In-browser compilation certainly sounds juicy though.
Having the same codebase/tooling work as CLI and in browser is pretty great.
We would need to first try ensure crates are no-std compliant.
This may also require a slight restructure of the project such that the CLI code (specifically clap
based code) is in a seperate crate to the core lib code.
This way the libraries can transition to no-std compliancy first; then later target the WASM based target (wasm32-unknown-unknown
).
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:
I/O
throughoutsway-core
andforc-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.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?