← Back to archive

Repo of the Day

tinygo-org/tinygo: Go compiler for small places. Microcontrollers, WebAssembly (WASM/WASI), and command-line tools. Based on LLVM.

Published: Sep 21, 2026

Open repository ↗

Go compiler for small places. Microcontrollers, WebAssembly (WASM/WASI), and command-line tools. Based on LLVM. - tinygo-org/tinygo

Summary

TinyGo is an alternative Go compiler that uses LLVM to produce small binaries for microcontrollers, WebAssembly (WASM/WASI), and command-line tools. It reuses parts of the standard Go language tools while targeting constrained environments where the regular Go toolchain is not practical. The project aims to preserve the Go memory model, including garbage collection, on these small systems.

What it is useful for

TinyGo fits when Go code needs to run in places the standard toolchain does not handle well. The README states that it targets over 150 microcontroller boards, naming Arduino Uno, Adafruit Circuit Playground Express, Seeed Studio XIAO-ESP32S3, micro:bit, ESP32, STM32, nRF51/nRF52, and SAMD21. It also compiles to WebAssembly for browser use and to WASI Preview 1 for server-side runtimes such as Fastly Compute, Fermyon Spin, and wazero. Linux, macOS, and Windows are also listed as supported compile targets, and producing very small binaries is a stated goal.

The README is explicit about limits. It lists non-goals: TinyGo is not designed to be efficient with large numbers of goroutines, is not expected to match gc in speed, and cannot compile every Go program. Language feature coverage is tracked on a separate page linked from the README, so engineers should consult it before depending on a specific package.

How engineers can use it

For embedded work, the README demonstrates a blinky program using the machine package to toggle an LED. The same source runs on any supported board with an onboard LED; for an Arduino Uno, the documented command is:

tinygo flash -target arduino-uno examples/blinky1

For WebAssembly, the README shows exporting a function with a //go:wasmexport directive and building for any WASI Preview 1 runtime with:

tinygo build -buildmode=c-shared -o add.wasm -target=wasip1 add.go

It also notes that on Go 1.24+, the same artifact can be produced using GOOS=wasip1 GOARCH=wasm tinygo build -buildmode=c-shared -o add.wasm add.go.

The README does not give install commands in full; it points to the getting started page and mentions Docker as an alternative. The project is described as BSD 3-clause, like the Go project, with portions under an Apache 2.0 variant for LLVM-derived code and PJRC's license for Teensy-derived code, each marked in the relevant file headers.