Skip to content

goxpyriment

Goxpyriment is a software framework for programming behavioral and cognitive experiments using the Go programming language. It was designed to address some limitations of existing Python-based experiment tools, particularly the runtime environment complexity that frequently complicates deployment across laboratories. Because Go is a compiled language that can natively embed assets (e.g., graphics, audio files, and stimulus lists), Goxpyriment compiles entire experiments into single, self-contained executable binaries with zero runtime dependencies. This drastically simplifies distribution to collaborators and testing computers. The library includes an array of visual stimuli (text, shapes, images, Gabor patches, motion clouds, ...) and audio capabilities (WAV playback and tone generation). A lot of effort was devoted to ensure timing reliability. For instance, input events are timestamped by the operating system at hardware-interrupt time, so reaction times are computed by subtracting two OS-level timestamps rather than relying on continuous polling. The framework also supports sending and receiving TTL signals to synchronize with various external equipment. Go's garbage collector can be disabled, greatly reducing the probability of unpredictable pauses that could corrupt stimulus timing. Finally, a set of over forty psychology experiments implemented in Goxpyriment are provided that promote not only learning by humans but also improve the ability of modern AI-assisted coding tools to help program experiments. The framework is released under the GNU General Public License v3.

Remark: If you are looking for a simple experiment generator - with fixed stimulus presentation schedule, check out Gostim2 which does not require any coding.


Documentation

The top navigation bar provides access to various documentation guides.

Start here — install and build your first experiment

  1. Install Go and build the bundled examples. [PDF]
  2. Creating Your Own Experiment — a step-by-step beginner guide from an empty folder to a shareable executable.
  3. Getting Started — worked tutorials: trials, data logging, RSVP streams, reaction times. [PDF]

User Manual — core concepts explained in depth: rendering model, timing, input, data, streams, audio, and experimental design. [PDF]

API Reference — complete function and type reference, organized by package. [PDF]

Misc — focused how-to guides: migrating from PsychoPy / Expyriment / Psychtoolbox, checking your computer's timing, video playback, packaging & sharing binaries, Linux tuning, and more, all found under the Misc tab in the navigation bar at the top of the page.

In addition, if you clone goxpyriment, you can run pkgsite from the root folder to view the source code documentation.


Browse the gallery of over forty example experiments and demos, or download pre-built binaries (ready-to-run apps) for Windows, macOS, and Linux.


Support


Background

The framework is described in a short paper: Goxpyriment: A Go Framework for Behavioral and Cognitive Experiments.

Goxpyriment is written in Go and relies on the SDL3 library through the go-sdl3 bindings.

The original inspiration was expyriment.org, a lightweight Python library for cognitive and neuroscientific experiments (Krause & Lindemann, 2014. Behavior Research Methods, 46(2), 416–428. https://doi.org/10.3758/s13428-013-0390-6).


License & citation

GNU GPL v3 — see LICENSE.

Please cite as:

Christophe Pallier (2026) chrplr/goxpyriment. Zenodo. https://doi.org/10.5281/zenodo.19200598

Christophe Pallier, 2026.