WebAssembly Logo

Wasm By Example


WebAssembly (Wasm) is an universal low level bytecode that runs on the web. It is a compilation target for languages like Rust, AssemblyScript (Typescript-like), Emscripten (C/C++), and much more! Wasm offer a compact binary format with predictable performance, and portability to run alongside Javascript and other host languages. Wasm is currently shipped in all major browsers, and has runtimes meant for running on servers or interfacing with systems using WASI.

What is Wasm By Example?

Wasm By Example is a concise, hands-on introduction to WebAssembly using code snippets and annotated WebAssembly example programs. Learn more about Wasm at the WebAssembly Introduction or browse the list of examples below.


Examples that express some of the major underlying concepts in WebAssembly. Some of these examples are not the most convenient or productive way for building projects with WebAssembly. However, these minimal examples are great for learning, or developing straightforward / lower-level parts of an application.

Examples that expand on the conceptual examples to show how these minimal examples could be used to build common features in larger applications.

Examples that highlight tools, libraries, and features of your selected programming language. These ecosystem components can drastically help in building powerful applications. For example, tools can be used to help pass data between your host runtime and WebAssembly module, and/or languages features can abstract away some of the lower-level parts of WebAssembly such as memory management.