TinyGo compiles Go to small binaries for boards, WASM, WASI, and desktop OS targets. It uses LLVM alongside the Go toolchain libraries.
Overview
TinyGo is a Go compiler aimed at constrained devices, WebAssembly runtimes, and command-line tools. It reuses Go’s own libraries and LLVM to produce programs that fit microcontrollers and compact wasm modules.
For embedded work, you select a board target and flash firmware; many boards with onboard LEDs can run the same blink example after changing the target. Firmware output formats depend on the chip, including common microcontroller image types where supported.
WebAssembly support covers browser wasm and WASI for servers and edge runtimes named in the documentation, such as Fastly Compute, Fermyon Spin, and wazero. TinyGo also documents Linux, macOS, and Windows as compilation targets for host binaries.
Project goals emphasize small binary size, broad board support, usable web assembly output, practical CGo call overhead, and compiling much standard library code unchanged. A playground and tour are offered on the project website for trying examples without local hardware.
Key features
- LLVM-based Go compilation
- Many microcontroller board targets
- WASM and WASI output
- Linux, macOS, and Windows host builds
- Small binary size focus
- Standard library subset support
- CGo integration
- Docker-based compiler workflow
Use cases
- Go firmware on Arduino-class boards
- Embedded IoT prototypes in Go
- Compact WASI modules for edge hosts
- Browser WebAssembly from Go source
- Teaching Go on resource-limited hardware