Open jakelang opened 5 years ago
Another possibility is introducing a target triple for rustc wasm32-unknown-ewasm
That would be great!
I started this cargo submodule here: https://github.com/hugo-dc/cargo-build-ewasm
it executes: cargo build --target=wasm32-unknown-unknown --release
, then runs chisel run
(expects a default chisel.yml
configuration), and lastly executes wasm-snip
to reduce the bytecode size.
Tested in here: https://github.com/hugo-dc/wrc20-rust/blob/master/Makefile , it also needed to use wasm-opt
(from binaryen) to reduce even more the bytecode size.
Still have more changes to do, just wanted to share it, please let me know any comments.
It seems that integrating chisel with rust projects requires either a makefile or manual invocation, which isn't great ux. Perhaps a cargo subcommand or plugin would make this much easier. cc @axic