Skip to content

Releases: tinygo-org/tinygo

0.35.0

20 Dec 16:32
Compare
Choose a tag to compare

This is our last release of the year, and we've got plenty of presents for all of us tiny gophers!
We are happy to show improved error messages, and also a new HTML size report to help figure out what exactly is ending up in that binary.
There are several CGo improvements, such as support for function-like macros.
We've got a whole slew of improvements for reflection and runtime support, alongside several fixes and improvements for WASM.
New hardware! Support for the new RP2350 microcontroller, with the Raspberry Pi Pico2 and Pimoroni Tiny2350 boards.
And we are excited to bring our first software RISC-V running on FPGA to TinyGo with the newly added Tillitis TKey hardware device.

  • general
    • update cmsis-svd library
    • use default UART settings in the echo example
    • goenv: also show git hash with custom build of TinyGo
    • goenv: support parsing development versions of Go
    • main: parse extldflags early so we can report the error message
  • compiler
    • builder: whitelist temporary directory env var for Clang invocation to fix Windows bug
    • builder: fix cache paths in -size=full output
    • builder: work around incorrectly escaped DWARF paths on Windows (Clang bug)
    • builder: fix wasi-libc path names on Windows with -size=full
    • builder: write HTML size report
    • cgo: support C identifiers only referred to from within macros
    • cgo: support function-like macros
    • cgo: support errno value as second return parameter
    • cgo: add support for #cgo noescape lines
    • compiler: fix bug in interrupt lowering
    • compiler: allow panic directly in defer
    • compiler: fix wasmimport -> wasmexport in error message
    • compiler: support //go:noescape pragma
    • compiler: report error instead of crashing when instantiating a generic function without body
    • interp: align created globals
  • standard library
    • machine: modify i2s interface/implementation to better match specification
    • os: implement StartProcess
    • reflect: add Value.Clear
    • reflect: add interface support to NumMethods
    • reflect: fix AssignableTo for named + non-named types
    • reflect: implement CanConvert
    • reflect: handle more cases in Convert
    • reflect: fix Copy of non-pointer array with size > 64bits
    • runtime: don't call sleepTicks with a negative duration
    • runtime: optimize GC scanning (findHead)
    • runtime: move constants into shared package
    • runtime: add runtime.fcntl function for internal/syscall/unix
    • runtime: heapptr only needs to be initialized once
    • runtime: refactor scheduler (this fixes a few bugs with -scheduler=none)
    • runtime: rewrite channel implementation to be smaller and more flexible
    • runtime: use SA_RESTART when registering a signal for os/signal
    • runtime: implement race-free signals using futexes
    • runtime: run deferred functions in Goexit
    • runtime: remove Cond which seems to be unused
    • runtime: properly handle unix read on directory
    • runtime/trace: stub all public methods
    • sync: don't use volatile in Mutex
    • sync: implement WaitGroup using a (pseudo)futex
    • sync: make Cond parallelism-safe
    • syscall: use wasi-libc tables for wasm/js target
  • targets
    • mips: fix a bug when scanning the stack
    • nintendoswitch: get this target to compile again
    • rp2350: add support for the new RP2350
    • rp2040/rp2350 : make I2C implementation shared for rp2040/rp2350
    • rp2040/rp2350 : make SPI implementation shared for rp2040/rp2350
    • rp2040/rp2350 : make RNG implementation shared for rp2040/rp2350
    • wasm: revise and simplify wasmtime argument handling
    • wasm: support //go:wasmexport functions after a call to time.Sleep
    • wasm: correctly return from run() in wasm_exec.js
    • wasm: call process.exit() when go.run() returns
    • windows: don't return, exit via exit(0) instead to flush stdout buffer
  • boards
    • add support for the Tillitis TKey
    • add support for the Raspberry Pi Pico2 (based on the RP2040)
    • add support for Pimoroni Tiny2350

0.34.0

26 Oct 08:39
Compare
Choose a tag to compare

