Why is there an issue?
- What are some use-cases where JavaScript fails the web?
- Computationally intensive
- Image and video editing
- AAA Games
- VR
- Can be slow to load
- Computationally intensive
- See: https://webassembly.org/docs/use-cases/#inside-the-browser for additional use-cases
Was created to address these needs?
- From their homepage:
WebAssembly (abbreviated Wasm) is a binary instruction format for a stack-based virtual machine. Wasm is designed as a portable target for compilation of high-level languages like C/C++/Rust, enabling deployment on the web for client and server applications.
- Not really assembly
- Supports an increasing number of compilation sources - https://github.com/appcypher/awesome-wasm-langs
- Example (in rust):
extern crate wasm_bindgen;
use wasm_bindgen::prelude::*;
#[wasm_bindgen]
extern "C" {
pub fn alert(s: &str);
}
#[wasm_bindgen]
pub fn greet(name: &str) {
alert(&format!("Hello, {}!", name));
}
- Demos
How is it currently being used? How might it be used in the future?
- Supported on all major browsers (MVP released in March '17)
- Unity game engine - default compilation target for web
- Figma - interface design tool
- AutoCAD - now available as a webapp!
- Homepage - https://webassembly.org/
- MDN - https://developer.mozilla.org/en-US/docs/WebAssembly
- Unity Announcement - https://blogs.unity3d.com/2018/08/15/webassembly-is-here/
- Online IDE - https://webassembly.studio/
- Online compiler - https://mbebenita.github.io/WasmExplorer/