Non-Web Embeddings for Rust Wasm 2019

Brandon Fish
Jan 15, 2019 · 2 min read

The Rust Wasm team has made tremendous progress in building robust developer tooling for Rust targeting WebAssembly on the Web in 2018. However, Non-Web Embeddings are also supported by WebAssembly but have not received much attention yet for Rust Wasm tooling. Our wish for Rust Wasm 2019 is to improve the tooling for Non-Web Wasm Embeddings which we believe also has enormous potential.

There are already many projects exploring the potential of Non-Web Wasm Embeddings:

  • Blockchain – Parity, NEAR Protocol
  • Edge Compute – Wasm Fastly Labs, Wasm Cloudflare Wokers
  • Embedded Devices
  • Server-side Development — Wasmer
  • Embedded Scripting (Games, Web Applications, and other sandboxed environments)
  • Serverless/Functions as a Service
  • Polyglot Programming
  • Cross-Platform Applications
  • Batch and Stream Data Processing

It is currently difficult to create useful host APIs with the limited types available in Wasm imports. Using this minimal API usually results in a lot of boilerplate code which is not reusable across multiple languages.
If we could use the ergonomics of wasm bindgen for Non-Web use cases, it would be very helpful in the development of reusable APIs for Wasm runtimes.

Our Wish List for Rust Wasm 2019

  • A stable set of imports for host bindings to target in wasm-bingen. It would be helpful to be able to configure which module name should be used for host provided imports and prefer non-mangled names if possible. For example, the Emscripten imports for Wasm are relatively stable which makes it easier to support Emscripten style Wasm. Even though the Emscripten API is reasonably stable, it would be better to design a new host API specifically for WASM.
  • Consider C, C++, and other source languages to enable common host APIs and language interoperability. The wasm-bindgen guide mentions the idea of future C/C++ integration and we hope this possibility is explored.
  • Participation of Rust Wasm in the development of a common base API, e.g reference-sysroot.

Rust Wasm has excellent support for web and it is our hope the same tooling can adapt to support Non-Web Wasm use cases in 2019.

We believe WebAssembly will be a key technology in the future. Because of that, we are working on a new Rust based Wasm runtime called Wasmer, so you can run WebAssembly anywhere you want.

With Wasmer, you can run WebAssembly anywhere you want, outside browser environments.

Follow the project on Github, and comment where you would like us to go moving forward!

Universal WebAssembly runtime

Medium is an open platform where 170 million readers come to find insightful and dynamic thinking. Here, expert and undiscovered voices alike dive into the heart of any topic and bring new ideas to the surface. Learn more

Follow the writers, publications, and topics that matter to you, and you’ll see them on your homepage and in your inbox. Explore

If you have a story to tell, knowledge to share, or a perspective to offer — welcome home. It’s easy and free to post your thinking on any topic. Write on Medium

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store