This release adds support for //go:wasmexport that is a standardized way to export WebAssembly functions to the host, improves garbage collection performance (especially on wasm), adds big-endian MIPS support (GOOS=mips), and adds two new boards! It also contains a number of smaller improvements and bug fixes.

  • general
    • fix GOOS=wasip1 for tinygo test
    • add -C DIR flag
    • add initial documentation for project governance
    • add -ldflags='-extldflags=...' support
    • improve usage message with tinygo help and when passing invalid parameters
  • compiler
    • builder: remove environment variables when invoking Clang, to avoid the environment changing the behavior
    • builder: check for the Go toolchain version used to compile TinyGo
    • cgo: add C.CBytes implementation
    • compiler: fix passing weirdly-padded structs as parameters to new goroutines
    • compiler: support pragmas on generic functions
    • compiler: do not let the slice buffer escape when casting a []byte or []rune to a string, to help escape analysis
    • compiler: conform to the latest iteration of the wasm types proposal
    • loader: don't panic when main package is not named 'main'
    • loader: make sure we always return type checker errors even without type errors
    • transform: optimize range over []byte(string)
  • standard library
    • crypto/x509: add package stub to build crypto/x509 on macOS
    • machine/usb/adc/midi: fix PitchBend
    • os: add Truncate stub for baremetal
    • os: add stubs for os.File deadlines
    • os: add internal net.newUnixFile for the net package
    • runtime: stub runtime_{Before,After}Exec for linkage
    • runtime: randomize map accesses
    • runtime: support maps.Clone
    • runtime: add more fields to MemStats
    • runtime: implement newcoro, coroswitch to support package iter
    • runtime: disallow defer in interrupts
    • runtime: add support for os/signal on Linux and MacOS
    • runtime: add gc layout info for some basic types to help the precise GC
    • runtime: bump GC mark stack size to avoid excessive heap rescans
  • targets
    • darwin: use Go standard library syscall package instead of a custom one
    • fe310: support GPIO PinInput
    • mips: fix compiler crash with GOMIPS=softfloat and defer
    • mips: add big-endian (GOARCH=mips) support
    • mips: use MIPS32 (instead of MIPS32R2) as the instruction set for wider compatibility
    • wasi: add relative and absolute --dir options to wasmtime args
    • wasip2: add wasmtime -S args to support network interfaces
    • wasm: add //go:wasmexport support (for all WebAssembly targets)
    • wasm: use precise instead of conservative GC for WebAssembly (including WASI)
    • wasm-unknown: add bulk memory flags since basically every runtime has it now
  • boards

0.33.0

20 Aug 12:52
Compare
Choose a tag to compare

This is an important release. No new boards, but we make up for that by adding a bunch of other big stuff!

Some of the highlights:

  • Go 1.23 support (including the new range-over-func language feature)
  • WASI preview 2 support
  • MIPS little endian support (big endian support is still experimental), so you can use GOARCH=mipsle
  • softfloat support for ARM and MIPS
  • improved error messages

For a full list of changes, see the list below.

  • general
    • use latest version of x/tools
    • add chromeos 9p support for flashing
    • sort compiler error messages by source position in a package
    • don't include prebuilt libraries in the release to simplify packaging and reduce the release tarball size
    • show runtime panic addresses for tinygo run
    • support Go 1.23 (including all new language features)
    • test: support GOOS/GOARCH pairs in the -target flag
    • test: remove message after test binary built
  • compiler
    • remove unused registers for x86_64 linux syscalls
    • remove old atomics workaround for AVR (not necessary in modern LLVM versions)
    • support golang.org/x/sys/unix syscalls
    • builder: remove workaround for generics race condition
    • builder: add package ID to compiler and optimization error messages
    • builder: show better error messages for some common linker errors
    • cgo: support preprocessor macros passed on the command line
    • cgo: use absolute paths for error messages
    • cgo: add support for printf
    • loader: handle go list errors inside TinyGo (for better error messages)
    • transform: fix incorrect alignment of heap-to-stack transform
    • transform: use thinlto-pre-link passes (instead of the full pipeline) to speed up compilation speed slightly
  • standard library
    • crypto/tls: add CipherSuiteName and some extra fields to ConnectionState
    • internal/abi: implement initial version of this package
    • machine: use new internal/binary package
    • machine: rewrite Reply() to fix sending long replies in I2C Target Mode
    • machine/usb/descriptor: Reset joystick physical
    • machine/usb/descriptor: Drop second joystick hat
    • machine/usb/descriptor: Add more HID... functions
    • machine/usb/descriptor: Fix encoding of values
    • machine/usb/hid/joystick: Allow more hat switches
    • os: add Chown, Truncate
    • os/user: use stdlib version of this package
    • reflect: return correct name for the unsafe.Pointer type
    • reflect: implement Type.Overflow* functions
    • runtime: implement dummy getAuxv to satisfy golang.org/x/sys/
    • runtime: don't zero out new allocations for -gc=leaking when they are already zeroed
    • runtime: simplify slice growing/appending code
    • runtime: print a message when a fatal signal like SIGSEGV happens
    • runtime/debug: add GoVersion to debug.BuildInfo
    • sync: add Map.Clear()
    • sync/atomic: add And* and Or* compiler intrinsics needed for Go 1.23
    • syscall: add Fork and Execve
    • syscall: add all MacOS errno values
    • testing: stub out T.Deadline
    • unique: implement custom (naive) version of the unique package
  • targets
    • arm: support GOARM=*,softfloat (softfloat support for ARM v5, v6, and v7)
    • mips: add linux/mipsle (and experimental linux/mips) support
    • mips: add GOMIPS=softfloat support
    • wasip2: add WASI preview 2 support
    • wasm/js: add node: prefix in require() call of wasm_exec.js
    • wasm-unknown: make sure the os package can be imported
    • wasm-unknown: remove import-memory flag

