Language page — context, influences, and learning notes on the 100hellos site.
Source on GitHub (100hellos/tinygo)
docker run --rm --platform="linux/amd64" 100hellos/tinygo:latest
Read the repo README, or fork the project and customize it.
For an interactive shell:
docker run --rm --platform="linux/amd64" --entrypoint="" -it 100hellos/tinygo:latest zsh
TinyGo is a Go compiler for small places. It's designed to bring the Go programming language to microcontrollers, WebAssembly, and other environments where traditional Go is too resource-intensive.
TinyGo is not just a subset of Go - it's a completely different compiler implementation built on LLVM that targets small devices and embedded systems. While regular Go is excellent for servers and desktop applications, TinyGo excels in:
TinyGo implements a much smaller runtime compared to standard Go:
Where a regular Go "Hello World" might be 2MB+, TinyGo can produce:
TinyGo supports dozens of microcontroller targets out of the box:
# Examples of supported targets
tinygo flash -target=arduino main.go
tinygo flash -target=microbit main.go
tinygo flash -target=pico main.go
tinygo build -target=wasm main.go
TinyGo supports most Go language features including:
Note: Some advanced features like reflection and the full net/http package may not be available on all targets.
TinyGo is used in production for:
Unlike regular Go development, TinyGo often involves:
Example microcontroller code:
package main
import (
"machine"
"time"
)
func main() {
led := machine.LED
led.Configure(machine.PinConfig{Mode: machine.PinOutput})
for {
led.High()
time.Sleep(500 * time.Millisecond)
led.Low()
time.Sleep(500 * time.Millisecond)
}
}
TinyGo opens up the world of embedded programming to Go developers, bringing familiar syntax and powerful features to the smallest of devices.
Content type
Image
Digest
sha256:a4c936e72…
Size
292.3 MB
Last updated
4 months ago
docker pull 100hellos/tinygo