WebAssembly can be written directly as WAT, but production modules are usually produced by compilers. The source language is parsed by a frontend, lowered to an IR, optimized, and emitted by a WASM backend.

  • C/C++ usually uses clang plus LLVM and Emscripten or WASI-oriented toolchains.
  • Rust uses rustc/LLVM with targets such as wasm32-unknown-unknown or wasm32-wasip1.
  • Go and TinyGo emit WASM with their own runtime requirements.
  • AssemblyScript compiles a strict TypeScript-like language to WASM.
  • Custom compilers and DSLs can emit WAT or binary sections directly.