Powerful, yet simple to use, TinyGo is making a significant mark in the open-hardware sector. This was well stated in the Arduino blog interview of Ron Evans, Technologist for Hire, as Arduino is now working with TinyGo on an ongoing basis.
What is TinyGo?
The whole purpose of TinyGo is to bring Go to the microcontroller and the latest web browsers, to have that powerful language able to function in tiny processor formats, such as the Arduino Uno and Arm-based processors such as the Cortex-M type processors and also the BBC Micro: bit, STM32 Bluepill, and some other MCU boards, from any web browser.
How It Functions
It does this through LLVM toolchain and that format allows TinyGo to compile Go programs to a fraction of their original size, then flash the reduced Go program directly onto the microcontroller.
Web Browser Applications With WebAssembly
TinyGo can be used with WebAssembly (WASM) for applications that are browser-based, high-performance code. The use of TinyGo, through a JavaScript function, and then going to call a GO function from WebAssembly is straight forward. From there it is as simple as providing a target if TinyGo is already installed. GitHub is providing a number of files for multiple languages using TinyGo, including WASM (see link below)
How to run TinyGo
The compiler is very handy for developers, as the reduction in the overall size of the code, necessary to run Go, helps in those small places and processors where developers of commercial IoT are working. TinyGo can be installed on Linux, macOS, Windows, and Docker, as well as from the source code, found on GitHub.
Arduino and TinyGo
TinyGo can be paired with Arduino Nano 33 IoT, a board that hosts the Microchip SAMD21 Cortex-M0+ microcontroller, as well as a WiFi and Bluetooth module. There is a sample on GitHub of how TinyGo programs can be flashed to the board directly, where program execution is directly on the microcontroller.
Excellent Security Approaches
Security in development, deployment, and operations using TinyGo can be a boon in edge computing applications, which need a higher order of security. The code for TinyGo is compiled directly to binary, so code signing and many of the most utilized security methods and approaches can be performed.
Extra Security Ability
Also, device encryption is made between any device and any cloud storage or analytics. TinyGo and The Arduino Nano 33 IoT can use standard APIs for SSL communication to cloud services. The idea is to use an API like Eclipse Foundation’s Paho MQTT client for Go. That takes the guesswork out of when and where to make the system secure, it happens right upfront.
Information about programing using TinyGo can be found on the “Tiny Gopher” website where you can buy the book. Or read the Getting Started on the TinyGo website. TinyGo on GitHub has a lot of code for many different types of situations when using TinyGo.
Stephen started writing about technology after publishing sci-fi short stories. His first White-Paper, written in 2008, was well received and inspired him to continue writing about technology. Today he writes in the technology space full time, covering a multitude of topics. During the time he wrote part-time he edited hundreds of titles for large publishers, in science and technology. He lives in Staten Island, with his wife and children.
Support CNX Software! Donate via cryptocurrencies, become a Patron on Patreon, or purchase goods on Amazon or Aliexpress
Nice post Stephen, but what about one of the biggest ‘things’ about Golang: Concurrency?
https://en.wikipedia.org/wiki/Go_(programming_language)#Concurrency
Will I be able to run concurrent functions on say, an Arduino Uno? That would be cool!
See this example of concurrency in Go:
https://en.wikipedia.org/wiki/Go_(programming_language)#Examples
Concurrency looks to be experimental in TinyGo:
I would say natively compiled language with Garbage Collection is the big point.