Skip to content

Releases: tinygo-org/tinygo

0.25.0-beta1

29 Jul 05:45
Compare
Choose a tag to compare
0.25.0-beta1 Pre-release
Pre-release

This is a pre-release of TinyGo v0.25.0

You will need to install manually by downloading files from here. The beta versions are not available on Homebrew for macOS, nor for Scoop on Windows.

0.24.0

01 Jul 10:48
Compare
Choose a tag to compare

This release adds a few pretty major features to TinyGo: the embed package, recover() (for most non-wasm architectures), and generics. It also adds initial (incomplete) support for Go 1.19, which is still in beta. Apart from that, we have the usual assortment of new features and bug fixes and we add the Badger 2040 board.

One possible breaking change is that we will now use a few newer WebAssembly features. If this is a problem, let us know and we can add a new target without these newer features. We use them because it lowers the binary size of the .wasm files.

Here is the complete changelog:

  • command line
    • remove support for go 1.15
    • remove support for LLVM 11 and LLVM 12
    • add initial Go 1.19 beta support
    • test: fix package/... syntax
  • compiler
    • add support for the embed package
    • builder: improve error message for "command not found"
    • builder: add support for ThinLTO on MacOS and Windows
    • builder: free LLVM objects after use, to reduce memory leaking
    • builder: improve -no-debug error messages
    • cgo: be more strict: CGo now requires every Go file to import the headers it needs
    • compiler: alignof(func) is 1 pointer, not 2
    • compiler: add support for type parameters (aka generics)
    • compiler: implement recover() built-in function
    • compiler: support atomic, volatile, and LLVM memcpy-like functions in defer
    • compiler: drop support for macos syscalls via inline assembly
    • interp: do not try to interpret past task.Pause()
    • interp: fix some buggy localValue handling
    • interp: do not unroll loops
    • transform: fix MakeGCStackSlots that caused a possible GC bug on WebAssembly
  • standard library
    • os: enable os.Stdin for baremetal target
    • reflect: add Value.UnsafePointer method
    • runtime: scan GC globals conservatively on Windows, MacOS, Linux and Nintendo Switch
    • runtime: add per-map hash seeds
    • runtime: handle nil map write panics
    • runtime: add stronger hash functions
    • syscall: implement Getpagesize
  • targets
    • atmega2560: support UART1-3 + example for uart
    • avr: use compiler-rt for improved float64 support
    • avr: simplify timer-based time
    • avr: fix race condition in stack write
    • darwin: add support for GOARCH=arm64 (aka Apple Silicon)
    • darwin: support -size=short and -size=full flag
    • rp2040: replace sleep 'busy loop' with timer alarm
    • rp2040: align api for PortMaskSet, PortMaskClear
    • rp2040: fix GPIO interrupts
    • samd21, samd51, nrf52840: add support for USBHID (keyboard / mouse)
    • wasm: update wasi-libc version
    • wasm: use newer WebAssembly features
  • boards
    • add Badger 2040
    • matrixportal-m4: attach USB DP to the correct pin
    • teensy40: add I2C support
    • wioterminal: fix I2C definition

0.23.0

29 Apr 09:11
Compare
Choose a tag to compare

This release adds support for the recently released Go 1.18, although not for all language features yet. We have also added support for LLVM 14 which is the latest release of the compiler framework. Lots of improvements to the runtime and standard library support, especially when running in WASM/WASI environments. Also a whole bunch of bugfixes and improvements to our hardware support, in particular for the RP2040 processor.

The following new boards have been added this release:

