Skip to content

Instantly share code, notes, and snippets.

@danwoods
Last active August 29, 2019 22:00
Show Gist options
  • Save danwoods/7fb450b6ac96aaeaf11cf9adc18e300b to your computer and use it in GitHub Desktop.
Save danwoods/7fb450b6ac96aaeaf11cf9adc18e300b to your computer and use it in GitHub Desktop.
Web Assembly


Why?

Why is there an issue?

What?

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.

  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?

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!

Links

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment