2/1/18
and why you should care
WebAssembly or wasm is a new portable, size- and load-time-efficient format suitable for compilation to the web.
...it is a new, low-level, assembly-like language that runs efficiently on the existing web platform and is backward-compatible with its precursor, asm.js.
https://research.mozilla.org/webassembly/
http://webassembly.org/
We can start writing Web Applications in other Languages and have Native Browser Support!
gzipped binary format to be about 20-30% smaller than the corresponding gzipped asm.js
http://webassembly.org/docs/rationale/#why-a-binary-encoding
.. Why?
🤔
Your code
Intermediate Representation (IR)
Optimize
Execute
Your computer
Browser
https://hacks.mozilla.org/2017/02/what-makes-webassembly-fast/
Your code
LLVM
Intermediate Representation (IR)
Execute
Decode
Your computer
Browser
Execute
Decode
pub fn main() {
// do stuff..
}
#[no_mangle]
pub fn greet(name: &str) -> String {
format!("Hello, {}!", name)
}
#[no_mangle]
pub fn add(a: i32, b: i32) -> i32 {
a + b
}
https://developer.mozilla.org/en-US/docs/WebAssembly/Loading_and_running
https://github.com/TheLarkInn/simple-webpack-wasm-example
😍
index.js
math.rs
https://github.com/parcel-bundler/parcel
https://github.com/alexcrichton/wasm-bindgen
http://webassembly.org/docs/use-cases/
https://github.com/glimmerjs/glimmer-vm/pull/752
http://webassembly.org/docs/future-features/
hint - everything!
https://github.com/appcypher/awesome-wasm-langs
https://ballercat.github.io/walt/
Text
JS Compiled WASM Language (w / playground)
http://blog.mgechev.com/2016/08/14/ahead-of-time-compilation-angular-offline-precompilation/
Deep Dive into Angular AOT
https://github.com/facebook/prepack
Prepack for generic pre-evaluation and compiliation