登录 注册
开发者工具网络与基础设施自动化与工作流 adafruitarduinoarmavresp32gpio
17,907
Stars
1,107
Forks
183
Watchers
504
Open Issues
NOASSERTION
许可证
Go
语言
2018-06-07
创建时间
2026-11-11
最近更新

项目能做什么

基于 LLVM 的 Go 编译器,专为微控制器、WebAssembly (WASM/WASI) 和命令行工具设计。
来源:AI 基于仓库事实生成 · 内容以仓库实际 README 为准

使用说明 查看原始 README 原仓库文档

中文使用说明暂未生成。下面保留原仓库 README 摘录,命令与配置均以原文为准。
原始 README 摘录(英文原文,节选前 3000 字符)
# TinyGo - Go compiler for small places

[![Linux](https://github.com/tinygo-org/tinygo/actions/workflows/linux.yml/badge.svg?branch=dev)](https://github.com/tinygo-org/tinygo/actions/workflows/linux.yml) [![macOS](https://github.com/tinygo-org/tinygo/actions/workflows/build-macos.yml/badge.svg?branch=dev)](https://github.com/tinygo-org/tinygo/actions/workflows/build-macos.yml) [![Windows](https://github.com/tinygo-org/tinygo/actions/workflows/windows.yml/badge.svg?branch=dev)](https://github.com/tinygo-org/tinygo/actions/workflows/windows.yml) [![Docker](https://github.com/tinygo-org/tinygo/actions/workflows/docker.yml/badge.svg?branch=dev)](https://github.com/tinygo-org/tinygo/actions/workflows/docker.yml) [![Nix](https://github.com/tinygo-org/tinygo/actions/workflows/nix.yml/badge.svg?branch=dev)](https://github.com/tinygo-org/tinygo/actions/workflows/nix.yml)

TinyGo is a Go compiler intended for use in small places such as microcontrollers, WebAssembly (wasm/wasi), and command-line tools.

It reuses libraries used by the [Go language tools](https://golang.org/pkg/go/) alongside [LLVM](http://llvm.org) to provide an alternative way to compile programs written in the Go programming language.

> [!IMPORTANT]
> You can help TinyGo with a financial contribution using OpenCollective. Please see https://opencollective.com/tinygo for more information. Thank you!

## Embedded

Here is an example program that blinks the built-in LED when run directly on any supported board with onboard LED:

```go
package main

import (
    "machine"
    "time"
)

func main() {
    led := machine.LED
    led.Configure(machine.PinConfig{Mode: machine.PinOutput})
    for {
        led.Low()
        time.Sleep(time.Millisecond * 1000)

        led.High()
        time.Sleep(time.Millisecond * 1000)
    }
}
```

The above program can be compiled and run without modification on an [Arduino Uno](https://tinygo.org/docs/reference/microcontrollers/boards/arduino-uno), an [Adafruit Circuit Playground Express](https://tinygo.org/docs/reference/microcontrollers/featured/circuitplay-express), a [Seeed Studio XIAO-ESP32S3](https://tinygo.org/docs/reference/microcontrollers/featured/xiao-esp32s3) or any of the many supported boards that have a built-in LED, just by setting the correct TinyGo compiler target. For example, this compiles and flashes an Arduino Uno:

```shell
tinygo flash -target arduino-uno examples/blinky1
```

## WebAssembly

TinyGo is very useful for compiling programs both for use in browsers (WASM) as well as for use on servers and other edge devices (WASI).

TinyGo programs can run in [Fastly Compute](https://www.fastly.com/documentation/guides/compute/go/), [Fermyon Spin](https://developer.fermyon.com/spin/go-components), [wazero](https://wazero.io/languages/tinygo/) and many other WebAssembly runtimes.

Here is a small TinyGo program for use by a WASI host application:

```go
package main

//go:wasmexport add
func add(x, y uint32) uint32 {
	return x + y
}
```

阅读完整原文

商业机会分析 AI 生成

WASM/WASI 边缘插件云端构建与优化 SaaS

产品构想利用 TinyGo 在 WebAssembly 体积上的天然优势,为微服务网关(Envoy/Proxy-Wasm)、边缘计算平台提供一键编译、死代码剔除与安全审计的云端构建服务。
核心功能TinyGo WASM 容器化云构建、二进制体积与指令集优化分析、Proxy-Wasm 模板库、漏洞与内存安全静态扫描。
目标用户云原生架构师、网关中间件开发团队、基于 WASM 扩展生态的 SaaS 提供商。
难度/周期中等 · 2-3 个月 · 成本:服务器/CI 资源(约 $200-500/月)、域名与基础网络设施。
收费模式按构建时长或席位订阅收费(SaaS 模式);私有化构建 Runner 授权费。
竞争风险官方标准 Go 编译器持续对 WASI 进行优化减负,导致 TinyGo 的体积优势窗口收窄。
依据 数据支持的判断

工业级微控制器 (MCU) 定制驱动库与合规 LTS 支持

产品构想针对工业 IoT 常用微控制器(如 STM32/ESP32),提供经过严格物理验证、高可靠性的 TinyGo 驱动外设包及长期商业支持版本。
核心功能经过硬件回路测试(HIL)的稳定版驱动、外设总线协议(I2C/SPI/CAN)性能基准认证、紧急安全漏洞修复与 SLA 保证。
目标用户工业物联网研发团队、智能硬件制造商。
难度/周期高 · 4-6 个月 · 成本:硬件测试试验台搭建与各类 MCU 样板采购(约 $2000-$5000)。
收费模式商业许可授权费(按芯片量或项目计费)、企业年度维保与技术支持合约。
竞争风险嵌入式工业界主流仍为 C/C++,Go 语言在实时硬中断与关键安全领域的市场接受度偏低。
依据 AI推测

TinyGo 嵌入式低代码/图形化开发与仿真套件

产品构想打造面向创客教育与敏捷硬件原型的 Web IDE 与模拟器,将 TinyGo 封装为可视化节点与代码双向同步的开发环境。
核心功能在线 MCU 仿真预览、外设模块(传感器/显示屏)积木化驱动拖拽、一键 WebUSB 烧录固件。
目标用户STEAM 教育机构、创客群体、需要快速验证产品的硬件初创公司。
难度/周期高 · 3-5 个月 · 成本:前端仿真器开发与 Web 算力托管(约 $100-300/月)。
收费模式按教育机构/学校账号按年订阅;配套自研/联名硬件套件捆绑销售溢价。
竞争风险Arduino IDE 和 MicroPython 已在该市场占据极高生态壁垒,迁移成本高。
依据 尚需验证的假设
AI 基于仓库公开数据分析生成,含推测成分,不构成收益承诺。
报告会保存到 个人中心

竞品与相似项目 GitHub Search 真实检索

项目中文简介Stars语言
adafruit/Adafruit_NeoPixel 中文介绍暂未生成
Arduino library for controlling single-wire LED pixels (NeoP
3,434 C++
adafruit/Adafruit-GFX-Library 中文介绍暂未生成
Adafruit GFX graphics core Arduino library, this is the 'cor
2,868 C
microsoft/pxt 中文介绍暂未生成
Microsoft MakeCode (PXT - Programming eXperience Toolkit)
2,315 TypeScript
adafruit/Adafruit_SSD1306 中文介绍暂未生成
Arduino library for SSD1306 monochrome 128x64 and 128x32 OLE
2,124 C++
adafruit/Fritzing-Library 中文介绍暂未生成
Adafruit parts, components, breakouts, etc...in Fritzable fo
1,988 -
mrcodetastic/ESP32-HUB75-MatrixPanel-DMA 中文介绍暂未生成
An Adafruit GFX Compatible Library for the ESP32/S2/S3/P4 to
1,650 C++
以上为通过 GitHub 官方 Search API 检索的相似项目,功能差异与优劣势需进一步人工确认,配置 AI 后可生成对比分析。

项目优势与风险

技术成熟度创建于 2018-06-07,近 30 天仍在推送,发布过 54 个 Release
社区活跃Star 17,907 / Fork 1,107 / Issue 504(数据支持,可自行核实)
许可证NOASSERTION
主要风险上游项目方向可能变化;同赛道竞争者较多(见竞品表);热度与需求不完全等价

安装与使用

快速开始(以仓库 README 为准)
git clone https://github.com/tinygo-org/tinygo.git
cd tinygo
# 请阅读仓库 README 获取确切安装步骤(依赖、配置、启动命令)
阅读原仓库文档
术语说明:Docker=应用容器(把程序和依赖打包运行);API Key=调用外部服务的密钥;Git Clone=把仓库代码下载到本地。常见错误:API Key 未配置 / 端口占用 / 数据库连接失败,多数项目在 README 的 Troubleshooting 章节有说明。