An Introduction to TinyGo, and The Tools That Will Help You Flourish
Tags: go, beginners
Published: 2022-09-07 09:56:41

---
title: An Introduction to TinyGo, and The Tools That Will Help You Flourish
published: true
date: 2022-08-24 14:40:03 UTC
tags: go,beginners
canonical_url: https://www.jaminologist.com/an-introduction-to-tinygo-and-the-tools-that-will-help-you-flourish/
---

 ![An Introduction to TinyGo, and The Tools That Will Help You Flourish](https://www.jaminologist.com/content/images/2022/08/PXL_20220823_070439345-2.jpg)

# TLDR (Skip to Avoid Spoilers)

- [TinyGo](https://tinygo.org/) is a Go Compiler For Small Places. It allows Go to start getting involved with microcontrollers, embedded systems, The Internet of Things and WebAssembly.
- Useful Tools for TinyGo: [TinyGo PlayGround](https://play.tinygo.org/), [VSCode Plugin](https://marketplace.visualstudio.com/items?itemName=tinygo.vscode-tinygo), [GoLand Plugin](https://www.jetbrains.com/help/go/managing-plugins.html)
- [Join the TinyGo Community](https://app.slack.com/client/T029RQSE6/CDJD3SUP6)! It’s friendly and they have small paws and big hearts!

# Introduction

How does a satellite tell the time? How does a [doorbell use more Wi-Fi](https://www.smarthomepoint.com/ring-internet-bandwidth-use/) than watching a cat video? How does a pregnancy test [run Doom](https://twitter.com/Foone/status/1302820468819288066?ref_src=twsrc%5Etfw%7Ctwcamp%5Etweetembed%7Ctwterm%5E1302820468819288066%7Ctwgr%5E70ea8aab92e8f6b87105a732be45f5b3085ed840%7Ctwcon%5Es1_&ref_url=https%3A%2F%2Fwww.fatherly.com%2Fnews%2Fdoom-pregnancy-test-hacked)? I don’t know.

But I'm pretty sure it has something to do with microcontrollers, the Internet of Things and perhaps, one day, TinyGo.

![An Introduction to TinyGo, and The Tools That Will Help You Flourish](https://lh4.googleusercontent.com/V4NPLODg-tli11zpRVyvnVG6fNyG8MEJ-9WNYqGIwYNqqJWxWygIOacPsDdZENnmkqLn0r9rJP646A-Evfq-GHmOIv9gjFKKKSCu_GQQzQbESKjKt04cSZs925tob5W_C_qihGMPe2FOOVy4ZUQV8fQ)
_(To go big you gotta start small, this and other puns coming soon to an article near you)_

# What’s TinyGo?

Now, if you’re already a TinyGo aficionado do feel free to skip ahead to where I talk about some tooling that could help you to create the next small thing.

In short (lol), [TinyGo](https://tinygo.org/) is a “Go Compiler For Small Places”. It allows you to create and run Go programs on a vast array of popular [microcontrollers](https://tinygo.org/docs/reference/microcontrollers/) (including the Raspberry Pi Pico), as well as produce WebAssembly (WASM) Code.

If you’re like me, you’re probably not entirely sure what this all means. This talk [“Small is Going Big: Go on Microcontrollers”](https://www.youtube.com/watch?v=EiB9ZVrvrz0) is an excellent introduction.

[TinyGo: Getting the upper hen](https://speakerdeck.com/doniacld/tinygo-getting-the-upper-hen-gopherconuk-2022?slide=9) (GopherCon UK 2022) shows that the size of “Hello World” compiled using Go 1.18.5 was **1.8MB** , but using TinyGo 0.24.0 was only **29KB** _(Over 60x smaller, and small enough to run on an 8-bit computer!)._

I'd also highly recommend checking out the full video of the talk, once it has been fully released.

## Why is this useful?

With modern phones being able to store entire operas in 4k, do you really need a program that’s only a few KBs? That was one of my early thoughts.

But microcontrollers are everywhere. Think about your old scientific calculator, or digital clocks, heck even your microwave has a microcontroller in it _and it's probably using C._

Go, as a language, has largely been restricted from this realm of microcomputing because it was simply too chonky!

![An Introduction to TinyGo, and The Tools That Will Help You Flourish](https://lh6.googleusercontent.com/NM7fbUZXv2uREPORCpJOTqHJ_Vme8XplyKMLe7oUWkwZFxJubN0g_1kMWup7SiobzTkiVzhMUDln89v3NYzrPHCbTLA_xn1x7TdHMOX7iolce75yvApH7KUTf_LXpvCkxvuuqmXjpktOy9tWRy1zssQ)
_(And cute!)_

However, even with the explosion in popularity of hobbyist microcomputing there are still significant barriers to entry. Especially as the more dominant languages in the space are C and C++.

This is why TinyGo is really starting to make some waves. Go is notorious for being relatively easy to pick up. TinyGo could be the key to getting more developers interested in microcomputing, and even WebAssembly, though let’s not dare to dream.

The easier it is for people to get involved, the greater the chance there is for creativity, collaboration and completely different points of view which can lead to incredible innovations.

Sounds exciting right? Good! Are _you_ ready to get started?

# Awesome Tools For Getting Started

## [Tiny Go PlayGround](https://play.tinygo.org/)

![An Introduction to TinyGo, and The Tools That Will Help You Flourish](https://lh4.googleusercontent.com/Vm8Hd_Xfi1npE920bI35svn2vovKQmnG_2OxB8EXgz7i-KraEd3CHOWD4JFiGjPJ4dYlMdusY5-KAOCdQlKPyShvUkV0xV7MaxaViKENb70z_MdRcOqNluj-cJOFrUnFiAvQdOv6FU7q-TrR7pXykUw)

An excellent starting point. Modeled after the [Go Playground](https://go.dev/play/). You get to try out TinyGo in your browser, along with a[UI of some of the supported microcontrollers](https://aykevl.nl/2019/07/tinygo-plaground-simulator). You can see how your code might play out in the real world. Additionally the Playground is even _using_ TinyGo for WebAssembly.

## [VsCode TinyGo Plugin](https://marketplace.visualstudio.com/items?itemName=tinygo.vscode-tinygo)

![An Introduction to TinyGo, and The Tools That Will Help You Flourish](https://lh3.googleusercontent.com/HlgobRZpQZ10KAh4gpNEGVyjnKWSZM01yaJtI_eYruRELP8884_oGVCOwblOSdDw3Ur2l5gaycGvM6nlky4pBOanCH85VSNnd5Cqn6LQ6awWCl10dWYa_O4MqkRw4giE40IQb_vzmNSlwgVpKbvm-w)

### Code Completion, Auto Imports, Automatic GoRoot and GoFlags Setup

If the last part about GoRoot/GoFlags may seem a bit odd, check out this explanation on [IDE Integration](https://tinygo.org/docs/guides/ide-integration/). As a newcomer I’m glad the VSCode and GoLand plugins (spoilers) can handle this for you.

### [TinyGo Preview](https://aykevl.nl/2022/05/tinygo-preview)

The same preview that can be found on the Playground, has now recently been [added into the plugin](https://twitter.com/aykevl/status/1523280669325107200). Make sure you are working with the supported microcontrollers and you should be able to see the preview window.

## [GoLand TinyGo Plugin](https://plugins.jetbrains.com/plugin/16915-tinygo)

![An Introduction to TinyGo, and The Tools That Will Help You Flourish](https://lh3.googleusercontent.com/SSwfz9c-skpqZet0tx9Yyl4EZKGmHDRo-SgXBaquS9sVeNJ0GSU2XultX09rT-n4-HvmQhOaOlN9Mlz6qaDOIJHxzAZP9H8UJ_OXoujGLrC1RALODpxQNua6AgumAb-45MON-Lpqtgy4-xSpUg-rOQ)

### Code Completion, Auto Imports, Automatic GoRoot and GoFlags Setup and much more!

Now, this one is pretty neat as it allows you to work with TinyGo while having an[entire Go IDE](https://www.jetbrains.com/go/) at your disposal. Once you have the plugin installed the process of creating a TinyGo Application becomes built into GoLand itself.

![An Introduction to TinyGo, and The Tools That Will Help You Flourish](https://lh3.googleusercontent.com/Zt54OeVNPlEuxHmZMLrfkPhFT0sQREdYDsmwRdoWCHpjIxdyJAqXV0MeNwq8OUJayD6eFSfT9yP7zP6mkK4SBDLb3l0vUYa5OP1kL6-GLimIxpuA4AYTC0um0-KkFbcrBn-ry5uUNCD2VffuJJsNKew)

This means while working on your application not only do you get the usual quality of life benefits mentioned above, as well as a [few hidden gems](https://blog.jetbrains.com/go/2022/07/21/hidden-gems-in-goland/) and [shortcuts](https://blog.jetbrains.com/go/2022/05/26/5-goland-shortcuts-to-boost-your-productivity/). You can also create TinyGo Applications in the IDE and select from a wide range of ‘Hello World’ examples.

![An Introduction to TinyGo, and The Tools That Will Help You Flourish](https://lh6.googleusercontent.com/zMXd9qDpoPx4q1cWrWK2HZtL8xA1DuLkXC1y75IFaTgKs43vfxLU46IV43rZuTkzJN_bcrD7sldnGYoB9Gtsz_fYLQbCakSssnMbuuuonAf1pvIivcZ8Rnt-DBBhl5gn24H8SFUEBIatkMt--CLdw_I)

###   
TinyGo Code Inspections

The plugin also includes code inspections to highlight [packages that are not yet implemented in TinyGo](https://tinygo.org/docs/reference/lang-support/stdlib/). This can be found in Preferences/Settings -> Editor -> Inspections.

![An Introduction to TinyGo, and The Tools That Will Help You Flourish](https://lh4.googleusercontent.com/RpeS7_DFaN6PmJxPwhufhIgL2rYfnEoNyMJfK30MEa2XJ7Oi4RDyhcrZxX1f6OZ1FKt-mZeZUkdYxByFpgHtIZpVl2xIRFjdK1dHdN1kB9EUN-YK4vG8PgzzpU7rKVEAuFEKYJJdzYhLqbGuyuUyw6o)

### Save Multiple Run Configurations

You can build and create multiple different run configurations that can be easily accessed from the editor. (The below image displays some of the defaults)

So, if you ever do need custom variables or different tweaks at runtime you can have them saved and easily alternate between your configurations.

![An Introduction to TinyGo, and The Tools That Will Help You Flourish](https://lh6.googleusercontent.com/-IKhC-iguLLZmiGUk8XtQw1mWxo1C57ocwYNS-73Wv8FJIw3q7xdb-717eoCHPzblgH-Wvcz0Pk8Ejxz_CAC-tg6UPycyi1t3m5qdeLaOqoBCvnSkA8gMrAG6eN81CyQE0iqTDQqV_VK60ES9Gyui5Q)

# Join The TinyGo Community!

One thing that’s in common with all the above is that they were all built by the community, for the community.

Each tool is _open source_ ([TinyGo PlayGround](https://github.com/tinygo-org/playground), [VSCode Plugin](https://github.com/tinygo-org/vscode-tinygo), [GoLand Plugin](https://github.com/JetBrains/tinygo-plugin)) and open to feedback and contributions. I believe GoLand has an [Issue Tracker](https://youtrack.jetbrains.com/issues/GO?_gl=1*12d9fzg*_ga*MzA1NDM3NzIzLjE2NTg4NDM0NzY.*_ga_9J976DJZ68*MTY2MTI0NjI1NC4yMy4xLjE2NjEyNTA2ODAuMC4wLjA.&_ga=2.34380962.2072545294.1661163068-305437723.1658843476&_gac=1.152549963.1659357300.Cj0KCQjw852XBhC6ARIsAJsFPN2GDThhVGIJm7xpPOlrldTWbP2UmaM2Cde9pIsB9r4z-mIJDWwqxBcaAovQEALw_wcB) you can submit to and the #goland channel in the [Gophers Slack](https://gophers.slack.com/)

Similar to TinyGo, they are all in their early stages, so will only improve as time goes on, but the first step is getting involved!

It’s definitely trickier to [build your own gameboy game using TinyGo](https://dev.to/aurelievache/learning-go-by-examples-part-5-create-a-game-boy-advance-gba-game-in-go-5944), than creating your first web application in Go. However, microcomputing is still a niche space, so don’t worry if you ever get stuck or find it difficult and there’s no need to Go alone!

The TinyGo community is growing every day. You can join them in the [Gophers Slack](https://gophers.slack.com/) on the [**#tinygo**](https://app.slack.com/client/T029RQSE6/CDJD3SUP6) channel and follow them on [Twitter](https://twitter.com/TinyGolang) to keep track of the many wondrous things being built, on what may truly be the next big frontier in Go.

Good luck out there!