WebAssembly ➔Discussed in W3C community group ◆ https://www.w3.org/community/webassembly/ ◆ https://webassembly.github.io/ ➔Features ◆Fast, efficient and portable ◆safety execution ◆WAST : text representation of WASM ◆Interaction between JavaScript 6
IUUQTFOXJLJQFEJBPSHXJLJ8FC,JU Under development https://webkit.org/status/#specification-webassembly Under development https://blogs.windows.com/msedgedev/2016/03/15/previewing- webassembly-experiments
•CAD •VR / AR WASM+JS for UI development •React Vim component •Game engines •Emulators WASM for speeding up •VPN, Remote desktop •Codecs for audio / video •Image processing
type Containts Type Signatures Code Function bodies Import List of imports Export Exported function IDs Data Constants Table Tables (e.g function tables) Start start function
WASM VM's operators as ◆Abstract syntax tree (as left figure) ◆Sequence of stack operations ➔WASM VM features ◆Typed stack machine ◆i32, i64, f32, f64 operation ◆Direct / indirect function calls ◆Linear memory 26
SFUVSOMPDBMGPSBHFTFU*UFN LFZ XBTN.PEVMF ^ 35 • WebAssemlby.Module can be stored into IndexedDB's object store • The code listed above uses localForage as a interface against IndexedDB • c.f. https://developer.mozilla.org/docs/WebAssembly/Caching_modules
effective ◆Fast: Ahead of Time (AOT) compilation & compiler optimization ◆Size & load time efficient due to its VM design and binary encode ➔JavaScript API to control WASM module compilation and instantiation ➔NOT a replacement for JavaScript / Flash / Siliverlight etc ➔WASM debugger is available on Firefox 37
are responsible to generate native codes from WASM ◆WASM is a portable binary format ➔Native API call features ➔Binary format but code obfuscation mechanism ◆We can "view source" ◆Text format (WAST) / wasm2wast 38