wasm

WebAssembly (__Wasm__) is a new type of code that can be run in modern web browsers — it is a low-level assembly-like language with a compact binary format that runs with near-native performance and provides languages such as C/C++ with a compilation target so that they can run on the web. It is also designed to run alongside JavaScript, allowing both to work together - developer.mozilla.org

- Running remote code on friend's computers, using WebAssembly for security - looking good to SSB team - twitter - webassembly "perfect for security" - no full linux vm overhead, attack surface area - no huge api/edgecase javascript lockdown - fully static (code can't dynamically self-change) - code/memory separation - adoption growing - tools coming

WebAssembly is a portable binary instruction format for executable programs, whose main goal is to enable high performance applications on web pages, but also to be embedded in other environments, such as IoT devices.

WebAssembly is designed to be run on an abstract stack-based virtual machine, can be parsed faster than JavaScript, and its binaries are smaller than the corresponding JavaScript programs due to a very compact code representation.

WebAssembly specifies two formats: textual and binary. The textual format is intended to be human-readable — below is an example of a recursive factorial function written in C, and translated to textual WebAssembly:

long fact(long n) { if (n == 0) return 1L; else return n * fact(n - 1); }

The corresponding WebAssembly looks as follows:

get_local 0 i64.eqz if (result i64) i64.const 1 else get_local 0 get_local 0 i64.const 1 i64.sub call 0 i64.mul end

# See also