Running Go on the smallest systems with TinyGo

It is now possible to run Go on microcontrollers such as the Arduino and use it on the web with WebAssembly, all using TinyGo. TinyGo is designed to compile the same Go code you're used to down to much smaller binaries, and thus brings Go to places it couldn't go before.

Abstract

It is now possible to run Go on microcontrollers such as the Arduino and use it on the web with WebAssembly, all using TinyGo. TinyGo is designed to compile the same Go code you're used to down to much smaller binaries, and thus brings Go to places it couldn't go before. While you may not be very aware of it, embedded software is everywhere. It goes from very small chips in remote controls to advanced automotive navigation systems and everything in between. While these systems used to be written mainly in C, and still often are, more and more people are realizing that this is an aging language with many pitfalls such as buffer overflows - especially now that more and more systems are connected to the internet and are thus are much more easy to exploit. Therefore, newer and more modern and secure languages like Rust, JavaScript and Python are being used for these systems for ease of programming and increased reliability and safety. Unfortunately, Go was often not an option because of its large binary size. Enter TinyGo. This project aims to support the same language with the same standard library and ecosystem, while keeping binary sizes low. It runs comfortably on chips with tens to hundreds of kilobytes of program memory and a few tens of kilobytes of RAM. TinyGo is also a viable alternative to Go on the Web, as it does support WebAssembly. Again, binary sizes are much smaller: sometimes 3% of the size compared to the main Go support. This is very important for the Web, as load times must be kept low because not everybody has a fast internet connection and unlimited data. This talk will give an introduction to the TinyGo project for those who are new to it. It will also give a short history of the project, including previous attempts to port Go to microcontrollers and why they failed. Further, it will include some technical details of how the compiler works and why it can produce such small programs. And finally, I'll show what is possible today with a few demos.

Video

GoLab is a conference made by Develer.
Develer is a company based in Campi Bisenzio, near Florence. Our motto is : "Technology to give life to your products". We produce hardware and software to create exceptional products and to improve industrial processes and people's well being.
In Develer we have passion for the new technologies and we offer our clients effective solutions that are also efficient, simple and safe for the end users. We also believe in a friendly and welcoming environment where anybody can give their contribution. This passion and this vision are what we've been driven to organize our conference "made by developers for developers".


Subscribe to our newsletter

We hate spam just as much as you do, which is why we promise to only send you relevant communications. We respect your privacy and will never share your information with third parties.
©2024 GoLab | The international conference on Go in Florence-Design & devCantiere Creativo-Made withDatoCMS