Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Writing wasm tooling in Rust #10

Closed
aturon opened this issue Jan 13, 2018 · 16 comments
Closed

Writing wasm tooling in Rust #10

aturon opened this issue Jan 13, 2018 · 16 comments
Labels
help wanted Extra attention is needed wasm tooling

Comments

@aturon
Copy link
Contributor

aturon commented Jan 13, 2018

This issue tracks existing and potential wasm tooling opportunities for Rust.

One of the exciting things about the wasm space is that there's a lot of need for brand new systems code to be written in the tooling space, e.g. code to munge .wasm files. A lot of the early tooling has been written in C++, but there's a real opportunity for Rust to serve as a common language both for writing wasm tools and for producing wasm code.

Existing wasm tools written in Rust

  • wasm-gc, "a small command to gc a wasm module and remove all unneeded exports, imports, functions, etc."
  • wasm-nm, "list the symbols within a wasm file".
  • wasm-snip, "replaces a wasm function body with unreachable"
  • rustwasm, a wasm interpreter in Rust
  • wasmi, wasm interpreter in Rust,
  • parity-wasm, wasm (de)serialization in Rust,
  • wasmparser - a wasm binary decoder with optional validation, in Rust
  • wasmtext - prints wasm modules in text format, in Rust
  • wasmstandalone - standalone JIT-based wasm runner, in Rust, using Cretonne, in early development

Desired wasm tools that could be written in Rust

Possible RIIR opportunities

Here are some existing tools that could, in principle, be (re)written in Rust instead:

@aturon
Copy link
Contributor Author

aturon commented Jan 13, 2018

A good example here is @alexcrichton's wasm-gc.

What are some other existing Rust-based tools we know about? And what are some needed tools we could start writing Rust code for?

@fitzgen
Copy link
Member

fitzgen commented Jan 13, 2018 via email

@aturon aturon changed the title WIIR tooling opportunities WIIR wasm tooling opportunities Jan 13, 2018
@aturon aturon added the help wanted Extra attention is needed label Jan 13, 2018
@aturon
Copy link
Contributor Author

aturon commented Jan 13, 2018

@aturon
Copy link
Contributor Author

aturon commented Jan 13, 2018

Added some RIIR (rather than WIIR) opportunities to the issue. This is more to inspire ideas for additional tools, rather than to suggest RIIR today.

@sunfishcode
Copy link

More existing projects:

  • wasmparser - a wasm binary decoder with optional validation, in Rust
  • wasmtext - prints wasm modules in text format, in Rust
  • wasmstandalone - standalone JIT-based wasm runner, in Rust, using Cretonne, in early development

@pepyakin
Copy link
Member

btw parity-wasm also contains an interpreter.

@pepyakin
Copy link
Member

ah i see, WIIR - write it in rust

@aturon aturon changed the title WIIR wasm tooling opportunities wasm tooling written in Rust Jan 13, 2018
@aturon
Copy link
Contributor Author

aturon commented Jan 13, 2018

@pepyakin thanks, clarified both.

@pepyakin
Copy link
Member

pepyakin commented Jan 13, 2018

Recently I spent a looot of time in wast code generated by Rust+emcc+fastcomp/Rust+emcc+llvm and recently with unknown-unknown. I think it would be cool if I have had something like a decompiler for WASM.

I don't know much about decompilers but I tend to think it should be easier to write one for wasm comparing to some "real" isa.

@aturon aturon changed the title wasm tooling written in Rust writing wasm tooling in Rust Jan 13, 2018
@aturon aturon changed the title writing wasm tooling in Rust Writing wasm tooling in Rust Jan 13, 2018
@alexcrichton
Copy link
Contributor

From my experience parity-wasm has solved all problems for parsing/encoding a wasm module, but I think it'd also be slick to have a crate 100% dedicated to just that (in that parity-wasm also has an interpreter).

@mgattozzi
Copy link
Contributor

Looks like somebody is working on wabt bindings in rust as well:
https://github.com/pepyakin/wabt-rs

@pepyakin
Copy link
Member

@alexcrichton there was some discussions about splitting interpreter into a separate crate. I actually like the idea.

@pepyakin
Copy link
Member

pepyakin commented Jan 23, 2018

Yep, actual split of interpreter took place: https://github.com/pepyakin/wasmi
It has quite a few differences from parity-wasm version.

@spastorino
Copy link
Contributor

I'm interested in helping here, will ping sbdy on IRC :).

@frehberg
Copy link

frehberg commented Mar 8, 2018

hi, I used Rust to implement the https://github.com/frehberg/wasm-sign

@alexcrichton
Copy link
Contributor

We've made a lot of progress here and I think we've reached a good steady state, so closing.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
help wanted Extra attention is needed wasm tooling
Projects
None yet
Development

No branches or pull requests

8 participants