Skip to content
/ mir2wasm Public
forked from brson/miri

An experimental compiler from Rust to WebAssembly

License

Apache-2.0, MIT licenses found

Licenses found

Apache-2.0
LICENSE-APACHE
MIT
LICENSE-MIT
Notifications You must be signed in to change notification settings

eholk/mir2wasm

 
 

Repository files navigation

mir2wasm

An experimental compiler from Rust to WebAssembly, based on rustc + Rust MIR.

This doesn't do anything useful yet.

Hacking notes

I recommend that you install rustup and then use it to install the current rustc nightly version:

Tested with nightly-2016-09-29

git clone https://github.com/brson/mir2wasm.git
cd mir2wasm
rustup override set nightly-2016-09-29
cargo build
cargo run -q -- rust-examples/nocore-hello-world.rs

Do println debugging with debug! so it goes to stderr and print it like:

RUST_LOG=mir2wasm cargo run -q -- rust-examples/nocore-hello-world.rs
rustc -Z unstable-options --unpretty=mir rust-examples/nocore-hello-world.rs

rustc docs.

Plug this stuff into a wast file to print something:

  (import $print_i32 "spectest" "print" (param i32))
  (export "foo" $foo)
...
    (call_import $print_i32 (get_local $1))

Resources

  • miri the MIR interpreter. mir2wasm is derived from it but shares no actual code. It probably should share code though, and there's lots to learn from miri.
  • rustc_trans::mir.
  • roadmap discussion.

License

Licensed under either of

Contribution

Unless you explicitly state otherwise, any contribution intentionally submitted for inclusion in the work by you shall be dual licensed as above, without any additional terms or conditions.

About

An experimental compiler from Rust to WebAssembly

Resources

License

Apache-2.0, MIT licenses found

Licenses found

Apache-2.0
LICENSE-APACHE
MIT
LICENSE-MIT

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Rust 81.1%
  • TeX 18.1%
  • Other 0.8%