The Goose programming language on ESP32, STM32 and Raspberry Pi Pico 2 W microcontrollers.
Unmodified Goose, compiled to native firmware, with hardware-guarded memory,
FreeRTOS threads, WiFi, MQTT, CAN and signed over-the-air updates.
Getting started · Tutorials · For engineering teams · Hardware API · Benchmarks · FAQ
You write ordinary Goose, the unmodified Goose compiler turns it into C, and MicroGoose builds that C into firmware for your board with its own toolchain: ESP-IDF on the ESP32s, STM32Cube and FreeRTOS on the STM32H7.
- Native speed. No interpreter and no garbage collector on the chip. Double-precision loops and multicore scaling run within 4% of hand-written C on the same boards, and compute benchmarks run 10 to 579 times faster than MicroPython 1.29.
- Memory known before you flash. Goose has no heap. The compiler counts the data stacks a program needs, and MicroGoose prints the total before it builds.
- Faults caught by hardware. Data stack overflows trap on the first store past the end (watchpoints on the ESP32s, MPU regions on the H7 and the Pico 2 W). A worker's out-of-bounds write ends that worker, not the device.
- Correct to the byte. Every stock Goose sample that fits a board prints exactly what it prints on a PC: 24 of 24 on the ESP32-S3, 21 of 21 on the ESP32 WROOM-32 and on the WROVER-E, 22 of 22 on the STM32H743, and 22 of 22 on the Raspberry Pi Pico 2 W.
- Peripherals and networking. GPIO, ADC, DAC, PWM, UART, I2C, SPI, CAN and interrupts on the ESP32s and the H7, and all but the DAC and CAN (which the RP2350 lacks) on the Pico 2 W; WiFi, HTTPS, MQTT, sockets, signed OTA updates, SSH and SFTP on the ESP32s.
- Verified on every change. CI builds every target and runs the samples on emulated chips (QEMU, Renode and picoem), diffed against the PC.
pip install microgoose
microgoose setupPython 3.10 or newer, on Windows, macOS or Linux. setup downloads the
Goose compiler v2026.5 from its official release, checks its SHA-256, and
checks that your shell finds the microgoose command.
- If your shell can't find
microgoose(on Windows,'microgoose' is not recognized): pip put it in a folder that is not onPATH, as it does with Python from the Microsoft Store. Runpython -m microgoose setup. It prints the line that fixes it, andpython -m microgooseworks in place ofmicrogoosemeanwhile. - If Windows blocks
microgoose.exe(An Application Control policy has blocked this file, from Smart App Control): typepython -m microgoosein its place. - If pip stops with
externally-managed-environment(recent Debian and Ubuntu, Homebrew): runpipx install microgoose, or install in a virtual environment.
Getting started has all three in full.
microgoose new hello
microgoose run hello/main.goose # ESP32-S3 (the default target)
microgoose run hello/main.goose --target esp32 # WROOM-32 / WROVER-E
microgoose run hello/main.goose --target h7 # STM32H743 over ST-Linknew writes a starter program that prints five ticks. run compiles it,
builds the firmware, flashes it, then shows the board's output until the
program exits. build stops after the firmware. The first build for a
board downloads and compiles its toolchain through PlatformIO, which takes
several minutes. Later builds take seconds.
microgoose new blinky --example blink starts from a bundled example
instead (this one drives the ESP32-S3 board's RGB LED).
New to microcontrollers, or to Goose? The tutorials go step by step from a traffic light to a knob that turns a servo, on a board or, with no board, in your browser.
--reserve 32K changes the size of each data stack (the default is 16K),
and --worker-reserve 4K gives the data stacks of thread_spawn workers
a size of their own. --worker-stack 4K does the same for a worker's
native stack, and --stack-report prints how much of each stack a run
used.
--data data/ gives the program files to read_file, and --stdin input.txt gives read_line its input. --port COM5 picks the serial
port when there is more than one. With no board, --emulate runs the same
firmware in an emulator of the chip, which you install: Espressif's QEMU
for the ESP32s, Renode for the H7, picoem, built from
source, for the Pico 2 W
(what each can run). To watch the pins as well,
microgoose velxio builds for Velxio, which runs an
ESP32 in the browser wired to LEDs, buttons, knobs and servos.
import mcu;
fn main() {
rgb_init(48);
for i: i32 in 10 {
rgb(if i % 2 == 0 { 32 } else { 0 }, 0, 0);
print("t=", millis(), " temp=", chip_temp_c());
delay_ms(250);
}
}import mcu; provides time, GPIO, interrupts, PWM, UART, I2C, SPI and CAN,
LED strips, the ADC and DAC, the chip temperature and system information.
Each function is a one-line extern fn bound directly to C, so adding a
peripheral, or one of your own C drivers, means one C function plus one
line of Goose.
On the ESP32s, import net; adds WiFi, .local names, NTP time, an HTTP
and HTTPS client, an HTTP server the program answers itself, MQTT, and TCP
and UDP sockets. Save your network once with microgoose wifi YOUR-SSID;
after one USB flash, microgoose run main.goose --ota sends signed updates
over WiFi and shows the board's output from there. microgoose ssh logs in
to the board (a small shell: ls, cat, log, info, restart) and
microgoose sftp moves files in and out of it, with a key the PC makes for
itself. Files a program or SFTP writes under flash/ survive resets and new
firmware.
| Board | Core | Samples that match the PC | Overflow guard | Threads |
|---|---|---|---|---|
| ESP32-S3 | 2× Xtensa LX7, 240 MHz, 8 MB PSRAM | 24 / 24 | hardware watchpoints | both cores |
| ESP32 WROOM-32 | 2× Xtensa LX6, 240 MHz | 21 / 21 | hardware watchpoints | both cores |
| ESP32 WROVER-E | 2× Xtensa LX6, 240 MHz, PSRAM | 21 / 21 | hardware watchpoints | both cores |
| STM32H743 | Cortex-M7, 400 MHz, FPU | 22 / 22 | MPU regions | one core, FreeRTOS |
| Raspberry Pi Pico 2 W (early port) | Cortex-M33, 150 MHz, FPU | 22 / 22 | MPU regions | one core, FreeRTOS |
Any 32-bit MCU with about 64 KB of flash and 64 KB of RAM is a candidate for a port. See Boards.
MicroGoose is benchmarked against optimized C, Rust (Embassy), TinyGo and MicroPython on the same boards, and every result is published, losses included. Goose's time divided by C's (lower is better):
| Benchmark | ESP32-S3 | ESP32 WROOM-32 | ESP32 WROVER-E | STM32H743 (vs C with FPU) | Pico 2 W |
|---|---|---|---|---|---|
Mandelbrot, f64 |
1.00 | 1.00 | 1.00 | 1.04 | 1.02 |
| CRC-32 | 0.90 | 0.89 | 0.89 | 0.69 | 1.17 |
| Typed queue, 2,000 messages | 0.81 | 0.61 | 0.63 | 1.35 | 0.87 |
Matrix multiply, f32 |
1.31 | 1.37 | 1.37 | 1.01 | 1.12 |
| Heapsort | 1.93 | 1.94 | 1.92 | 2.12 | 1.52 |
Methodology, raw data and every optimization's measured effect are at microgoose.dev/benchmarks, and the benchmark report sums them up: before, after, against the other languages, and what is left.
app.goose ──goose -o──▶ app.c ──┐
lib/mcu.goose (extern fns) ├─ fixes ─▶ PlatformIO ─▶ firmware
goose --emit-runtime ─▶ runtime ┘ │
port: POSIX shim, HAL, main
Goose has no heap: dynamic data lives on bump-pointer data stacks. MicroGoose sizes those stacks to fit SRAM. It guards the end of each one with whatever the chip has: hardware watchpoints on the ESP32s, MPU regions on the STM32. It also applies two source fixes, one for Goose's 64-bit struct layout and one for an Xtensa GCC calling-convention bug this project found. Details: How it works.
MicroGoose is alpha software (0.2). The pipeline, the boards above, the overflow guards and the documented APIs are tested on hardware and in CI. It has no safety certification, and APIs may change before 1.0. For engineering teams sets out what is ready, what is not, and how to evaluate it in a day.
Everything is at microgoose.dev:
- Getting started and Tutorials
- For engineering teams: readiness, verification, supply chain, licensing
- Boards, Hardware API, Networking
- How it works and Feasibility findings
- Benchmarks
- Security, FAQ, Changelog
git clone https://github.com/voodoomods/microgoose
cd microgoose
python -m pip install -e . -r requirements-dev.txt
python -m microgoose run examples/hello.goose # builds in the checkout
python -m pytest
python -m ruff check .
python -m mkdocs serve # the documentation site, locallymain only takes changes through pull requests that pass CI. CI runs lint,
unit tests, a 32-bit host conformance run, firmware builds for every target,
emulated conformance on every target, an install test of the built package,
and a strict docs build. See
Contributing. Report security
problems privately, as described in SECURITY.md.
MicroGoose's code is licensed under Apache-2.0 and is © 2026 VoodooMods. If you redistribute it, keep the NOTICE file.
Goose is a separate project by its own authors, and MicroGoose is not affiliated with it. MicroGoose downloads Goose; it does not redistribute it.