0.32.0

18 Jun 08:41
Compare
Choose a tag to compare

This release has lots of features and fixes that you need. From support for the new LLVM 18, to a patched version of the go/ssa package with a fix for the race condition that annoys anyone who maintains a CI build using TinyGo. Of course, no TinyGo release would be complete without new hardware supported, such as the Pimoroni Badger2040-W. And more WASM features too!

  • general

    • fix wasi-libc include headers on Nix
    • apply OpenOCD commands after target configuration
    • fix a minor race condition when determining the build tags
    • support UF2 drives with a space in their name on Linux
    • add LLVM 18 support
    • drop support for Go 1.18 to be able to stay up to date
  • compiler

    • move -panic=trap support to the compiler/runtime
    • fix symbol table index for WebAssembly archives
    • fix ed25519 build errors by adjusting the alias names
    • add aliases to generic AES functions
    • fix race condition by temporarily applying a proposed patch
    • builder: keep un-wasm-opt'd .wasm if -work was passed
    • builder: make sure wasm-opt command line is printed if asked
    • cgo: implement shift operations in preprocessor macros
    • interp: checking for methodset existance
  • standard library

    • machine: add __tinygo_spi_tx function to simulator
    • machine: fix simulator I2C support
    • machine: add GetRNG support to simulator
    • machine: add TxFifoFreeLevel for CAN
    • os: add Link
    • os: add FindProcess for posix
    • os: add Process.Release for unix
    • os: add SetReadDeadline stub
    • os, os/signal: add signal stubs
    • os/user: add stubs for Lookup{,Group} and Group
    • reflect: use int in StringHeader and SliceHeader on non-AVR platforms
    • reflect: fix NumMethods for Interface type
    • runtime: skip negative sleep durations in sleepTicks
  • targets

    • esp32: add I2C support
    • rp2040: move UART0 and UART1 to common file
    • rp2040: make all RP2040 boards available for simulation
    • rp2040: fix timeUnit type
    • stm32: add i2c Frequency and SetBaudRate function for chips that were missing implementation
    • wasm-unknown: add math and memory builtins that LLVM needs
    • wasip1: replace existing -target=wasi support with wasip1 as supported in Go 1.21+
  • boards

    • adafruit-esp32-feather-v2: add the Adafruit ESP32 Feather V2
    • badger2040-w: add support for the Badger2040 W
    • feather-nrf52840-sense: fix lack of LXFO
    • m5paper: add support for the M5 Paper
    • mksnanov3: limit programming speed to 1800 kHz
    • nucleol476rg: add stm32 nucleol476rg support
    • pico-w: add the Pico W (which is near-idential to the pico target)
    • thingplus-rp2040, waveshare-rp2040-zero: add WS2812 definition
    • pca10059-s140v7: add this variant to the PCA10059 board

0.31.2

11 Mar 09:15
Compare
Choose a tag to compare

This is a patch release to address a few important items that were needed quickly by the community, and that have been addressed since the last full release.

  • general

    • update the net submodule to updated version with Buffers implementation
  • compiler

    • syscall: add wasm_unknown tag to some additional files so it can compile more code
  • standard library

    • runtime: add Frame.Entry field

0.31.1

28 Feb 15:59
Compare
Choose a tag to compare

This is a quick patch release to fix some critical issues that were noticed right after v0.31.0. Thank you to our team for the fast response!

  • general

    • fix Binaryen build in make task
    • update final build stage of Docker dev image to go1.22
    • only use GHA cache for building Docker dev image
    • update the net submodule to latest version
  • compiler

    • interp: make getelementptr offsets signed
    • interp: return a proper error message when indexing out of range

0.31.0

26 Feb 17:48
Compare
Choose a tag to compare

This is the highly anticipated first release of 2024! Some of the most requested features:

  • Go 1.22 support
  • macOS arm64 native binary release build
  • Nix flake support
  • LLVM 17

