- a stack-based virtual machine (standalone or embeddable in a host environment like a web browser or any other program)
- modules, executed as standalone programs or libraries of functions on this VM
- a binary encoding for modules, usually saved as
.wasmfiles: useful for network transfer, disk storage and actually running wasm code
- a textual representation of modules, usually saved as
.watfiles: it is based on S-expressions and is useful for humans to write and debug wasm modules by hand.
This is a generic and flexible middle-level virtual machine:
unlike JVM/CLR/v8, it is not tied to a GC and object system. Its basic types are just primitive numbers (
f64), function references and opaque references. The computation happens on its internal stack and can only use a strictly isolated linear memory.
it provides strong and verifiable isolation and is a hermetic sandbox; imported and exported WASM functions are entirely controlled by the host; no host capabilities (I/O, DOM API, ...) are accessible by default.
the stack-based bytecode is simple, compact and easy to (JIT-)compile to native code