WebAssembly (Wasm) is a portable, low-level compilation target for web applications. Go code is compiled into bytecode, then executed client-side by a Wasm interpreter loaded through JavaScript. section 12.0 section 12.1
A Wasm application connects several layers:
- Compile Go into a Wasm executable. section 12.4
- Load the executable inside an HTML page with JavaScript. section 12.4
- Register Go functions for JavaScript and use the js package to interact with the DOM. section 12.4
- Use the format to target browser applications from languages such as Go, Rust, Python, or C++. section 12.1
Figure 12.1 From Go code to Wasm executed by JavaScript
Follow the pipeline from Go source through bytecode and a JavaScript-loaded interpreter to client-side Wasm execution. section 12.1
Browser application pipeline
A Go application can be compiled into Wasm, loaded by JavaScript in an HTML page, and connected to browser behavior through registered Go functions and the DOM. section 12.4




