Hello and welcome to another issue of This Week in Rust and WebAssembly!
Rust is a systems language pursuing the trifecta: safety, concurrency, and speed.
WebAssembly is a stack-based virtual machine and instruction set. It is fast, safe, portable, and part of the open Web platform. By compiling to WebAssembly, we can run Rust code on the Web!
This is a weekly summary of Rust and WebAssembly’s progress and community.
News and Blog Posts from Around the Web
Want to make sure something ends up on this list next time we publish an issue? Leave a comment on this issue.
Zemeroth is a turn-based hexagonal tactical game written in Rust and WebAssembly.
Seed is a new Wasm framework for Web apps.
edvorg/rustsmithis a Rocksmith clone for the Web platform built with Rust and WebAssembly.
Rust WebAssembly 2019 by Ryan Levick
My Rust 2019 Dream: Dominate the Web by richardanaya
Wasm 2019 by Yoshua Wuyts
Rust and WebAssembly in 2019 by Nick Fitzgerald
Non-Web Embeddings for Rust Wasm 2019 by Brandon Fish and wasmer.io
Wasm at the 2019 Rust All Hands
The 2019 Rust All Hands meetup was in Berlin on February 4th through 8th. @ag_dubs, @alexcrichton, @fitzgen, and @yoshuawuyts from the Rust and WebAssembly working group all made it out to discuss some Wasm-related topics and plan for 2019.
We talked about:
The road to
wasm-pack1.0. This meeting was about trying to pin down what we want to ship as part of a
wasm-pack1.0 release, as well as crystallize
wasm-pack’s ideal UX.
A modular toolkit for Wasm. There’s been a lot of talk in
#RustWasm2019posts and the 2019 roadmap RFC about building a modular toolkit for Wasm apps and libraries. This meeting was trying to dig a bit more into the details of what that entails. And naming, of course.
cargobuild tasks, hooks, and/or
post-build.rsfor Wasm. Long-term (likely on the timeline of a couple years) we would like the experience of building Rust and Wasm projects to be exactly the same as building normal Rust projects: just
cargo buildand that’s it. But there is a bunch of stuff that needs to happen for Wasm after
rustcemits a Wasm binary, such as generate JS bindings or run
wasm-opt. This meeting was about how to add some sort of generic build hooks to
wasm-packinto an implementation of those generic hooks specifically targeted for Wasm development.
Multithreading Wasm and
rayon. This meeting was about how we take our experimental Wasm multithreading support and turn it into a reliable library that can serve as the foundation for multithreading on the Web. @CUViper from the
rayonteam also joined, and we made a plan for how to get
rayonworking in Wasm.
2019 Roadmap — this is your chance to help shape our goals for the year!
- @DebugSteven wrote a testing section for the Game of Life tutorial!
@brson fixed a bug where we would attempt to demangle things that were not C++ symbols as if they were C++ symbols.
walrusis a new library crate for writing Wasm-to-Wasm transformations. It will eventually (but doesn’t yet) preserve DWARF debug info for the Wasm across your transformations.
walrusround-tripping all the Wasm spec tests correctly.
@fitzgen wrote a simple Wasm fuzzer, immediately found a bug, and whipped up a fix.
@alexcrichton refactored instruction parsing to avoid recursion. This means that we don’t blow the stack in debug builds or when given malicious input.
We just released
walrus0.1.0 on crates.io — expect more exciting things from
walrusin the future :)
@derekdreery improved the
JsValueso that it includes object properties and their values, instead of just
@fitzgen made the
wasm-bindgen-testtesting infrastructure capture more
consolelogging methods’ (
info, etc) output for displaying in
wasm-bindgen’s macro-generated code, so that running clippy on crates that use
wasm-bindgenisn’t so noisy.
@alexcrichton added support for passing
Option<MyEnum>back and forth between Wasm and JS if
@fitzgen added the
wasm-bindgen’s prelude. This extension trait adds
Result<T, E>that have the same behavior as regular
expectexcept they throw a JS error on failure instead of panicking. This is morally the same, but ends up avoiding the
std::fmtinfrastructure, resulting in smaller code sizes.
rustcWasm transformations to the new
walruscrate! This paves the way for maintaining DWARF debug info through
@fitzgen made the
wasm-bindgen-testruntime capture logged messages in tests via
innerHTML, avoiding issues when logging HTML strings ;)
@drager implemented support for typo detection in
@torkve added support for passing arbitrary extra CLI arguments through
wasm-pack buildand into
cargo build. For example, to build with all cargo features enabled:
wasm-pack build -- --all-features.
This inspired @chinedufn to add support for passing arbitrary extra CLI arguments through
wasm-pack testand into
@fitzgen fixed a bug where the output of
wasm-pack testwas printed twice.
@rhysd added support for emitting the “homepage” field in our generated
package.jsonif it is present in the crate’s
wasm-pack’s fetching of
chromedriverbinaries for headless browser testing on Windows.
Requests for Contribution
Want to get involved in Rust and WebAssembly? Join the Rust and WebAssembly working group!