Here is the complete list of changes:

  • command line
    • add -work flag
    • add Go 1.18 support
    • add LLVM 14 support
    • run: add support for command-line parameters
    • build: calculate default output path if -o is not specified
    • build: add JSON output
    • test: support multiple test binaries with -c
    • test: support flags like -v on all targets (including emulated firmware)
  • compiler
    • add support for ThinLTO
    • use compiler-rt from LLVM
    • builder: prefer GNU build ID over Go build ID for caching
    • builder: add support for cross compiling to Darwin
    • builder: support machine outlining pass in stacksize calculation
    • builder: disable asynchronous unwind tables
    • compileopts: fix emulator configuration on non-amd64 Linux architectures
    • compiler: move allocations > 256 bytes to the heap
    • compiler: fix incorrect unsafe.Alignof on some 32-bit architectures
    • compiler: accept alias for slice cap builtin
    • compiler: allow slices of empty structs
    • compiler: fix difference in aliases in interface methods
    • compiler: make RawSyscall an alias for Syscall
    • compiler: remove support for memory references in AsmFull
    • loader: only add Clang header path for CGo
    • transform: fix poison value in heap-to-stack transform
  • standard library
    • internal/fuzz: add this package as a shim
    • os: implement readdir for darwin and linux
    • os: add DirFS, which is used by many programs to access readdir.
    • os: isWine: be compatible with older versions of wine, too
    • os: implement RemoveAll
    • os: Use a uintptr for NewFile
    • os: add stubs for exec.ExitError and ProcessState.ExitCode
    • os: export correct values for DevNull for each OS
    • os: improve support for Signal by fixing various bugs
    • os: implement File.Fd method
    • os: implement UserHomeDir
    • os: add exec.ProcessState stub
    • os: implement Pipe for darwin
    • os: define stub ErrDeadlineExceeded
    • reflect: add stubs for more missing methods
    • reflect: rename reflect.Ptr to reflect.Pointer
    • reflect: add Value.FieldByIndexErr stub
    • runtime: fix various small GC bugs
    • runtime: use memzero for leaking collector instead of manually zeroing objects
    • runtime: implement memhash
    • runtime: implement fastrand
    • runtime: add stub for debug.ReadBuildInfo
    • runtime: add stub for NumCPU
    • runtime: don't inline runtime.alloc with -gc=leaking
    • runtime: add Version
    • runtime: add stubs for NumCgoCall and NumGoroutine
    • runtime: stub {Lock,Unlock}OSThread on Windows
    • runtime: be able to deal with a very small heap
    • syscall: make Environ return a copy of the environment
    • syscall: implement getpagesize and munmap
    • syscall: wasi: define MAP_SHARED and PROT_READ
    • syscall: stub mmap(), munmap(), MAP_SHARED, PROT_READ, SIGBUS, etc. on nonhosted targets
    • syscall: darwin: more complete list of signals
    • syscall: wasi: more complete list of signals
    • syscall: stub WaitStatus
    • syscall/js: allow copyBytesTo(Go|JS) to use Uint8ClampedArray
    • testing: implement TempDir
    • testing: nudge type TB closer to upstream; should be a no-op change.
    • testing: on baremetal platforms, use simpler test matcher
  • targets
    • atsamd: fix usbcdc initialization when -serial=uart
    • atsamd51: allow higher frequency when using SPI
    • esp: support CGo
    • esp32c3: add support for input pin
    • esp32c3: add support for GPIO interrupts
    • esp32c3: add support to receive UART data
    • rp2040: fix PWM bug at high frequency
    • rp2040: fix some minor I2C bugs
    • rp2040: fix incorrect inline assembly
    • rp2040: fix spurious i2c STOP during write+read transaction
    • rp2040: improve ADC support
    • wasi: remove --export-dynamic linker flag
    • wasm: remove heap allocator from wasi-libc
  • boards
    • circuitplay-bluefruit: move pin mappings so board can be compiled for WASM use in Playground
    • esp32-c3-12f: add the ESP32-C3-12f Kit
    • m5stamp-c3: add pin setting of UART
    • macropad-rp2040: add the Adafruit MacroPad RP2040 board
    • nano-33-ble: typo in LPS22HB peripheral definition and documentation (#2579)
    • teensy41: add the Teensy 4.1 board
    • teensy40: add ADC support
    • teensy40: add SPI support
    • thingplus-rp2040: add the SparkFun Thing Plus RP2040 board
    • wioterminal: add DefaultUART
    • wioterminal: verify written data when flashing through OpenOCD
    • xiao-ble: add XIAO BLE nRF52840 support

0.22.0

26 Jan 14:12
Compare
Choose a tag to compare

This release contains significantly improved standard library support with many more packages passing all tests. Especially the os package was improved a lot with many functions added to match the standard Go os package. In addition, we upgraded LLVM to LLVM 13, improved the build cache (no tinygo clean anymore), and of course we've made various other improvements and bug fixes.

We've added the following boards this release:

Here are the changes in detail:

  • command line
    • add asyncify to scheduler flag help
    • support -run for tests
    • remove FreeBSD target support
    • add LLVM 12 and LLVM 13 support, use LLVM 13 by default
    • add support for ARM64 MacOS
    • improve help
    • check /run/media as well as /media on Linux for non-debian-based distros
    • test: set cmd.Dir even when running emulators
    • info: add JSON output using the -json flag
  • compiler
    • builder: fix off-by-one in size calculation
    • builder: handle concurrent library header rename
    • builder: use flock to avoid double-compiles
    • builder: use build ID as cache key
    • builder: add -fno-stack-protector to musl build
    • builder: update clang header search path to look in /usr/lib
    • builder: explicitly disable unwind tables for ARM
    • cgo: add support for C.CString and related functions
    • compiler: fix ranging over maps with particular map types
    • compiler: add correct debug location to init instructions
    • compiler: fix emission of large object layouts
    • compiler: work around AVR atomics bugs
    • compiler: predeclare runtime.trackPointer
    • interp: work around AVR function pointers in globals
    • interp: run goroutine starts and checks at runtime
    • interp: always run atomic and volatile loads/stores at runtime
    • interp: bump timeout to 180 seconds
    • interp: handle type assertions on nil interfaces
    • loader: elminate goroot cache inconsistency
    • loader: respect $GOROOT when running go list
    • transform: allocate the correct amount of bytes in an alloca
    • transform: remove switched func lowering
  • standard library
    • crypto/rand: show error if platform has no rng
    • device/*: add *_Msk field for each bit field and avoid duplicates
    • device/*: provide Set/Get for each register field described in the SVD files
    • internal/task: swap stack chain when switching goroutines
    • internal/task: remove -scheduler=coroutines
    • machine: add Device string constant
    • net: add bare Interface implementation
    • net: add net.Buffers
    • os: stub out support for some features
    • os: obey TMPDIR on unix, TMP on Windows, etc
    • os: implement ReadAt, Mkdir, Remove, Stat, Lstat, CreateTemp, MkdirAll, Chdir, Chmod, Clearenv, Unsetenv, Setenv, MkdirTemp, Rename, Seek, ExpandEnv, Symlink, Readlink
    • os: implement File.Stat
    • os: fix IsNotExist on nonexistent path
    • os: fix opening files on WASI in read-only mode
    • os: work around lack of syscall.seek on 386 and arm
    • reflect: make sure indirect pointers are handled correctly
    • runtime: allow comparing interfaces
    • runtime: use LLVM intrinsic to read the stack pointer
    • runtime: strengthen hashmap hash function for structs and arrays
    • runtime: fix float/complex hashing
    • runtime: fix nil map dereference
    • runtime: add realloc implementation to GCs
    • runtime: handle negative sleep times
    • runtime: correct GC scan bounds
    • runtime: remove extalloc GC
    • rumtime: implement __sync libcalls as critical sections for most microcontrollers
    • runtime: add stubs for Func.FileLine and Frame.PC
    • sync: fix concurrent read-lock on write-locked RWMutex
    • sync: add a package doc
    • sync: add tests
    • syscall: add support for Mmap and Mprotect
    • syscall: fix array size for mmap slice creation
    • syscall: enable Getwd in wasi
    • testing: add a stub for CoverMode
    • testing: support -bench option to run benchmarks matching the given pattern.
    • testing: support b.SetBytes(); implement sub-benchmarks.
    • testing: replace spaces with underscores in test/benchmark names, as upstream does
    • testing: implement testing.Cleanup
    • testing: allow filtering subbenchmarks with the -bench flag
    • testing: implement -benchtime flag
    • testing: print duration
    • testing: allow filtering of subtests using -run
  • targets
    • all: change LLVM features to match vanilla Clang
    • avr: use interrupt-based timer which is much more accurate
    • nrf: fix races in I2C
    • samd51: implement TRNG for randomness
    • stm32: pull-up on I2C lines
    • stm32: fix timeout for i2c comms
    • stm32f4, stm32f103: initial implementation for ADC
    • stm32f4, stm32f7, stm32l0x2, stm32l4, stm32l5, stm32wl: TRNG implementation in crypto/rand
    • stm32wl: add I2C support
    • windows: add support for the -size= flag
    • wasm: add support for tinygo test
    • wasi, wasm: raise default stack size to 16 KiB
  • boards
    • add M5Stack
    • add lorae5 (stm32wle) support
    • add Generic Node Sensor Edition
    • add STM32F469 Discovery
    • add M5Stamp C3
    • add Blues Wireless Swan
    • bluepill: add definitions for ADC pins
    • stm32f4disco: add definitions for ADC pins
    • stm32l552ze: use supported stlink interface
    • microbit-v2: add some pin definitions

0.21.0

18 Nov 14:30
Compare
Choose a tag to compare

This release brings many small changes to the TinyGo compiler toolchain. Some of the highlights are: support for building Windows binaries in TinyGo, improved goroutine support on WebAssembly using Asyncify, and many small fixes that together get 12 more standard library packages to pass the package tests. Of course, there is also a number of improvements for microcontrollers such as ESP32-C3 and the RP2040. And lastly, we've added support for the M5Stack Core2 board.

  • command line
    • drop support for LLVM 10
    • build: drop support for LLVM targets in the -target flag
    • build: fix paths in error messages on Windows
    • build: add -p flag to set parallelism
    • lldb: implement tinygo lldb subcommand
    • test: use emulator exit code instead of parsing test output
    • test: pass testing arguments to wasmtime
  • compiler
    • use -opt flag for optimization level in CFlags (-Os, etc)
    • builder: improve accuracy of the -size=full flag
    • builder: hardcode some more frame sizes for _aeabi* functions
    • builder: add support for -size= flag for WebAssembly
    • cgo: fix line/column reporting in syntax error messages
    • cgo: support function definitions in CGo headers
    • cgo: implement rudimentary C array decaying
    • cgo: add support for stdio in picolibc and wasi-libc
    • cgo: run CGo parser per file, not per CGo fragment
    • compiler: fix unintentionally exported math functions
    • compiler: properly implement div and rem operations
    • compiler: add support for recursive function types
    • compiler: add support for the go keyword on interface methods
    • compiler: add minsize attribute for -Oz
    • compiler: add "target-cpu" and "target-features" attributes
    • compiler: fix indices into strings and arrays
    • compiler: fix string compare functions
    • interp: simplify some code to avoid some errors
    • interp: support recursive globals (like linked lists) in globals
    • interp: support constant globals
    • interp: fix reverting of extractvalue/insertvalue with multiple indices
    • transform: work around renamed return type after merging LLVM modules
  • standard library
    • internal/bytealg: fix indexing error in Compare()
    • machine: support Pin.Get() function when the pin is configured as output
    • net, syscall: Reduce code duplication by switching to internal/itoa.
    • os: don't try to read executable path on baremetal
    • os: implement Getwd
    • os: add File.WriteString and File.WriteAt
    • reflect: fix type.Size() to account for struct padding
    • reflect: don't construct an interface-in-interface value
    • reflect: implement Value.Elem() for interface values
    • reflect: fix Value.Index() in a specific case
    • reflect: add support for DeepEqual
    • runtime: add another set of invalid unicode runes to encodeUTF8()
    • runtime: only initialize os.runtime_args when needed
    • runtime: only use CRLF on baremetal systems for println
    • runtime/debug: stub debug.SetMaxStack
    • runtime/debug: stub debug.Stack
    • testing: add a stub for t.Parallel()
    • testing: add support for -test.short flag
    • testing: stub B.ReportAllocs()
    • testing: add testing.Verbose
    • testing: stub testing.AllocsPerRun
  • targets
    • fix gen-device-svd to handle 64-bit values
    • add CPU and Features property to all targets
    • match LLVM triple to the one Clang uses
    • atsam: simplify definition of SERCOM UART, I2C and SPI peripherals
    • atsam: move I2S0 to machine file
    • esp32: fix SPI configuration
    • esp32c3: add support for GDB debugging
    • esp32c3: add support for CPU interrupts
    • esp32c3: use tasks scheduler by default
    • fe310: increase CPU frequency from 16MHz to 320MHz
    • fe310: add support for bit banging drivers
    • linux: build static binaries using musl
    • linux: reduce binary size by calling write instead of putchar
    • linux: add support for GOARM
    • riscv: implement 32-bit atomic operations
    • riscv: align the heap to 16 bytes
    • riscv: switch to tasks-based scheduler
    • rp2040: add CPUFrequency()
    • rp2040: improve I2C baud rate configuration
    • rp2040: add pin interrupt API
    • rp2040: refactor PWM code and fix Period calculation
    • stm32f103: fix SPI
    • stm32f103: make SPI frequency selection more flexible
    • qemu: signal correct exit code to QEMU
    • wasi: run C/C++ constructors at startup
    • wasm: ensure heapptr is aligned
    • wasm: update wasi-libc dependency
    • wasm: wasi: use asyncify
    • wasm: support -scheduler=none
    • windows: add support for Windows (amd64 only for now)
  • boards
    • feather-stm32f405, feather-rp2040: add I2C pin names
    • m5stack-core2: add M5Stack Core2
    • nano-33-ble: SoftDevice s140v7 support
    • nano-33-ble: add constants for more on-board pins

0.20.0

21 Sep 18:31
Compare
Choose a tag to compare

This release adds support for Go 1.17, fixes a bunch of compiler bugs (especially for WebAssembly), and adds support for a few new boards including boards based on the ESP32-C3 chip.

  • command line
    • add support for Go 1.17
    • improve Go version detection
    • add support for the Black Magic Probe (BMP)
    • add a flag for creating cpu profiles
  • compiler
    • builder: list libraries at the end of the linker command
    • builder: strip debug information at link time instead of at compile time
    • builder: add missing error check for ioutil.TempFile()
    • builder: simplify running of jobs
    • compiler: move LLVM math builtin support into the compiler
    • compiler: move math aliases from the runtime to the compiler
    • compiler: add aliases for many hashing packages
    • compiler: add *ssa.MakeSlice bounds tests
    • compiler: fix max possible slice
    • compiler: add support for new language features of Go 1.17
    • compiler: fix equally named structs in different scopes
    • compiler: avoid zero-sized alloca in channel operations
    • interp: don't ignore array indices for untyped objects
    • interp: keep reverted package initializers in order
    • interp: fix bug in compiler-time/run-time package initializers
    • loader: fix panic in CGo files with syntax errors
    • transform: improve GC stack slot pass to work around a bug
  • standard library
    • crypto/rand: switch to arc4random_buf
    • math: fix math.Max and math.Min
    • math/big: fix undefined symbols error
    • net: add MAC address implementation
    • os: implement os.Executable
    • os: add SEEK_SET, SEEK_CUR, and SEEK_END
    • reflect: add StructField.IsExported method
    • runtime: reset heapptr to heapStart after preinit()
    • runtime: add subsections_via_symbols to assembly files on darwin
    • testing: add subset implementation of Benchmark
    • testing: test testing package using tinygo test
    • testing: add support for the -test.v flag
  • targets
    • 386: bump minimum requirement to the Pentium 4
    • arm: switch to Thumb instruction set on ARM
    • atsamd: fix copy-paste error for atsamd21/51 calibTrim block
    • baremetal,wasm: support command line params and environment variables
    • cortexm: fix stack overflow because of unaligned stacks
    • esp32c3: add support for the ESP32-C3 from Espressif
    • nrf52840: fix ram size
    • nxpmk66f18: fix a suspicious bitwise operation
    • rp2040: add SPI support
    • rp2040: add I2C support
    • rp2040: add PWM implementation
    • rp2040: add openocd configuration
    • stm32: add support for PortMask* functions for WS2812 support
    • unix: fix time base for time.Now()
    • unix: check for mmap error and act accordingly
    • wasm: override dlmalloc heap implementation from wasi-libc
    • wasm: align heap to 16 bytes
    • wasm: add support for the crypto/rand package
  • boards
    • add DefaultUART to adafruit boards
    • arduino-mkrwifi1010: add board definition for Arduino MKR WiFi 1010
    • arduino-mkrwifi1010: fix pin definition of NINA_RESETN
    • feather-nrf52: fix pin definition of uart
    • feather-rp2040: add pin name definition
    • gameboy-advance: fix ROM header
    • mdbt50qrx-uf2: add Raytac MDBT50Q-RX Dongle with TinyUF2
    • nano-rp2040: define NINA_SPI and fix wifinina pins
    • teensy40: enable hardware UART reconfiguration, fix receive watermark interrupt

0.19.0

01 Jul 10:55
Compare
Choose a tag to compare

This release contains a bunch of small changes such as improvements to serial output, various compiler improvements, and the addition of TinyGo versions of the net and crypto/rand packages. The net package isn't complete, it is a work in progress and will eventually allow for plugging in different network stacks.

When it comes to board support, this release has one significant addition: the RP2040 chip developed by the Raspberry Pi foundation used on boards from some vendors. It also adds support for two new nRF52840-based boards.

  • command line
    • don't consider compile-only tests as failing
    • add -test flag for tinygo list
    • escape commands while printing them with the -x flag
    • make flash-command portable and safer to use
    • use extended-remote instead of remote in GDB
    • detect specific serial port IDs based on USB vid/pid
    • add a flag to the command line to select the serial implementation
  • compiler
    • cgo: improve constant parser
    • compiler: support chained interrupt handlers
    • compiler: add support for running a builtin in a goroutine
    • compiler: do not emit nil checks for loading closure variables
    • compiler: skip context parameter when starting regular goroutine
    • compiler: refactor method names
    • compiler: add function and global section pragmas
    • compiler: implement syscall.rawSyscallNoError in inline assembly
    • interp: ignore inline assembly in markExternal
    • interp: fix a bug in pointer cast workaround
    • loader: fix testing a main package
  • standard library
    • crypto/rand: replace this package with a TinyGo version
    • machine: make USBCDC global a pointer
    • machine: make UART objects pointer receivers
    • machine: define Serial as the default output
    • net: add initial support for net.IP
    • net: add more net compatibility
    • os: add stub for os.ReadDir
    • os: add FileMode constants from Go 1.16
    • os: add stubs required for net/http
    • os: implement process related functions
    • reflect: implement AppendSlice
    • reflect: add stubs required for net/http
    • runtime: make task.Data a 64-bit integer to avoid overflow
    • runtime: expose memory stats
    • sync: implement NewCond
    • syscall: fix int type in libc version
  • targets
    • cortexm: do not disable interrupts on abort
    • cortexm: bump default stack size to 2048 bytes
    • nrf: avoid heap allocation in waitForEvent
    • nrf: don't trigger a heap allocation in SPI.Transfer
    • nrf52840: add support for flashing with the BOSSA tool
    • rp2040: add support for GPIO input
    • rp2040: add basic support for ADC
    • rp2040: gpio and adc pin definitions
    • rp2040: implement UART
    • rp2040: patch elf to checksum 2nd stage boot
    • stm32: add PWM for most chips
    • stm32: add support for pin interrupts
    • stm32f103: add support for PinInputPullup / PinInputPulldown
    • wasi: remove wasm build tag
  • boards
    • feather-rp2040: add support for this board
    • feather-nrf52840-sense: add board definition for this board
    • pca10059: support flashing from Windows
    • nano-rp2040: add this board
    • nano-33-ble: add support for this board
    • pico: add the Raspberry Pi Pico board with the new RP2040 chip
    • qtpy: add pin for neopixels
    • all: add definition for ws2812 for supported boards

0.18.0

12 May 12:35
Compare
Choose a tag to compare

This release is the combination of more than two months of work, including improvements to reflection, a big change to the PWM API to make it more powerful (including support for servos!), support for command line parameters and environment variables, many improvements to SAM and STM32 chip support. It also saw the addition of various new boards.

Note that this release drops support for Go 1.11 and Go 1.12, so if you're using one of those versions please upgrade to Go 1.13 or later.

  • command line
    • drop support for Go 1.11 and 1.12
    • throw an error when no target is specified on Windows
    • improve error messages in getDefaultPort(), support for multiple ports
    • remove -cflags and -ldflags flags
    • implement -ldflags="-X ..."
    • add -print-allocs flag that lets you print all heap allocations
    • openocd commands in tinygo command line
    • add -llvm-features parameter
    • match go test output
    • discover USB ports only, this will ignore f.ex. bluetooth
    • use physicmal path instead of cached GOROOT in function getGoroot
    • add goroot for snap installs
  • compiler
    • builder: add support for -opt=0
    • builder, compiler: compile and cache packages in parallel
    • builder: run interp per package
    • builder: cache C and assembly file outputs
    • builder: add support for -x flag to print commands
    • builder: add optsize attribute while building the package
    • builder: run function passes per package
    • builder: hard code Clang compiler
    • compiler: do not use llvm.GlobalContext()
    • compiler: remove SimpleDCE pass
    • compiler: do not emit nil checks for *ssa.Alloc instructions
    • compiler: merge runtime.typecodeID and runtime.typeInInterface
    • compiler: do not check for impossible type asserts
    • compiler: fix use of global context: llvm.Int32Type()
    • compiler: add interface IR test
    • compiler: fix lack of method name in interface matching
    • compiler: fix "fragment covers entire variable" bug
    • compiler: optimize string literals and globals
    • compiler: decouple func lowering from interface type codes
    • compiler: add function attributes to some runtime calls
    • compiler: improve position information in error messages
    • cgo: add support for CFLAGS in .c files
    • interp: support GEP on fixed (MMIO) addresses
    • interp: handle (reflect.Type).Elem()
    • interp: add support for runtime.interfaceMethod
    • interp: make toLLVMValue return an error instead of panicking
    • interp: add support for switch statement
    • interp: fix phi instruction
    • interp: remove map support
    • interp: support extractvalue/insertvalue with multiple operands
    • transform: optimize string comparisons against ""
    • transform: optimize reflect.Type Implements() method
    • transform: fix bug in interface lowering when signatures are renamed
    • transform: don't rely on struct name of runtime.typecodeID
    • transform: use IPSCCP pass instead of the constant propagation pass
    • transform: fix func lowering assertion failure
    • transform: do not lower zero-sized alloc to alloca
    • transform: split interface and reflect lowering
  • standard library
    • runtime: add dummy debug package
    • machine: fix data shift/mask in newUSBSetup
    • machine: make machine.I2C0 and similar objects pointers
    • machine: unify usbcdc code
    • machine: refactor PWM support
    • machine: avoid heap allocations in USB code
    • reflect: let reflect.Type be of interface type
    • reflect: implement a number of stub functions
    • reflect: check for access in the Interface method call
    • reflect: fix AssignableTo and Implements methods
    • reflect: implement Value.CanAddr
    • reflect: implement Sizeof and Alignof for func values
    • reflect: implement New function
    • runtime: implement command line arguments in hosted environments
    • runtime: implement environment variables for Linux
    • runtime: improve timers on nrf, and samd chips
  • targets
    • all: use -Qunused-arguments only for assembly files
    • atmega1280: add PWM support
    • attiny: remove dummy UART
    • atsamd21: improve SPI
    • atsamd51: fix PWM support in atsamd51p20
    • atsamd5x: improve SPI
    • atsamd51, atsame5x: unify samd51 and same5x
    • atsamd51, atsamd21: fix ADC.Get() value at 8bit and 10bit
    • atsame5x: add support for CAN
    • avr: remove I2C stubs from attiny support
    • cortexm: check for arm-none-eabi-gdb and gdb-multiarch commands
    • cortexm: add __isr_vector symbol
    • cortexm: disable FPU on Cortex-M4
    • cortexm: clean up Cortex-M target files
    • fe310: fix SPI read
    • gameboy-advance: Fix RGBA color interpretation
    • nrf52833: add PWM support
    • stm32l0: use unified UART logic
    • stm32: move f103 (bluepill) to common i2c code
    • stm32: separate altfunc selection for UART Tx/Rx
    • stm32: i2c implementation for F7, L5 and L4 MCUs
    • stm32: make SPI CLK fast to fix data issue
    • stm32: support SPI on L4 series
    • unix: avoid possible heap allocation with -opt=0
    • unix: use conservative GC by default
    • unix: use the tasks scheduler instead of coroutines
    • wasi: upgrade WASI version to wasi_snapshot_preview1
    • wasi: darwin: support basic file io based on libc
    • wasm: only export explicitly exported functions
    • wasm: use WASI ABI for exit function
    • wasm: scan globals conservatively
  • boards
    • arduino-mega1280: add support for the Arduino Mega 1280
    • arduino-nano-new: Add Arduino Nano w/ New Bootloader target
    • atsame54-xpro: add initial support this board
    • feather-m4-can: add initial support for this board
    • grandcentral-m4: add board support for Adafruit Grand Central M4 (SAMD51)
    • lgt92: update to new UART structure
    • microbit: remove LED constant
    • microbit-v2: add support for S113 SoftDevice
    • nucleol432: add support for this board
    • nucleo-l031k6: add this board
    • pca10059: initial support for this board
    • qtpy: fix msd-volume-name
    • qtpy: fix i2c setting
    • teensy40: move txBuffer allocation to UART declaration
    • teensy40: add UART0 as alias for UART1

0.17.0

06 Mar 14:30
Compare
Choose a tag to compare

This is a large release of almost 3 months of work, with several improvements to the compiler, tinygo gdb, many improvements to the machine package and finally the addition of several new boards. We've also updated TinyGo with support for LLVM 11 and Go 1.16.

  • command line
    • switch to LLVM 11 for static builds
    • support gdb debugging with AVR
    • add support for additional openocd commands
    • add -x flag to print commands
    • use LLVM 11 by default when linking LLVM dynamically
    • update go-llvm to use LLVM 11 on macOS
    • bump go.bug.st/serial to version 1.1.2
    • do not build LLVM with libxml to work around a bugo on macOS
    • add support for Go 1.16
    • support gdb daemonization on Windows
    • remove support for LLVM 9, to fix CI
    • kill OpenOCD if it does not exit with a regular quit signal
    • support -ocd-output on Windows
  • compiler
    • builder: parallelize most of the build
    • builder: remove unused cacheKey parameter
    • builder: add -mcpu flag while building libraries
    • builder: wait for running jobs to finish
    • cgo: add support for variadic functions
    • compiler: fix undefined behavior in wordpack
    • compiler: fix incorrect "exported function" panic
    • compiler: fix non-int integer constants (fixing a crash)
    • compiler: refactor and add tests
    • compiler: emit a nil check when slicing an array pointer
    • compiler: saturate float-to-int conversions
    • compiler: test float to int conversions and fix upper-bound calculation
    • compiler: support all kinds of deferred builtins
    • compiler: remove ir package
    • compiler: remove unnecessary main.main call workaround
    • compiler: move the setting of attributes to getFunction
    • compiler: create runtime types lazily when needed
    • compiler: move settings to a separate Config struct
    • compiler: work around an ARM backend bug in LLVM
    • interp: rewrite entire package
    • interp: fix alignment of untyped globals
    • loader: use name "main" for the main package
    • loader: support imports from vendor directories
    • stacksize: add support for DW_CFA_offset_extended
    • transform: show better error message in coroutines lowering
  • standard library
    • machine: accept configuration struct for ADC parameters
    • machine: make I2C.Configure signature consistent
    • reflect: implement PtrTo
    • runtime: refactor to simplify stack switching
    • runtime: put metadata at the top end of the heap
  • targets
    • atsam: add a length check to findPinPadMapping
    • atsam: improve USBCDC
    • atsam: avoid infinite loop when USBCDC is disconnected
    • avr: add SPI support for Atmega based chips
    • avr: use Clang for compiling C and assembly files
    • esp32: implement task based scheduler
    • esp32: enable the FPU
    • esp8266: implement task based scheduler
    • esp: add compiler-rt library
    • esp: add picolibc
    • nrf: refactor code a bit to reduce duplication
    • nrf: use SPIM peripheral instead of the legacy SPI peripheral
    • nrf: update nrfx submodule to latest commit
    • nrf52840: ensure that USB CDC interface is only initialized once
    • nrf52840: improve USBCDC
    • stm32: use stm32-rs SVDs which are of much higher quality
    • stm32: harmonization of UART logic
    • stm32: replace I2C addressable interface with simpler type
    • stm32: fix i2c and add stm32f407 i2c
    • stm32: revert change that adds support for channels in interrupts
    • wasm: implement a growable heap
    • wasm: fix typo in wasm_exec.js, syscall/js.valueLoadString()
    • wasm: Namespaced Wasm Imports so they don't conflict across modules, or reserved LLVM IR
    • wasi: support env variables based on libc
    • wasi: specify wasi-libc in a different way, to improve error message
  • boards
    • matrixportal-m4: add support for board Adafruit Matrix Portal M4
    • mkr1000: add this board
    • nucleo-f722ze: add this board
    • clue: correct volume name and add alias for release version of Adafruit Clue board
    • p1am-100: add support for the P1AM-100 (similar to Arduino MKR)
    • microbit-v2: add initial support based on work done by @alankrantas thank you!
    • lgt92: support for STM32L0 MCUs and Dragino LGT92 device
    • nicenano: nice!nano board support
    • circuitplay-bluefruit: correct internal I2C pin mapping
    • clue: correct for lack of low frequency crystal
    • digispark: split off attiny85 target
    • nucleo-l552ze: implementation with CLOCK, LED, and UART
    • nrf52840-mdk-usb-dongle: add this board

0.16.0

18 Nov 12:39
Compare
Choose a tag to compare

This is the next release of TinyGo, this time featuring the addition of the Teensy 4.0 and the addition of initial WASI support, apart from numerous fixes and improvements (such as improved tinygo test support). See the full changelog below.

  • command-line
    • add initial support for LLVM 11
    • make lib64 clang include path check more robust
    • build: improve support for GOARCH=386 and add tests
    • gdb: add support for qemu-user targets
    • test: support non-host tests
    • test: add support for -c and -o flags
    • test: implement some benchmark stubs
  • compiler
    • builder: improve detection of clang on Fedora
    • compiler: fix floating point comparison bugs
    • compiler: implement negate for complex numbers
    • loader: fix linkname in test binaries
    • transform: add missing return pointer restore for regular coroutine tail calls
  • standard library
    • machine: switch default frequency to 4MHz
    • machine: clarify caller's responsibility in SetInterrupt
    • os: add LookupEnv() stub
    • reflect: implement Swapper
    • runtime: fix UTF-8 decoding
    • runtime: gc: use raw stack access whenever possible
    • runtime: use dedicated printfloat32
    • runtime: allow ranging over a nil map
    • runtime: avoid device/nxp dependency in HardFault handler
    • testing: implement dummy Helper method
    • testing: add Run method
  • targets
    • arm64: add support for SVCall intrinsic
    • atsamd51: avoid panic when configuring SPI with SDI=NoPin
    • avr: properly support the .rodata section
    • esp8266: implement Pin.Get function
    • nintendoswitch: fix crash when printing long lines (> 120)
    • nintendoswitch: add env parser and removed unused stuff
    • nrf: add I2C error checking
    • nrf: give more flexibility in picking SPI speeds
    • nrf: fix nrf52832 flash size
    • stm32f103: support wakeups from interrupts
    • stm32f405: add SPI support
    • stm32f405: add I2C support
    • wasi: add support for this target
    • wasi: use 'generic' ABI by default
    • wasi: remove --no-threads flag from wasm-ld
    • wasm: add instanceof support for WebAssembly
    • wasm: use fixed length buffer for putchar
  • boards
    • d1mini: add this ESP8266 based board
    • esp32: use board definitions instead of chip names
    • qtpy: add board definition for Adafruit QTPy
    • teensy40: add this board