Home

The WebAssembly Component Model is a broad-reaching architecture for building interoperable WebAssembly libraries, applications, and environments.

This documentation is aimed at users of the component model: developers of libraries and applications.

note

Compiler and Wasm runtime developers can take a look at the Component Model specification to see how to add support for the component model to their project.

Table of contents

Understanding componentsBuilding componentsUsing components
Why Components?C/C++Composing
ComponentsC#Running
InterfacesGoDistributing
WorldsJavaScript
Python
Rust

WebAssembly components

As with all programming, the goal of writing a component is to make new functionality available by building it out of existing functionality.

A WebAssembly component runs on a platform, which may be a Web browser, a stand-alone runtime, or even an operating system (when compiling WebAssembly to an executable). By running the component, the platform gains the functionality that the component implements. Likewise, the platform provides functionality that code in components can use to interact with the outside world.

For example:

  • A user of the component model can build a component that converts the system time to another time zone.
  • For the component to work as intended, the underlying platform must provide the component with a means to access the current system time and the system time zone.

APIs for building WebAssembly components

In general, a platform that runs components must provide well-defined APIs for accessing functionality that components need: for example, reading from standard input, accessing environment variables, or manipulating network sockets.

It's useful to have a standard, shared set of APIs that WebAssembly components can depend on. WASI (the WebAssembly System Interface) is a standards-track specification that defines these APIs. A system or platform may expose some or all of the WASI APIs to components.

Status

The current stable release of WASI is WASI 0.2.0, which was released on January 25, 2024. WASI 0.2.0 is a stable set of WIT definitions that components can target. WASI proposals will continue to evolve and new ones will be introduced; however, users of the component model can now pin to any stable release >= v0.2.0. The WASI.dev roadmap tracks upcoming releases.

Contributing

If you find a mistake, omission, ambiguity, or other problem, please let us know via GitHub issues.

If you'd like to contribute content to the guide, please see the contribution guide for information on how to contribute.