Repolode
tinygo-org

tinygo-org/tinygo

A Go compiler built on LLVM that targets microcontrollers, WebAssembly (WASM/WASI), and command-line tools.

Stars
17,828
Forks
1,093
Open issues
601
Last commit
10 hours ago

What is it?

TinyGo is an alternative Go compiler aimed at small environments. It reuses parts of the standard Go toolchain libraries and uses LLVM as its backend, so the same Go source can be built for microcontroller boards, WebAssembly runtimes, and desktop operating systems.

On the embedded side, programs use a machine package to control GPIO pins and peripherals, and the compiler supports a large list of boards, including Arduino, Adafruit, and Seeed Studio models. Programs can be flashed directly with the tinygo flash command by selecting a target. For WebAssembly, TinyGo produces modules for browsers (WASM) and for WASI runtimes, and it can be used with platforms such as Fastly Compute, Fermyon Spin, and wazero.

The project's stated goals are very small binaries, broad support for common boards, and compiling most standard library packages and Go code without modification. It explicitly does not aim to match the performance of the standard gc compiler or to compile every Go program.

Key features

  • 01Compiles Go programs for over 150 microcontroller boards.
  • 02Produces WebAssembly modules for both browsers (WASM) and WASI runtimes.
  • 03Uses LLVM as its code generation backend instead of emitting C.
  • 04Supports building for Linux, macOS, and Windows targets.
  • 05Provides a tinygo command-line tool with flash and build subcommands.

Use cases

  • Writing firmware for Arduino, micro:bit, or other small boards in Go.
  • Building Go code that runs in the browser or on edge platforms via WebAssembly.
  • Creating WASI components for runtimes such as Fermyon Spin or wazero.
  • Keeping compiled binaries small for resource-constrained devices.

Quick start

  1. 1

    Install TinyGo using the getting started instructions

  2. 2

    Compile and flash the blinky example to an Arduino Uno

    tinygo flash -target arduino-uno examples/blinky1
  3. 3

    Build a WASI program to a WebAssembly module

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

Things to know

  • Not every Go program compiles; the project explicitly does not aim to support all Go code.
  • Some bundled code comes from LLVM and Teensy libraries under separate licenses, so the license is mixed.

Topics

FAQ

What is tinygo?
A Go compiler built on LLVM that targets microcontrollers, WebAssembly (WASM/WASI), and command-line tools. TinyGo is an alternative Go compiler aimed at small environments. It reuses parts of the standard Go toolchain libraries and uses LLVM as its backend, so the same Go source can be built for microcontroller boards, WebAssembly runtimes, and desktop operating systems.
Is tinygo free to use? What license does it have?
tinygo is open source under the Other license. Check the license terms before using it in commercial products.
Is tinygo still maintained?
Actively maintained. The last commit to tinygo was on Oct 21, 2026.
What can I use tinygo for?
Writing firmware for Arduino, micro:bit, or other small boards in Go. Building Go code that runs in the browser or on edge platforms via WebAssembly. Creating WASI components for runtimes such as Fermyon Spin or wazero. Keeping compiled binaries small for resource-constrained devices.
How do I install tinygo?
Install TinyGo using the getting started instructions Compile and flash the blinky example to an Arduino Uno: tinygo flash -target arduino-uno examples/blinky1 Build a WASI program to a WebAssembly module: tinygo build -buildmode=c-shared -o add.wasm -target=wasip1 add.go
Where can I get tinygo?
The source code and installation instructions are on GitHub: https://github.com/tinygo-org/tinygo

Summary generated by AI from the project's README. GitHub stats refresh daily.

Related projects