Getting Started with WebAssembly

Lansing JavaScript Meetup
March 19th, 2019

Brendon Thiede

  • DevOps Engineer at the Michigan Supreme Court
  • Empowering teams
  • Simplifying best practices

Transpiled vs Compiled

  • Transpiled: Source code → Source Code
  • Compiled: Source code →
    • Bytecode
    • Assembly
    • Machine code

Binary Code Format

  • W3C Standard
  • Has text and compressed representations

Availability

  • In all the major browsers
  • Workers in Cloudflare (V8 Isolates)
  • Server side

Safety and Security

  • Code and data are separate
  • Crashes don't throw away code
  • 32-bit Pointers
  • Linear memory (no holes; only grows)
  • Function pointers (Function pointers are weird)

Fast

  • Strongly typed
  • Ahead of time optimized
  • Near native speeds
  • Can be smaller

Toolchains

  • C++: Emscripten
  • Rust (Mozilla likey)
  • TypeScript: AssemblyScript
  • C#: mono.wasm, Razor Components