There are many improvements and fixes to the compiler and runtime. We also have a new net package for greatly improved network support on bare metal devices. We have a new wasm-unknown target for WebAssembly early adopters. And of course several new boards supported, such as the Adafruit QT Py ESP32-C, and the Thumby.

  • general
    • remove LLVM 14 support
    • add LLVM 17 support, and use it by default
    • add Nix flake support
    • update bundled Binaryen to version 116
    • add ports subcommand that lists available serial ports for -port and -monitor
    • support wasmtime version 14
    • add -serial=rtt for serial output over SWD
    • add Go 1.22 support and use it by default
    • change minimum Node.js version from 16 to 18
  • compiler
    • use the new LLVM pass manager
    • allow systems with more stack space to allocate larger values on the stack
    • build: fix a crash due to sharing GlobalValues between build instances
    • cgo: add C._Bool type
    • cgo: fix calling CGo callback inside generic function
    • compileopts: set purego build tag by default so that more packages can be built
    • compileopts: force-enable CGo to avoid build issues
    • compiler: fix crash on type assert on interfaces with no methods
    • interp: print LLVM instruction in traceback
    • interp: support runtime times by running them at runtime
    • loader: enforce Go language version in the type checker (this may break existing programs with an incorrect Go version in go.mod)
    • transform: fix bug in StringToBytes optimization pass
  • standard library
    • crypto/tls: stub out a lot of functions
    • internal/task, machine: make TinyGo code usable with "big Go" CGo
    • machine: implement I2C.SetBaudRate consistently across chips
    • machine: implement SPI.Configure consistently across chips
    • machine: add DeviceID for nrf, rp2040, sam, stm32
    • machine: use smaller UART buffer size on atmega chips
    • machine/usb: allow setting a serial number using a linker flag
    • math: support more math functions on baremetal (picolibc) systems
    • net: replace entire net package with a new one based on the netdev driver
    • os/user: add bare-bones implementation of this package
    • reflect: stub CallSlice and FuncOf
    • reflect: add TypeFor[T]
    • reflect: update IsZero to Go 1.22 semantics
    • reflect: move indirect values into interface when setting interfaces
    • runtime: stub Breakpoint
    • sync: implement trylock
  • targets
    • atmega: use UART double speed mode for fewer errors and higher throughput
    • atmega328pb: refactor to enable extra uart
    • avr: don't compile large parts of picolibc (math, stdio) for LLVM 17 support
    • esp32: switch over to the official SVD file
    • esp32c3: implement USB_SERIAL for USBCDC communication
    • esp32c3: implement I2C
    • esp32c3: implement RNG
    • esp32c3: add more ROM functions and update linker script for the in-progress wifi support
    • esp32c3: update to newer SVD files
    • rp2040: add support for UART hardware flow control
    • rp2040: add definition for machine.PinToggle
    • rp2040: set XOSC startup delay multiplier
    • samd21: add support for UART hardware flow control
    • samd51: add support for UART hardware flow control
    • wasm: increase default stack size to 64k for wasi/wasm targets
    • wasm: bump wasi-libc version to SDK 20
    • wasm: remove line of dead code in wasm_exec.js
  • new targets/boards
    • qtpy-esp32c3: add Adafruit QT Py ESP32-C3 board
    • mksnanov3: add support for the MKS Robin Nano V3.x
    • nrf52840-generic: add generic nrf52840 chip support
    • thumby: add support for Thumby
    • wasm: add new wasm-unknown target that doesn't depend on WASI or a browser
  • boards
    • arduino-mkrwifi1010, arduino-nano33, nano-rp2040, matrixportal-m4, metro-m4-airlift, pybadge, pyportal: add ninafw build tag and some constants for BLE support
    • gopher-badge: fix typo in USB product name
    • nano-rp2040: add UART1 and correct mappings for NINA via UART
    • pico: bump default stack size from 2kB to 8kB
    • wioterminal: expose UART4

0.30.0

21 Sep 13:47
Compare
Choose a tag to compare

This is a smaller but important release just in time for GopherCon US.

Some of the bigger changes of this release are switching to LLVM 16, fixes for two separate hard-to-reproduce compiler crashes, improvements to USB-MIDI, and added support for the Adafruit Gemma M0.

