tinygo 0.6.0

TinyGo is a Go language compiler designed for use in areas such as microcontrollers, WASM, and command line utility development.

TinyGo uses utilities and libraries written in the Go project, while providing an alternative method of compiling programs based on the LLVM project.

Project objectives:

  1. Ensure the minimum size of executable files.
  2. Support for the largest number of microcontrollers.
  3. WebAssembly support.
  4. Good CGo support.
  5. Support for original Go code without changes.

Usage example for switching LED on a microcontroller:

main package

import(
"machine"
"team"
)

func main() {
led := machine.LED
led.Configure(machine.PinConfig{Mode: machine.PinOutput})
for {
led.Low()
time.Sleep(time.Millisecond * 1000)

led.High()
time.Sleep(time.Millisecond * 1000)
}
}

Version 0.6.0 contains many changes. The main ones relate to improved support for CGo, js.FuncOF (Go 1.12+), as well as two new debug boards: Adafruit Feather M0 and Adafruit Trinket M0.

The full list of changes is available at GitHub project page.

Source: linux.org.ru

Add a comment