Does go supports in MCU?

472 Views Asked by At

I have explored, does Go support on Micro Controller Unit. Got some info that is TinyGo. Have doubt is TinyGo equivalent to Golang which support in Linux.

1

There are 1 best solutions below

0
On

The short answer: Yes, when using TinyGo.

The long answer: As of the time writing TineGo directly supports more than 70 different microcontroller boards. And about 65 different peripheral devices.

TinyGo is a new Compiler, which is written in Go that consumes normal Go code. It also makes use of the LLVM compiler toolchain to be able to emit the binaries needed for microcontrollers. Using TinyGo you can shrink a simple HelloWorld program from ~1MB binary size to about 480 bytes on an Arduino UNO.

TinyGo has reimplemented large parts of the Go standard libary, but not everything. Check out this site for more details on the support of std libraries.

IDE Integration: In order to achieve a nice developer experience, the TinyGo Team does also provide a VSCode Extension, which provides functionality to switch the context to your currently used board. That way the go language server and intellisense etc. are enabled to help you out while coding.

Also Jetbrains is working on a Goland Extension, which provides atleast the same functionality as the VSCode extension, if not even a little bit more.

Summary: TinyGo is not yet an in place replacement for Go, but you can already build really great things using TinyGo. If you want to start with microcontroller projects and want to use Go then chose TinyGo.