Languages
Language support
The languages below can be compiled to WebAssembly with WASI support. Some toolchains produce components built to the Component Model (and can use WASI 0.2 or 0.3), while others produce core Wasm modules (which can use WASI 0.1). Some languages have first-party support, while others rely on externally maintained tools.
| Language | Name | Output | WASI Version | Maintained By | Notes |
|---|---|---|---|---|---|
| C and C++ | wasi-sdk | Modules; components via wasm-tools component new | 0.1, 0.2 | W3C Wasm CG | 0.3 toolchain support is not yet shipped |
| C# | componentize-dotnet | Components | 0.2 | Bytecode Alliance | Pre-release toolchain |
| Go | Upstream Go (GOOS=wasip1) | Modules | 0.1 | Go Project | |
| Go | go-modules; TinyGo | Components | 0.2 | Bytecode Alliance; TinyGo Project | |
| Java | GraalVM | Planned | Planned | Oracle | Planned: see the tracking issue, roadmap, and presentation |
| JavaScript and TypeScript | jco | Components | 0.2; 0.3 experimental | Bytecode Alliance | The preview3-shim package provides experimental WASI 0.3 implementations for Node.js |
| Kotlin | Kotlin | Modules | 0.2 | JetBrains | Implementation in progress; see the tracking issue |
| MoonBit | MoonBit compiler with wit-bindgen MoonBit backend | Modules; components via wasm-tools component new | 0.2 | MoonBit | |
| Python | componentize-py | Components | 0.2 | Bytecode Alliance | |
| Python | cpython | Modules | 0.2 | Python | Implementation in progress |
| Ruby | ruby.wasm | Modules | 0.2 | Ruby | Implementation in progress |
| Rust | wasm32-wasip2 and wasm32-wasip3 compiler targets | Modules and components | 0.1, 0.2; 0.3 via crate | Rust Project | wasm32-wasip2 is Tier 2 on stable; wasm32-wasip3 is Tier 3, nightly only. The wasip3 crate provides WASI 0.3 bindings for wasm32-wasip3, and can be used from wasm32-wasip2 though upstream recommends matching the crate to the target. See the 0.2 introduction and 0.2 stabilization |
| Swift | Swift | Planned | Planned | Swift | Planned: see the accepted roadmap vision |
| Zig | zig build-exe -target wasm32-wasi | Modules | 0.1 | Zig | No first-party Zig component toolchain |
Notes
- Modules vs components. A Wasm module is a single binary in the core WebAssembly format and can use WASI 0.1. A component is built to the Component Model and can use WASI 0.2 or 0.3, gaining composability, cross-language interoperability, and richer interface types. See the Releases and Roadmap pages for more on the WASI releases.
- Adapting modules to components. Several toolchains produce core modules today and wrap them into components using
wasm-tools component newwith a 0.1-to-0.2 adapter. This is the path for C/C++ and MoonBit. - WASI 0.3 ecosystem state. Broad 0.3 support across languages is still landing. Rust has WASI 0.3 bindings in the
wasip3crate, written for the nightly Tier 3wasm32-wasip3target. It can be used from the stable Tier 2wasm32-wasip2target, though upstream recommends matching the crate to the target, and the standard library onwasm32-wasip2still uses WASI 0.2.jcoships an experimentalpreview3-shimfor Node.js. Other toolchains have not yet shipped 0.3 support, so target WASI 0.2 with those. - Version pinning. The Component Model defines canonical interface names so that components can link across compatible versions, but not all tools support this version-aware linking yet. Until they do, target the same version (
0.3.0) across all WIT-aware tools. Mismatches surface as confusingwrong typeerrors at instantiation.
Building guides
For hands-on guides covering setup and a "hello world" per language, see the Component Model documentation:
Bindings generators
The bindings generators below provide a way to make Wasm function calls using interfaces in a given language.
| From | To | Name |
|---|---|---|
| Wasm Interface Types | C | wit-bindgen c |
| Wasm Interface Types | C++ | wit-bindgen cpp |
| Wasm Interface Types | C# | wit-bindgen csharp |
| Wasm Interface Types | JSON Schema | component2json |
| Wasm Interface Types | Markdown | wit-bindgen markdown |
| Wasm Interface Types | Moonbit | wit-bindgen moonbit |
| Wasm Interface Types | Rust | wit-bindgen rust |
| WebIDL | Wasm Interface Types | webidl2wit |