I do JavaScript at
I also contribute to
WebAssembly is a compilation target for "lower level" languages like: C/C++/Rust (and others).
This means that we can compile non-JS programs and run them in the browser.
Your classic JavaScript engine representation
C++
C++
C++
Tooling (Compiler)
C++
app.wasm
app.wasm
import fn1, fn2 ...
export data1, data2
app.wasm
Browser
GET
buff: ArrayBuffer()
WebAssembly.instantiateStreaming(fetch('app.wasm'), {})
WebAssembly.instantiate(buff, {})
buff: ArrayBuffer()
WebAssembly
.Module(buff)
WebAssembly
.Instance(buff, {})
app.wasm
import fn1, fn2 ...
export data1, data2
JS
const someData = {};
const someOtherData = {};
Array (ish) (Linear Memory)
72
101
108
...
Linear Memory
Pros:
Cons:
Pros:
Cons:
rustup -> Similar to npm's NVM, it is a way to simply switch between Rust versions
cargo -> Similar to npm, cargo is the official package manager for Rust
rustc -> Rust's compiler