{"id":13461367,"url":"https://github.com/tinygo-org/tinygo","last_synced_at":"2026-04-05T17:36:06.189Z","repository":{"id":37268356,"uuid":"136505169","full_name":"tinygo-org/tinygo","owner":"tinygo-org","description":"Go compiler for small places. Microcontrollers, WebAssembly (WASM/WASI), and command-line tools. Based on LLVM.","archived":false,"fork":false,"pushed_at":"2025-05-01T13:08:10.000Z","size":12289,"stargazers_count":16165,"open_issues_count":497,"forks_count":949,"subscribers_count":180,"default_branch":"release","last_synced_at":"2025-05-05T14:21:34.831Z","etag":null,"topics":["adafruit","arduino","arm","avr","esp32","gpio","i2c","llvm","microbit","microcontroller","nrf51","nrf52","samd21","spi","stm32","tinygo","wasi","wasm","webassembly"],"latest_commit_sha":null,"homepage":"https://tinygo.org","language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"other","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/tinygo-org.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":"CONTRIBUTING.md","funding":".github/FUNDING.yml","license":"LICENSE","code_of_conduct":"CODE-OF-CONDUCT.md","threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":"GOVERNANCE.md","roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null},"funding":{"open_collective":"tinygo"}},"created_at":"2018-06-07T16:39:19.000Z","updated_at":"2025-05-05T06:11:49.000Z","dependencies_parsed_at":"2023-10-16T03:01:11.192Z","dependency_job_id":"a1719ed1-10e7-46f8-a163-87e00295431b","html_url":"https://github.com/tinygo-org/tinygo","commit_stats":{"total_commits":3939,"total_committers":212,"mean_commits":"18.580188679245282","dds":0.477024625539477,"last_synced_commit":"ef4f46f1d1550beb62324d750c496b2b4a7f76d0"},"previous_names":["aykevl/tinygo"],"tags_count":45,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tinygo-org%2Ftinygo","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tinygo-org%2Ftinygo/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tinygo-org%2Ftinygo/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tinygo-org%2Ftinygo/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/tinygo-org","download_url":"https://codeload.github.com/tinygo-org/tinygo/tar.gz/refs/heads/release","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":253775729,"owners_count":21962404,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["adafruit","arduino","arm","avr","esp32","gpio","i2c","llvm","microbit","microcontroller","nrf51","nrf52","samd21","spi","stm32","tinygo","wasi","wasm","webassembly"],"created_at":"2024-07-31T11:00:36.129Z","updated_at":"2026-04-05T17:36:01.152Z","avatar_url":"https://github.com/tinygo-org.png","language":"Go","readme":"# TinyGo - Go compiler for small places\n\n[![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) [![CircleCI](https://circleci.com/gh/tinygo-org/tinygo/tree/dev.svg?style=svg)](https://circleci.com/gh/tinygo-org/tinygo/tree/dev)\n\nTinyGo is a Go compiler intended for use in small places such as microcontrollers, WebAssembly (wasm/wasi), and command-line tools.\n\nIt 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.\n\n## Embedded\n\nHere is an example program that blinks the built-in LED when run directly on any supported board with onboard LED:\n\n```go\npackage main\n\nimport (\n    \"machine\"\n    \"time\"\n)\n\nfunc main() {\n    led := machine.LED\n    led.Configure(machine.PinConfig{Mode: machine.PinOutput})\n    for {\n        led.Low()\n        time.Sleep(time.Millisecond * 1000)\n\n        led.High()\n        time.Sleep(time.Millisecond * 1000)\n    }\n}\n```\n\nThe above program can be compiled and run without modification on an Arduino Uno, an Adafruit ItsyBitsy M0, or any of the 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:\n\n```shell\ntinygo flash -target arduino examples/blinky1\n```\n\n## WebAssembly\n\nTinyGo is very useful for compiling programs both for use in browsers (WASM) as well as for use on servers and other edge devices (WASI).\n\nTinyGo 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.\n\nHere is a small TinyGo program for use by a WASI host application:\n\n```go\npackage main\n\n//go:wasmexport add\nfunc add(x, y uint32) uint32 {\n\treturn x + y\n}\n```\n\nThis compiles the above TinyGo program for use on any WASI Preview 1 runtime:\n\n```shell\ntinygo build -buildmode=c-shared -o add.wasm -target=wasip1 add.go\n```\n\nYou can also use the same syntax as Go 1.24+:\n\n```shell\nGOARCH=wasip1 GOOS=wasm tinygo build -buildmode=c-shared -o add.wasm add.go\n```\n\n## Installation\n\nSee the [getting started instructions](https://tinygo.org/getting-started/) for information on how to install TinyGo, as well as how to run the TinyGo compiler using our Docker container.\n\n## Supported targets\n\n### Embedded\n\nYou can compile TinyGo programs for over 94 different microcontroller boards.\n\nFor more information, please see https://tinygo.org/docs/reference/microcontrollers/\n\n### WebAssembly\n\nTinyGo programs can be compiled for both WASM and WASI targets.\n\nFor more information, see https://tinygo.org/docs/guides/webassembly/\n\n### Operating Systems\n\nYou can also compile programs for Linux, macOS, and Windows targets.\n\nFor more information:\n\n- Linux https://tinygo.org/docs/guides/linux/\n\n- macOS https://tinygo.org/docs/guides/macos/\n\n- Windows https://tinygo.org/docs/guides/windows/\n\n## Currently supported features:\n\nFor a description of currently supported Go language features, please see [https://tinygo.org/lang-support/](https://tinygo.org/lang-support/).\n\n## Documentation\n\nDocumentation is located on our web site at [https://tinygo.org/](https://tinygo.org/).\n\nYou can find the web site code at [https://github.com/tinygo-org/tinygo-site](https://github.com/tinygo-org/tinygo-site).\n\n## Getting help\n\nIf you're looking for a more interactive way to discuss TinyGo usage or\ndevelopment, we have a [#TinyGo channel](https://gophers.slack.com/messages/CDJD3SUP6/)\non the [Gophers Slack](https://gophers.slack.com).\n\nIf you need an invitation for the Gophers Slack, you can generate one here which\nshould arrive fairly quickly (under 1 min): https://invite.slack.golangbridge.org\n\n## Contributing\n\nYour contributions are welcome!\n\nPlease take a look at our [Contributing](https://tinygo.org/docs/guides/contributing/) page on our web site for details.\n\n## Project Scope\n\nGoals:\n\n* Have very small binary sizes. Don't pay for what you don't use.\n* Support for most common microcontroller boards.\n* Be usable on the web using WebAssembly.\n* Good CGo support, with no more overhead than a regular function call.\n* Support most standard library packages and compile most Go code without modification.\n\nNon-goals:\n\n* Be efficient while using zillions of goroutines. However, good goroutine support is certainly a goal.\n* Be as fast as `gc`. However, LLVM will probably be better at optimizing certain things so TinyGo might actually turn out to be faster for number crunching.\n* Be able to compile every Go program out there.\n\n## Why this project exists\n\n\u003e We never expected Go to be an embedded language and so its got serious problems...\n\n-- Rob Pike, [GopherCon 2014 Opening Keynote](https://www.youtube.com/watch?v=VoS7DsT1rdM\u0026feature=youtu.be\u0026t=2799)\n\nTinyGo is a project to bring Go to microcontrollers and small systems with a single processor core. It is similar to [emgo](https://github.com/ziutek/emgo) but a major difference is that we want to keep the Go memory model (which implies garbage collection of some sort). Another difference is that TinyGo uses LLVM internally instead of emitting C, which hopefully leads to smaller and more efficient code and certainly leads to more flexibility.\n\nThe original reasoning was: if [Python](https://micropython.org/) can run on microcontrollers, then certainly [Go](https://golang.org/) should be able to run on even lower level micros.\n\n## License\n\nThis project is licensed under the BSD 3-clause license, just like the [Go project](https://golang.org/LICENSE) itself.\n\nSome code has been copied from the LLVM project and is therefore licensed under [a variant of the Apache 2.0 license](http://releases.llvm.org/11.0.0/LICENSE.TXT). This has been clearly indicated in the header of these files.\n\nSome code has been copied and/or ported from Paul Stoffregen's Teensy libraries and is therefore licensed under PJRC's license. This has been clearly indicated in the header of these files.\n","funding_links":["https://opencollective.com/tinygo"],"categories":["Go","开源类库","By Industry","Open source library","WebAssembly","Golang","硬件_其他","arduino","Compilers","By Language","arm","路由","Framework and Libraries","Libraries for creating HTTP middlewares"],"sub_categories":["编译器","Web Development","Translator","路由器","Routers","网络服务_其他","Embeddable Scripts and Languages","Go","Utility/Miscellaneous","Other places","创建http中间件的代码库"],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftinygo-org%2Ftinygo","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ftinygo-org%2Ftinygo","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftinygo-org%2Ftinygo/lists"}