Here is the full list:

  • general
    • add LLVM 16 support, use it by default
  • compiler
    • build: work around a race condition by building Go SSA serially
    • compiler: fix a crash by not using the LLVM global context types
    • interp: don't copy unknown values in runtime.sliceCopy to fix miscompile
    • interp: fix crash in error report by not returning raw LLVM values
  • standard library
    • machine/usb/adc/midi: various improvements and API changes
    • reflect: add support for [...]T[]T in reflect
  • targets
    • atsamd21, atsamd51: add support for USB INTERRUPT OUT
    • rp2040: always use the USB device enumeration fix, even in chips that supposedly have the HW fix
    • wasm: increase default stack size to 32k for wasi/wasm
  • boards
    • gobadge: add GoBadge target as alias for PyBadge :)
    • gemma-m0: add support for the Adafruit Gemma M0

0.29.0

25 Aug 21:16
Compare
Choose a tag to compare

This release adds support for Go 1.21

It also adds compatibility with the new GOOS=wasip1 using the Go built-in WASI support.

There are a number of compiler and standard library improvements, such as even better reflection, and improved map/slice implementations.

We also have a bunch of useful fixes and improvements to various microcontrollers, including new support for hardware based watchdog timers (WDT) so your embedded devices can be more reliable than ever.

Here is the full changelog:

  • general
    • Go 1.21 support
    • use https for renesas submodule #3856
    • ci: rename release-double-zipped to something more useful
    • ci: update Node.js from version 14 to version 16
    • ci: switch GH actions builds to use Go 1.21 final release
    • docker: update clang to version 15
    • docker: use Go 1.21 for Docker dev container build
    • main: add target JSON file in tinygo info output
    • main: improve detection of filesystems
    • main: use go env instead of doing all detection manually
    • make: add make task to generate Renesas device wrappers
    • make: add task to check NodeJS version before running tests
    • add submodule for Renesas SVD file mirror repo
    • update to go-serial package v1.6.0
    • testing: add Testing function
    • tools/gen-device-svd: small changes needed for Renesas MCUs
  • compiler
    • builder: update message for max supported Go version
    • compiler,reflect: NumMethods reports exported methods only
    • compiler: add compiler-rt and wasm symbols to table
    • compiler: add compiler-rt to wasm.json
    • compiler: add min and max builtin support
    • compiler: implement clear builtin for maps
    • compiler: implement clear builtin for slices
    • compiler: improve panic message when a runtime call is unavailable
    • compiler: update .ll test output
    • loader: merge go.env file which is now required starting in Go 1.21 to correctly get required packages
  • standard library
    • os: define ErrNoDeadline
    • reflect: Add FieldByNameFunc
    • reflect: add SetZero
    • reflect: fix iterating over maps with interface{} keys
    • reflect: implement Value.Grow
    • reflect: remove unecessary heap allocations
    • reflect: use .key() instead of a type assert
    • sync: add implementation from upstream Go for OnceFunc, OnceValue, and OnceValues
  • targets
    • machine: UART refactor (#3832)
    • machine/avr: pin change interrupt
    • machine/macropad_rp2040: add machine.BUTTON
    • machine/nrf: add I2C timeout
    • machine/nrf: wait for stop condition after reading from the I2C bus
    • machine/nRF52: set SPI TX/RX lengths even data is empty. Fixes #3868 (#3877)
    • machine/rp2040: add missing suffix to CMD_READ_STATUS
    • machine/rp2040: add NoPin support
    • machine/rp2040: move flash related functions into separate file from C imports for correct - LSP. Fixes #3852
    • machine/rp2040: wait for 1000 us after flash reset to avoid issues with busy USB bus
    • machine/samd51,rp2040,nrf528xx,stm32: implement watchdog
    • machine/samd51: fix i2cTimeout was decreasing due to cache activation
    • machine/usb: Add support for HID Keyboard LEDs
    • machine/usb: allow USB Endpoint settings to be changed externally
    • machine/usb: refactor endpoint configuration
    • machine/usb: remove usbDescriptorConfig
    • machine/usb/hid,joystick: fix hidreport (3) (#3802)
    • machine/usb/hid: add RxHandler interface
    • machine/usb/hid: rename Handler() to TxHandler()
    • wasi: allow zero inodes when reading directories
    • wasm: add support for GOOS=wasip1
    • wasm: fix functions exported through //export
    • wasm: remove i64 workaround, use BigInt instead
    • example: adjust time offset
    • example: simplify pininterrupt
  • boards
    • targets: add AKIZUKI DENSHI AE-RP2040
    • targets: adding new uf2 target for PCA10056 (#3765)

0.28.1

11 Jun 22:59
Compare
Choose a tag to compare

This is a small patch release that fixes two issues:

  • The version was set to 0.28.0-dev in the v0.28.0 release, while it should not have the -dev prefix. This is fixed in v0.28.1.
  • A small bugfix for SPI on the rp2040 is included.