goxpyriment¶
goxpyriment is a high-level Go framework for building behavioral and psychological experiments.
Features¶
- Zero-dependency deployment. Your experiments compile to standalone executables.
- Timing precision. The stimulus loop runs VSYNC-locked with GC pauses disabled, giving sub-millisecond frame jitter on typical hardware (VSYNC can be disabled to support Variable Refresh Rate monitors).
- AI-friendly API. The API is well suited to "vibe-coding": after cloning the repository, describe your paradigm in plain language to Claude, Gemini, or ChatGPT and try the generated code. Given the examples and the constraints afforded by the framework, the experiment is likely to work as expected (but must be checked, of course).
Documentation¶
| Document | ||
|---|---|---|
| Presentation | short paper | |
| Getting Started | Tutorials | ↓ |
| Gallery of Examples | Ready-to-run experiments and demos | |
| Installation | Install Go and build the examples | ↓ |
| User Manual | Core concepts explained in depth | ↓ |
| Migration Guide | Coming from Expyriment, PsychoPy, or Psychtoolbox? | ↓ |
| API Reference | Complete function and type reference | ↓ |
| Timing-Tests | Check the timing of your computer | ↓ |
Support:
- Google group — Forum
- Report bugs at https://github.com/chrplr/goxpyriment/issues
Note: If you are looking for a simpler, no-code experiment generator, check out Gostim2.
Quick Start¶
-
Download and install Go from https://go.dev (See Installing-a-development-environment.md if you are new to this).
-
Clone goxpriment and check that you can compile the examples, by executing the following commands in a Terminal (
Git Bashfor Windows):git clone https://github.com/chrplr/goxpyriment.git cd goxpyriment make examples -
Create a
hellofolder somewhere on your computer, and createmain.goinside it, containing the following code:package main import ( "github.com/chrplr/goxpyriment/control" "github.com/chrplr/goxpyriment/stimuli" ) func main() { exp := control.NewExperimentFromFlags("Hello World", control.Black, control.White, 32) defer exp.End() hello := stimuli.NewTextBox("Hello, World!", 600, control.FPoint{}, control.White) exp.Run(func() error { exp.Show(hello) exp.Keyboard.Wait() return control.EndLoop }) } -
Initialize dependencies in the
hellofolder: -
Run your program
Ready-to-run experiments¶
Pre-built binaries (ready-to run apps) of many experiments are available for Windows, macOS, and Linux.
Background¶
Goxpyriment relies on libsdl via the go-sdl3 bindings.
It was inspired by 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). The API should feel familiar to expyriment users.
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.