Goxpyriment: A Go Framework for Behavioral and Cognitive Experiments
Christophe Pallier, Julie Bonnaire, Marie-France Fourcade
TLDR
Goxpyriment is a new Go framework for behavioral and cognitive experiments, simplifying deployment with self-contained executables and ensuring precise timing.
Key contributions
- Generates single, self-contained Go executables for experiments, eliminating runtime dependencies and simplifying deployment.
- Achieves high timing reliability using OS-level timestamping for reactions and optional Go garbage collector disablement.
- Provides a human-friendly API with diverse visual stimuli (Gabor, motion clouds) and audio capabilities for experiment design.
Why it matters
This paper introduces Goxpyriment, a Go-based framework that addresses common deployment and timing issues in behavioral experiments. By compiling experiments into single executables and using precise OS-level timestamping, it significantly streamlines research workflows. This tool is crucial for researchers seeking more reliable and easily distributable experimental setups.
Original Abstract
We introduce `Goxpyriment', a new open-source software framework for programming behavioral and cognitive experiments using the Go programming language. The library is 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 programming interface, inspired by Expyriment (Krause & Lindemann, 2014), was designed to be human friendly. The library includes an array of visual stimuli (text, shapes, images, Gabor patches, motion clouds, ...) and audio capabilities (WAV playback and tone generation). While developing Goxpyriment, we focused on timing reliability. 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. 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 and is freely available at https://github.com/chrplr/goxpyriment.
📬 Weekly AI Paper Digest
Get the top 10 AI/ML arXiv papers from the week — summarized, scored, and delivered to your inbox every Monday.