Minutes: Node.js Global Summit Session 1 — The WebAssembly System Interface and Node.js by Colin Ihrig.

Joel Lim
2 min readMay 30, 2020

Web WebAssembly

  • No garbage collector
  • Four data types
  • Reads/writes data from/to a linear memory

WebAssembly Text Format (Wat)

  • Human readable representation of Wasm
  • Written as S-expressions

WebAssembly Binary Toolkit (Wabbit)

WebAssembly in Node.js

WebAssembly.compile() WebAssembly.instantiate()

Node can import Wasm files.

WebAssembly System Interface (WASI)

  • Provides system calls
  • Enhance non-Web use cases

WASI Security Model

  • Application can only access sandboxed paths
  • syscalls have associated “right” __WASIT_RIGHT_PATH_OPEN
  • syscalls like open()

Defining Sandbox with Preopens

  • Preopens map host paths to sandbox paths
  • Application accesses sandbox paths

Compiling from C to WebAssembly

  • libc
  • clang 8+

Think of JavaScript (and WA)

  • Open Web Technology

UVWasi and Support in Node.js

  • c++ bindings for uvwasi and small JS API
  • wasi core module

WASI Example

wasi-worker Module

--

--