mir2wasm

从 Rust 到 WebAssembly 的实验性编译器(非活动--请勿使用)。「An experimental compiler from Rust to WebAssembly (inactive - do not use)」

  • 所有者: brson/miri
  • 平台:
  • 許可證: Apache License 2.0
  • 分類:
  • 主題:
  • 喜歡:
    0
      比較:

Github星跟蹤圖

mir2wasm

This project is not under development and does nothing useful. If you just
want to compile Rust to WASM then the mainline Rust compiler can do that for
you. Read https://rustwasm.github.io/book/

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-2017-03-03

git clone https://github.com/brson/mir2wasm.git
cd mir2wasm
rustup override set nightly-2017-03-03
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.

主要指標

概覽
名稱與所有者brson/miri
主編程語言Rust
編程語言Rust (語言數: 4)
平台
許可證Apache License 2.0
所有者活动
創建於2016-05-10 17:29:21
推送於2020-05-07 09:21:32
最后一次提交2018-08-22 16:35:06
發布數0
用户参与
星數211
關注者數22
派生數15
提交數487
已啟用問題?
問題數17
打開的問題數13
拉請求數43
打開的拉請求數3
關閉的拉請求數1
项目设置
已啟用Wiki?
已存檔?
是復刻?
已鎖定?
是鏡像?
是私有?