Skip to main content
Definition Website Computer and Technology

WebAssembly

Subject: Computer and Technology noun /ˈwɛb.əˌsɛm.bli/ 1 definition

  1. Definition (noun)

    Entry #98 · Updated

    WebAssembly (Wasm) is a portable, low-level binary instruction format for a stack-based virtual machine that serves as a compilation target for languages such as C, C++, Rust, and Go. Designed to run alongside JavaScript in web browsers as well as in standalone host runtimes, it decodes rapidly and executes compute-intensive code at near-native speed. Its architecture isolates modules inside a memory-safe sandbox using bounds-checked linear memory and explicit host import/export interfaces, preventing compiled code from accessing host memory or operating system resources without permission.

    Common Forms

    • Binary Format (.wasm): The compact, streamable binary module encoding optimized for fast network transfer, single-pass validation, and JIT or AOT compilation to host machine instructions.

    • Text Format (.wat): A human-readable S-expression syntax with a one-to-one mapping to binary instructions, used for inspecting disassembled modules, writing tests, and debugging low-level behavior.

    • Browser-Embedded Modules: Modules compiled and instantiated via the WebAssembly JavaScript API to accelerate compute-heavy workloads—such as media codecs, 3D rendering, and client-side cryptography—inside web pages or Web Workers.

    • WASI Standalone Modules: Modules targeting the WebAssembly System Interface (WASI) that execute outside the browser on runtimes such as Wasmtime or WasmEdge, accessing host files, clocks, and sockets through capability-based permissions.

    Example

    A browser-based image editor compiles its Rust raw-photo decoding library into a .wasm module and loads it with WebAssembly.instantiateStreaming() inside a Web Worker. The sandboxed module processes multi-megabyte pixel buffers directly in linear memory at near-native speed while keeping the main JavaScript user-interface thread responsive.