Goxpyriment: A Go Framework for Behavioral and Cognitive Experiments

arXiv:2604.15245 · q-bio.NC · Submitted 2026-04-16 · Read on arXiv

Listen

Radio episode about this paper

Transcript

Introduction to the show: ident: Genomics Radio. Generated commentary on the latest computational biology and genomics papers.

Ines: I'm Ines.

Marcus: And I'm Marcus, here with Yuki.

Ines: We're looking at the paper: "Goxpyriment: A Go Framework for Behavioral and Cognitive Experiments".

Paper summary: Ines: So, we're looking at the paper today about Goxpyriment: A Go Framework for Behavioral and Cognitive Experiments. We’re talking about what they claim this framework is designed to do.

Marcus: Basically, the thesis is that they are introducing a new open-source software framework built with the Go programming language specifically for programming behavioral and cognitive experiments.

Ines: They claim this framework addresses limitations of existing Python-based experiment tools, particularly around the complexity of runtime environment when you try to deploy them across different laboratories.

Yuki: It seems like they are focusing on making deployment simpler, which is a major pain point for researchers who need to run the same experiments consistently in various settings.

Ines: Right, and because Go is a compiled language, it can natively embed assets like graphics, audio files, and stimulus lists directly into the executable. This means the framework compiles entire experiments into single, self-contained binaries with zero runtime dependencies.

Marcus: That’s a big deal for distribution; instead of managing virtual environments or interpreter installations on each machine, you just copy one file to get it running anywhere.

Yuki: So it makes sharing materials and testing across different computers much more straightforward than what you might experience with Python setups.

Ines: Also, they claim the programming interface is designed to be human friendly, drawing inspiration from an existing framework called Expyriment.

Marcus: And on the technical side, they focused heavily on timing reliability during development because they wanted to address issues like unpredictable pause times that can corrupt the timing of stimulus presentation and response recording during a critical trial loop.

Yuki: They are tackling those timing issues directly, which is crucial for any experiment involving high-speed sequences or precise reaction time measurements.

Ines: And they also mention specific techniques to control memory management tasks, such as exposing a runtime API to suspend the garbage collector during timing-critical loops to ensure stimulus onsets and offsets are not delayed by memory management tasks.

Marcus: So they’ve put effort into making sure that the stimulus presentation timing is as accurate as possible, especially when dealing with dense sequences.

Yuki: And they also use specialized stream functions for those fast sequences, which disable garbage collection and busy-wait at the sub-frame level to make sure each stimulus onset is scheduled accurately.

Ines: So in short, the paper introduces a framework that emphasizes zero runtime dependencies through static linking and embedding assets directly into the binary.

Marcus: It’s about simplifying distribution so that researchers can focus more on the experiment design rather than infrastructure management when collaborating with others.

Conclusion: Ines: So, wrapping up our look at Goxpyriment: A Go Framework for Behavioral and Cognitive Experiments. The authors are Christophe Pallier, Julie Bonnaire, and Marie-France Fourcade from the Cognitive Neuroimaging Unit CNRS INSERM CEA.

Marcus: They essentially propose this Go framework as a way to make programming these kinds of experiments much more straightforward by solving the deployment headaches that come with current Python tools.

Yuki: In simple terms, it’s a tool designed to be self-contained so you don't have to worry about installing a whole environment every time you want to run an experiment.

Ines: Exactly. It’s about making the process of taking an experiment from design to running it on multiple machines much more accessible by removing that environmental complexity for collaborators.

Marcus: The implications are that researchers can focus more on the actual

Cognitive Neuroimaging Unit CNRS INSERM CEA

q-bio.NC

Submitted: 2026-04-16

Updated: 2026-11-25

Comments: 8 pages, 2 figures, 2 tables

Code: https://github.com/chrplr/goxpyriment

Project page: https://chrplr.github.io/goxpyriment

License: http://creativecommons.org/licenses/by-sa/4.0/

Importance score: 89/100

The gist: Goxpyriment introduces goxpyriment, a new open-source software framework for programming behavioral and cognitive experiments using the Go programming language.<ref:2604.15245#pg1…

Key concepts

Experiment Object
This central object manages all aspects of an experiment, including the window display, how visuals are rendered, and audio subsystems. It acts as the main container for setting up and running a single experimental setup.
Single-Binary Deployment
Go compiles the entire program into one executable file that has no external runtime dependencies. The necessary SDL3 libraries are embedded directly into this file, meaning users only need to copy one file to run experiments on any lab computer without managing virtual environments.
High-Precision Streams
For fast stimulus sequences like retinotopic stimulation, specialized functions ensure accurate timing. These functions disable garbage collection and busy-wait at the sub-frame level to guarantee that every stimulus starts exactly when scheduled.
OS-Level Response Timestamps
The framework uses SDL3 OS events to capture response times with high accuracy. By comparing the response time against screen flip timestamps, researchers can measure reaction times with minimal jitter and no overhead.

Terminology

Summary

Goxpyriment introduces goxpyriment, a new open-source software framework for programming behavioral and cognitive experiments using the Go programming language. p. 0

Where the paper says it

Goxpyriment: A Go Framework for Behavioral and Cognitive Experiments Christophe Pallier, Julie Bonnaire, and Marie-France Fourcade Cognitive Neuroimaging Unit CNRS INSERM CEA 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.

<ref:2604.15245#pg1, a new open-source software framework for programming behavioral and cognitive experiments using the Go programming language>. p. 0
Where the paper says it

Goxpyriment: A Go Framework for Behavioral and Cognitive Experiments Christophe Pallier, Julie Bonnaire, and Marie-France Fourcade Cognitive Neuroimaging Unit CNRS INSERM CEA 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.

This framework addresses limitations of existing Python-based experiment tools by focusing on runtime environment complexity, deployment simplicity, and timing reliability. p. 0
Where the paper says it

Goxpyriment: A Go Framework for Behavioral and Cognitive Experiments Christophe Pallier, Julie Bonnaire, and Marie-France Fourcade Cognitive Neuroimaging Unit CNRS INSERM CEA 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.

<ref:2604.15245#pg1, 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>. p. 0
Where the paper says it

Goxpyriment: A Go Framework for Behavioral and Cognitive Experiments Christophe Pallier, Julie Bonnaire, and Marie-France Fourcade Cognitive Neuroimaging Unit CNRS INSERM CEA 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.

Framework Design

Every experiment centers on an Experiment object that manages the window, renderer, and audio subsystems.<ref:2604.15245#pg2, Every experiment centers on an Experiment object that manages the window, renderer, and audio subsystems>. p. 1

Where the paper says it

Specifically, we highlight three main contributions of this framework: (1) zero-dependency deployment via single compiled binaries that simplify distribution across laboratory hardware; (2) native high-precision timing achieved directly through the Go and SDL3 APIs without requiring external C/C++ helper engines; and (3) a linear, straightforward API that is well suited for modern AI-assisted coding workflows. Framework Design Programming Model Every experiment centers on an Experiment object that manages the window, renderer, and audio subsystems.

Execution is wrapped in a Run callback that provides a safety layer: if the participant presses the Escape key or closes the window, the library catches the resulting internal signal, safely flushes the data file to disk, and shuts down the SDL subsystems. p. 1
Where the paper says it

Framework Design Programming Model Every experiment centers on an Experiment object that manages the window, renderer, and audio subsystems. Execution is wrapped in a Run callback that provides a safety layer: if the participant presses the Escape key or closes the window, the library catches the resulting internal signal, safely flushes the data file to disk, and shuts down the SDL subsystems.

<ref:2604.15245#pg2, Execution is wrapped in a Run callback that provides a safety layer: if the participant presses the Escape key or closes the window, the library catches the resulting internal signal, safely flushes the data file to disk, and shuts down the SDL subsystems>. p. 1
Where the paper says it

Framework Design Programming Model Every experiment centers on an Experiment object that manages the window, renderer, and audio subsystems. Execution is wrapped in a Run callback that provides a safety layer: if the participant presses the Escape key or closes the window, the library catches the resulting internal signal, safely flushes the data file to disk, and shuts down the SDL subsystems.

It is possible, but not necessary, to build the experiment around a hierarchical structure of blocks and trials. p. 1
Where the paper says it

This ensures that data is preserved even if a session is aborted prematurely. It is possible, but not necessary, to build the experiment around a hierarchical structure of blocks and trials, over which the program can iterate, following a patten inspired by Expyriment (Krause & Lindemann, 2014).

<ref:2604.15245#pg2, It is possible, but not necessary, to build the experiment around a hierarchical structure of blocks and trials>. p. 1
Where the paper says it

This ensures that data is preserved even if a session is aborted prematurely. It is possible, but not necessary, to build the experiment around a hierarchical structure of blocks and trials, over which the program can iterate, following a patten inspired by Expyriment (Krause & Lindemann, 2014).

Data collection is handled by an exp. p. 1
Where the paper says it

Each trial is a collection of factors that can be randomized and logged. Data collection is handled by an exp.

Data object, which writes to a CSV file withal metadata headers providing extensive information about the computer OS and hardware. p. 1
Where the paper says it

Data collection is handled by an exp. Data object, which writes to a CSV file withal metadata headers providing extensive information about the computer OS and hardware, A.

<ref:2604.15245#pg2, Data collection is handled by an exp. p. 1
Where the paper says it

Each trial is a collection of factors that can be randomized and logged. Data collection is handled by an exp.

Data object, which writes to a CSV file withal metadata headers providing extensive information about the computer OS and hardware>. p. 1
Where the paper says it

Data collection is handled by an exp. Data object, which writes to a CSV file withal metadata headers providing extensive information about the computer OS and hardware, A.

Single-Binary Deployment (Zero Dependencies)

Go compiles programs into a single statically linked executable with no external runtime dependencies.<ref:2604.15245#pg3, Go compiles programs into a single statically linked executable with no external runtime dependencies>. p. 2

Where the paper says it

LET’S GO EXPERIMENT! 3 Single-Binary Deployment (Zero Dependencies) Go compiles programs into a single statically linked executable with no external runtime dependencies.

Crucially, the go-sdl3 package embeds the pre-built SDL3 runtime libraries (SDL Developers, 2026) directly into the executable so that the user do not need to install any library by herself. p. 2
Where the paper says it

3 Single-Binary Deployment (Zero Dependencies) Go compiles programs into a single statically linked executable with no external runtime dependencies. Crucially, the go-sdl3 package embeds the pre-built SDL3 runtime libraries (SDL Developers, 2026) directly into the executable so that the user do not need to install any library by herself.

<ref:2604.15245#pg3, Crucially, the go-sdl3 package embeds the pre-built SDL3 runtime libraries (SDL Developers, 2026) directly into the executable so that the user do not need to install any library by herself>. p. 2
Where the paper says it

3 Single-Binary Deployment (Zero Dependencies) Go compiles programs into a single statically linked executable with no external runtime dependencies. Crucially, the go-sdl3 package embeds the pre-built SDL3 runtime libraries (SDL Developers, 2026) directly into the executable so that the user do not need to install any library by herself.

In addition, the stimuli, experimental lists, fonts, and other assets can be embedded in the binary too. p. 2
Where the paper says it

Crucially, the go-sdl3 package embeds the pre-built SDL3 runtime libraries (SDL Developers, 2026) directly into the executable so that the user do not need to install any library by herself. In addition, the stimuli, experimental lists, fonts, and other assets can be embedded in the binary too.

<ref:2604.15245#pg3, In addition, the stimuli, experimental lists, fonts, and other assets can be embedded in the binary too>. p. 2
Where the paper says it

Crucially, the go-sdl3 package embeds the pre-built SDL3 runtime libraries (SDL Developers, 2026) directly into the executable so that the user do not need to install any library by herself. In addition, the stimuli, experimental lists, fonts, and other assets can be embedded in the binary too.

As a result of this approach to distribution requires copying just one file; there is no need to manage virtual environments, package versions, or interpreter installations across laboratory computers. p. 2
Where the paper says it

In addition, the stimuli, experimental lists, fonts, and other assets can be embedded in the binary too. As a result, distributing an experiment requires copying just one file; there is no need to manage virtual environments, package versions, or interpreter installations across laboratory computers.

<ref:2604.15245#pg3, As a result of this approach to distribution requires copying just one file; there is no need to manage virtual environments, package versions, or interpreter installations across laboratory computers>. p. 2
Where the paper says it

In addition, the stimuli, experimental lists, fonts, and other assets can be embedded in the binary too. As a result, distributing an experiment requires copying just one file; there is no need to manage virtual environments, package versions, or interpreter installations across laboratory computers.

Hardware-Synchronized Presentation

Through go-sdl3 (Jung, 2026), goxpyriment relies on the Simple DirectMedia Layer (SDL, version 3), a crossplatform development library designed to provide lowlevel access to audio, keyboard, mouse, joystick, and graphics hardware.<ref:2604.15245#pg3, Through go-sdl3 (Jung, 2026), goxpyriment relies on the Simple DirectMedia Layer (SDL, version 3), a crossplatform development library designed to provide lowlevel access to audio, keyboard, mouse, joystick, and graphics hardware>. p. 2

Where the paper says it

goxpyriment uses this mechanism in its timing-critical loops, ensuring that stimulus onsets and offsets are not delayed by memory management tasks. Hardware-Synchronized Presentation Through go-sdl3 (Jung, 2026), goxpyriment relies on the Simple DirectMedia Layer (SDL, version 3), a crossplatform development library designed to provide lowlevel access to audio, keyboard, mouse, joystick, and graphics hardware (SDL Developers, 2026).

For example screen. p. 2
Where the paper says it

Hardware-Synchronized Presentation Through go-sdl3 (Jung, 2026), goxpyriment relies on the Simple DirectMedia Layer (SDL, version 3), a crossplatform development library designed to provide lowlevel access to audio, keyboard, mouse, joystick, and graphics hardware (SDL Developers, 2026). For example, screen.

Update calls SDL’s SDL RenderPresent. p. 2
Where the paper says it

For example, screen. Update() calls SDL’s SDL_RenderPresent.

<ref:2604.15245#pg3, For example screen. p. 2
Where the paper says it

Hardware-Synchronized Presentation Through go-sdl3 (Jung, 2026), goxpyriment relies on the Simple DirectMedia Layer (SDL, version 3), a crossplatform development library designed to provide lowlevel access to audio, keyboard, mouse, joystick, and graphics hardware (SDL Developers, 2026). For example, screen.

Update calls SDL’s SDL_RenderPresent>. p. 2
Where the paper says it

For example, screen. Update() calls SDL’s SDL_RenderPresent.

When VSYNC is enabled this function blocks until the display’s vertical retrace. p. 2
Where the paper says it

Update() calls SDL’s SDL_RenderPresent. When VSYNC is enabled, this function blocks until the display’s vertical retrace.

<ref:2604.15245#pg3, When VSYNC is enabled this function blocks until the display’s vertical retrace>. p. 2
Where the paper says it

Update() calls SDL’s SDL_RenderPresent. When VSYNC is enabled, this function blocks until the display’s vertical retrace.

High-Precision Streams

For paradigms with dense, high-speed stimulus sequences such as retinotopic stimulation goxpyriment provides specialized stream functions such as PresentStreamOfImages.<ref:2604.15245#pg3, For paradigms with dense, high-speed stimulus sequences (e. p. 2

Where the paper says it

When VSYNC is disabled, SDL_RenderPresent returns immediately, supporting variable refresh rate (VRR) monitors. High-Precision Streams For paradigms with dense, high-speed stimulus sequences (e.

g., retinotopic stimulation), goxpyriment provides specialized stream functions such as PresentStreamOfImages>. p. 2
Where the paper says it

High-Precision Streams For paradigms with dense, high-speed stimulus sequences (e. , retinotopic stimulation), goxpyriment provides specialized stream functions such as PresentStreamOfImages.

These functions disable garbage collection, drain the event queue, and busy-wait at the sub-frame level to ensure that each stimulus onset is scheduled accurately. p. 2
Where the paper says it

, retinotopic stimulation), goxpyriment provides specialized stream functions such as PresentStreamOfImages. These functions disable garbage collection, drain the event queue, and busy-wait at the sub-frame level to ensure that each stimulus onset is scheduled accurately.

<ref:2604.15245#pg3, These functions disable garbage collection, drain the event queue, and busy-wait at the sub-frame level to ensure that each stimulus onset is scheduled accurately>. p. 2
Where the paper says it

, retinotopic stimulation), goxpyriment provides specialized stream functions such as PresentStreamOfImages. These functions disable garbage collection, drain the event queue, and busy-wait at the sub-frame level to ensure that each stimulus onset is scheduled accurately.

A TimingLog records the target and actual onsets for post-hoc verification as well as the timing of keys pressed during the presentation of the stream. p. 2
Where the paper says it

These functions disable garbage collection, drain the event queue, and busy-wait at the sub-frame level to ensure that each stimulus onset is scheduled accurately. A TimingLog records the target and actual onsets for post-hoc verification, as well as the timing of keys pressed during the presentation of the stream.

<ref:2604.15245#pg3, A TimingLog records the target and actual onsets for post-hoc verification, as well as the timing of keys pressed during the presentation of the stream>. p. 2
Where the paper says it

These functions disable garbage collection, drain the event queue, and busy-wait at the sub-frame level to ensure that each stimulus onset is scheduled accurately. A TimingLog records the target and actual onsets for post-hoc verification, as well as the timing of keys pressed during the presentation of the stream.

OS-Level Response Timestamps

Response timing in goxpyriment leverages SDL3 OSlevel event timestamps.<ref:2604.15245#pg3, Response timing in goxpyriment leverages SDL3 OSlevel event timestamps>. p. 2

Where the paper says it

A TimingLog records the target and actual onsets for post-hoc verification, as well as the timing of keys pressed during the presentation of the stream. OS-Level Response Timestamps Response timing in goxpyriment leverages SDL3 OSlevel event timestamps.

The GetKeyEventTS method returns the KeyboardEvent. p. 2
Where the paper says it

OS-Level Response Timestamps Response timing in goxpyriment leverages SDL3 OSlevel event timestamps. The GetKeyEventTS method returns the KeyboardEvent.

Timestamp field which is populated by the OS input subsystem at hardware-interrupt time (nanoseconds since SDL initialization). p. 2
Where the paper says it

The GetKeyEventTS method returns the KeyboardEvent. Timestamp field, which is populated by the OS input subsystem at hardware-interrupt time (nanoseconds since SDL initialization).

<ref:2604.15245#pg3, The GetKeyEventTS method returns the KeyboardEvent. p. 2
Where the paper says it

OS-Level Response Timestamps Response timing in goxpyriment leverages SDL3 OSlevel event timestamps. The GetKeyEventTS method returns the KeyboardEvent.

Timestamp field, which is populated by the OS input subsystem at hardware-interrupt time (nanoseconds since SDL initialization). p. 2
Where the paper says it

The GetKeyEventTS method returns the KeyboardEvent. Timestamp field, which is populated by the OS input subsystem at hardware-interrupt time (nanoseconds since SDL initialization).

Because SDL events carry their timestamp in the event structure itself, the event remains in the queue with its original timestamp regardless of how much computation occurs between stimulus onset and response collection> <ref:2604. p. 2
Where the paper says it

Timestamp field, which is populated by the OS input subsystem at hardware-interrupt time (nanoseconds since SDL initialization). Because SDL events carry their timestamp in the event structure itself, the event remains in the queue with its original timestamp regardless of how much computation occurs between stimulus onset and response collection.

15245#pg3, Because SDL events carry their timestamp in the event structure itself, the event remains in the queue with its original timestamp regardless of how much computation occurs between stimulus onset and response collection>. p. 2
Where the paper says it

Timestamp field, which is populated by the OS input subsystem at hardware-interrupt time (nanoseconds since SDL initialization). Because SDL events carry their timestamp in the event structure itself, the event remains in the queue with its original timestamp regardless of how much computation occurs between stimulus onset and response collection.

By comparing the response timestamp with the Screen. p. 2
Where the paper says it

Because SDL events carry their timestamp in the event structure itself, the event remains in the queue with its original timestamp regardless of how much computation occurs between stimulus onset and response collection. By comparing the response timestamp with the Screen.

FlipTS timestamp which uses the same clock reaction times can be measured with minimal jitter and no interpreter overhead. p. 2
Where the paper says it

By comparing the response timestamp with the Screen. FlipTS() timestamp—which uses the same clock—reaction times can be measured with minimal jitter and no interpreter overhead (of course, potential hardware level lags at the level of the keyboard or mouse can still be present).

<ref:2604.15245#pg3, By comparing the response timestamp with the Screen. p. 2
Where the paper says it

Because SDL events carry their timestamp in the event structure itself, the event remains in the queue with its original timestamp regardless of how much computation occurs between stimulus onset and response collection. By comparing the response timestamp with the Screen.

FlipTS timestamp which uses the same clock reaction times can be measured with minimal jitter and no interpreter overhead>. p. 2
Where the paper says it

By comparing the response timestamp with the Screen. FlipTS() timestamp—which uses the same clock—reaction times can be measured with minimal jitter and no interpreter overhead (of course, potential hardware level lags at the level of the keyboard or mouse can still be present).

AI-Assisted Coding

Go’s design emphasizes simplicity and predictability.<ref:2604.15245#pg4, Go’s design emphasizes simplicity and predictability>. p. 3

Where the paper says it

A special folder in the goxpyriment github repository (performance-reports) is dedicated for users to share the results of timing tests. AI-Assisted Coding An AI-Friendly framework Go’s design emphasizes simplicity and predictability.

Because the language has few synonymous constructs it is particularly well-suited for use with AI-powered coding assistants for example Claude Code or Gemini cli. p. 3
Where the paper says it

AI-Assisted Coding An AI-Friendly framework Go’s design emphasizes simplicity and predictability. Because the language has few synonymous constructs, it is particularly well-suited for use with AI-powered coding assistants, for example Claude Code or Gemini cli.

<ref:2604.15245#pg4, Because the language has few synonymous constructs, it is particularly well-suited for use with AI-powered coding assistants, for example Claude Code or Gemini cli>. p. 3
Where the paper says it

AI-Assisted Coding An AI-Friendly framework Go’s design emphasizes simplicity and predictability. Because the language has few synonymous constructs, it is particularly well-suited for use with AI-powered coding assistants, for example Claude Code or Gemini cli.

Type Safety in Go means that errors like misspelled method names or invalid argument types only surface at runtime in dynamic languages but Go’s compiler catches these during the first build attempt. p. 3
Where the paper says it

Unlike dynamic languages where errors like misspelled method names or invalid argument types (e. , supplying a string “red” where a RGB color value is expected) only surface at runtime, Go’s compiler catches these during the first build attempt.

<ref:2604.15245#pg4, Type Safety. p. 3
Where the paper says it

Because the language has few synonymous constructs, it is particularly well-suited for use with AI-powered coding assistants, for example Claude Code or Gemini cli. The framework’s AI-friendliness also comes from other primary technical merits: Type Safety.

Unlike dynamic languages where errors like misspelled method names or invalid argument types (e. p. 3
Where the paper says it

The framework’s AI-friendliness also comes from other primary technical merits: Type Safety. Unlike dynamic languages where errors like misspelled method names or invalid argument types (e.

g., supplying a string “red” where a RGB color value is expected) only surface at runtime, Go’s compiler catches these during the first build attempt>. p. 3
Where the paper says it

Unlike dynamic languages where errors like misspelled method names or invalid argument types (e. , supplying a string “red” where a RGB color value is expected) only surface at runtime, Go’s compiler catches these during the first build attempt.

Linear Control Flow in goxpyriment means that the exp. p. 3
Where the paper says it

The strict typing reduces erroneous API calls in AI-generated code. Linear Control Flow.

Run wrapper handles the event loop and automatic cleanup internally simplifying the work of both the human and AI coder. p. 3
Where the paper says it

In goxpyriment, the exp. Run wrapper handles the event loop and automatic cleanup internally, simplfting the work of both the human and AI coder.

<ref:2604.15245#pg4, Linear Control Flow. p. 3
Where the paper says it

The strict typing reduces erroneous API calls in AI-generated code. Linear Control Flow.

In some other frameworks, the programmer must manage an explicit event loop (e. p. 3
Where the paper says it

Linear Control Flow. In some other frameworks, the programmer must manage an explicit event loop (e.

g., while True), manually polling for events and checking for exit signals>. p. 3
Where the paper says it

In some other frameworks, the programmer must manage an explicit event loop (e. , while True), manually polling for events and checking for exit signals.

Asset Embedding is handled using Go’s //go:embed directive which allows an AI to generate code that bundles assets directly into the binary eliminating path errors caused by mismatched directory structures. p. 3
Where the paper says it

Asset Embedding: A frequent failure point for AIgenerated experiments is incorrect file paths for stimuli. Using Go’s //go:embed directive, an AI can generate code that bundles assets directly into the binary, eliminating path errors caused by mismatched directory structures.

<ref:2604.15245#pg4, Asset Embedding: A frequent failure point for AIgenerated experiments is incorrect file paths for stimuli>. p. 3
Where the paper says it

Run wrapper handles the event loop and automatic cleanup internally, simplfting the work of both the human and AI coder. Asset Embedding: A frequent failure point for AIgenerated experiments is incorrect file paths for stimuli.

Comparison with Existing Tools

goxpyriment resembles Expyriment in its API design a central experiment object a present-based stimulus API a structured trial-loop model and output to.csv-format files with metadata. p. 4

Where the paper says it

goxpyriment resembles Expyriment in its API design: a central experiment object, a present()-based stimulus API, a structured trial-loop model, and output to . csv-format files with metadata.

<ref:2604.15245#pg6>. The primary technical differences are the use of Go rather than Python and the use of SDL3 rather than the older Pygame/SDL2 stack. p. 4
Where the paper says it

The code for a simple experiment (Parity Decision) is provided in Appendix (Listing 1). The primary technical differences are the use of Go rather than Python and the use of SDL3 rather than the older Pygame/SDL2 stack.

<ref:2604.15245#pg6>.

Limitations and Future Directions

Video playback functions currently do not expose frame-accurate timestamps or hardware trigger outputs.<ref:2604.15245#pg7>. Eye-tracker support is not present for the moment this is a target for future releases. p. 4

Where the paper says it

Eye-tracker support. There is none for the moment.

<ref:2604.15245#pg7>. Audio and Video recording currently lack support nor videos as SDL3 supports recording audio and vido these features could be implemented in the future. p. 4
Where the paper says it

There is currently no support for recording audio responses and measuring naming times, nor videos. As SDL3 supports recording audio and vido, these features could be implemented in the future.

<ref:2604.15245#pg7>. Online deployment does not currently support web-based deployment in theory this should be possible as Go can compile to web assembly (wasm) and SDL3 supports EMSCRIPTEN. p. 4
Where the paper says it

goxpyriment does not currently support web-based deployment. In theory, this should be possible as Go can compile to web assembly (wasm) and SDL3 supports EMSCRIPTEN (https://emscripten.

<ref:2604.15245#pg7>. Language barrier requires researchers unfamiliar with Go that is the vast majority to invest a bit of time in getting acquainted with the language. p. 4
Where the paper says it

Language barrier. Researchers who are unfamiliar with Go, that is, the vast majority, will need to invest a bit of time in getting acquainted with the language.

<ref:2604.15245#pg7>. The name “goxpyriment” is quite hard to pronounce and memorize. p. 4
Where the paper says it

Name of the project. The name “goxpyriment” is quite hard to pronounce and memorize.

<ref:2604.15245#pg7>.

Author Contributions

Christophe Pallier takes full responsibility for all content.<ref:2604.15245#pg8>. Julie Bonnaire and Marie-France Fourcade helped set up the timing measurment system and performed tests. p. 4

Where the paper says it

Christophe Pallier takes full responsibility for all content. Julie Bonnaire and Marie-France Fourcade helped set up the timing measurment system and performed tests.

<ref:2604.15245#pg8>. Claude Sonnet 4. p. 4
Where the paper says it

The name “goxpyriment” is quite hard to pronounce and memorize. Author Contributions Christophe Pallier: Conceptualization, Software implementation, Documentation and Paper Writing, with assistance from Claude Sonnet 4.

6 and Gemini 2. p. 3
Where the paper says it

AI-Assisted Coding An AI-Friendly framework Go’s design emphasizes simplicity and predictability. Because the language has few synonymous constructs, it is particularly well-suited for use with AI-powered coding assistants, for example Claude Code or Gemini cli.

5 are listed under Author Contributions rather than as a named author because authorship requires the capacity to take accountability for the work. p. 4
Where the paper says it

6 and Gemini 2. Consistent with current editorial norms (Nature Portfolio, 2023; Springer Nature, 2023), Claude and Gemini are listed under Author Contributions rather than as a named author, because authorship requires the capacity to take accountability for the work.

<ref:2604.15245#pg8>.

Open Practices Statement

The source code of goxpyriment is available under the GNU General Public License v3 at https://github.com/chrplr/goxpyriment. p. 0

Where the paper says it

The framework is released under the GNU General Public License v3 and is freely available at https://github. com/chrplr/goxpyriment.

<ref:2604.15245#pg8>. All example experiments described in this article are included in the repository. p. 4
Where the paper says it

com/chr plr/goxpyriment. All example experiments described in this article are included in the repository.

<ref:2604.15245#pg8>. No empirical data are reported in this article. p. 4
Where the paper says it

All example experiments described in this article are included in the repository. No empirical data are reported in this article.

<ref:2604.15245#pg8>.

References

Krause and Lindemann, 2014.<ref:2604.15245#pg6>. Peirce et al. p. 0

Where the paper says it

Keywords: framework, library, stimulus presentation, timing, behavioral experiments, psychophysics, psychology Introduction Experiment-control software occupies a central position in behavioral and cognitive neuroscience: the temporal precision of stimulus delivery and response recording, the ergonomics of experiment programming, and the ease of deploying experiments to laboratory hardware each affect the quality and reproducibility of empirical data. Over the past two decades, Python has become the dominant language for experiment programming, primarily through two libraries: Expyriment (Krause & Lindemann, 2014) and PsychoPy (Peirce et al.

p. 0
Where the paper says it

Keywords: framework, library, stimulus presentation, timing, behavioral experiments, psychophysics, psychology Introduction Experiment-control software occupies a central position in behavioral and cognitive neuroscience: the temporal precision of stimulus delivery and response recording, the ergonomics of experiment programming, and the ease of deploying experiments to laboratory hardware each affect the quality and reproducibility of empirical data. Over the past two decades, Python has become the dominant language for experiment programming, primarily through two libraries: Expyriment (Krause & Lindemann, 2014) and PsychoPy (Peirce et al.

, 2019.<ref:2604.15245#pg7>. Brainard, 1997. p. 0
Where the paper says it

Over the past two decades, Python has become the dominant language for experiment programming, primarily through two libraries: Expyriment (Krause & Lindemann, 2014) and PsychoPy (Peirce et al. Before Python, MATLAB with the Psychophysics Toolbox (Brainard, 1997; Kleiner et al. p. 0

Where the paper says it

Over the past two decades, Python has become the dominant language for experiment programming, primarily through two libraries: Expyriment (Krause & Lindemann, 2014) and PsychoPy (Peirce et al. Before Python, MATLAB with the Psychophysics Toolbox (Brainard, 1997; Kleiner et al.

<ref:2604.15245#pg7>. de Leeuw et al. p. 0
Where the paper says it

, 2007) was the de facto standard in many laboratories. More recently, web-based frameworks such as jsPsych (de Leeuw, 2015; de Leeuw et al.

, 2023.<ref:2604.15245#pg8>. Henninger et al. p. 0
Where the paper says it

, 2023) and lab. js (Henninger et al.

, 2022.<ref:2604.15245#pg7>. Kleiner et al., 2007.<ref:2604.15245#pg7>. Pallier, C. p. 0
Where the paper says it

Goxpyriment: A Go Framework for Behavioral and Cognitive Experiments Christophe Pallier, Julie Bonnaire, and Marie-France Fourcade Cognitive Neuroimaging Unit CNRS INSERM CEA 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.

(2025) [computer software]. p. 5
Where the paper says it

(2025, February). Bbtkv3 [computer software].

p. 5
Where the paper says it

(2025, February). Bbtkv3 [computer software].

p. 5
Where the paper says it

(2025, February). Bbtkv3 [computer software].

<ref:2604.15245#pg8, Pallier, C. p. 0
Where the paper says it

Goxpyriment: A Go Framework for Behavioral and Cognitive Experiments Christophe Pallier, Julie Bonnaire, and Marie-France Fourcade Cognitive Neuroimaging Unit CNRS INSERM CEA 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.

(2025) [computer software]. Peirce J. W., Gray J. R., Simpson S. p. 5
Where the paper says it

com/chrplr/bbtkv3 [Accessed: 2026-04-01]. , Simpson, S.

p. 5
Where the paper says it

com/chrplr/bbtkv3 [Accessed: 2026-04-01]. , Simpson, S.

, MacAskill M. p. 4
Where the paper says it

, Pitiot, A. , MacAskill, M.

p. 4
Where the paper says it

, Pitiot, A. , MacAskill, M.

R., Höchenberger R. p. 5
Where the paper says it

, MacAskill, M. , Höchenberger, R.

p. 5
Where the paper says it

, MacAskill, M. , Höchenberger, R.

, Sogo H., Kastman E. p. 5
Where the paper says it

, Höchenberger, R. , Kastman, E.

p. 5
Where the paper says it

, Höchenberger, R. , Kastman, E.

, & Lindeløv J. p. 5
Where the paper says it

, Kastman, E. , & Lindeløv, J.

p. 5
Where the paper says it

, Kastman, E. , & Lindeløv, J.

K. (2019) PsychoPy2: Experiments in behavior made easy[computer software]. p. 5
Where the paper says it

, & Lindeløv, J. PsychoPy2: Experiments in behavior made easy.

Peirce et al., 2019>. Plant, R. Hammond, & Turner, G. p. 5
Where the paper says it

, Hammond, N. , & Turner, G.

(2004) Selfvalidating presentation and response timing in cognitive paradigms: How and why? p. 5
Where the paper says it

, & Turner, G. Selfvalidating presentation and response timing in cog-

p. 5
Where the paper says it

, & Turner, G. Selfvalidating presentation and response timing in cog-

[computer software]. Plant et al. p. 2
Where the paper says it

The only performance tweak applied was to set the timer pooling for usb_serial to the minimum possible value. A Black Box Toolkit version 3 (Plant et al.

, 2004]. SDL Developers, 2026[computer software]. p. 2
Where the paper says it

3 Single-Binary Deployment (Zero Dependencies) Go compiles programs into a single statically linked executable with no external runtime dependencies. Crucially, the go-sdl3 package embeds the pre-built SDL3 runtime libraries (SDL Developers, 2026) directly into the executable so that the user do not need to install any library by herself.

SDL Developers. p. 2
Where the paper says it

3 Single-Binary Deployment (Zero Dependencies) Go compiles programs into a single statically linked executable with no external runtime dependencies. Crucially, the go-sdl3 package embeds the pre-built SDL3 runtime libraries (SDL Developers, 2026) directly into the executable so that the user do not need to install any library by herself.

p. 2
Where the paper says it

3 Single-Binary Deployment (Zero Dependencies) Go compiles programs into a single statically linked executable with no external runtime dependencies. Crucially, the go-sdl3 package embeds the pre-built SDL3 runtime libraries (SDL Developers, 2026) directly into the executable so that the user do not need to install any library by herself.

p. 2
Where the paper says it

3 Single-Binary Deployment (Zero Dependencies) Go compiles programs into a single statically linked executable with no external runtime dependencies. Crucially, the go-sdl3 package embeds the pre-built SDL3 runtime libraries (SDL Developers, 2026) directly into the executable so that the user do not need to install any library by herself.

(2026) Simple DirectMedia Layer, sdl3 p. 2
Where the paper says it

goxpyriment uses this mechanism in its timing-critical loops, ensuring that stimulus onsets and offsets are not delayed by memory management tasks. Hardware-Synchronized Presentation Through go-sdl3 (Jung, 2026), goxpyriment relies on the Simple DirectMedia Layer (SDL, version 3), a crossplatform development library designed to provide lowlevel access to audio, keyboard, mouse, joystick, and graphics hardware (SDL Developers, 2026).

[computer software].
p. 2
Where the paper says it

goxpyriment uses this mechanism in its timing-critical loops, ensuring that stimulus onsets and offsets are not delayed by memory management tasks. Hardware-Synchronized Presentation Through go-sdl3 (Jung, 2026), goxpyriment relies on the Simple DirectMedia Layer (SDL, version 3), a crossplatform development library designed to provide lowlevel access to audio, keyboard, mouse, joystick, and graphics hardware (SDL Developers, 2026).

SDL Developers. (2026) Simple DirectMedia Layer, sdl3[computer software]

Reference IDs: Krause and Lindemann, 2014

Peirce et al., 2019

Brainard, 1997

de Leeuw et al., 2023

Henninger et al., 2022

Kleiner et al., 2007

Pallier, C. (2025) [computer software]

Peirce J. W., Gray J. R., Simpson S., MacAskill M. R., Höchenberger R., Sogo H., Kastman E., & Lindeløv J. K. (2019) PsychoPy2: Experiments in behavior made easy. p. 5

Where the paper says it

, & Lindeløv, J. PsychoPy2: Experiments in behavior made easy.

Plant, R Hammond, & Turner, G. p. 5

Where the paper says it

, Hammond, N. , & Turner, G.

(2004) Selfvalidating presentation and response timing in cognitive paradigms: How and why?

SDL Developers. (2026) Simple DirectMedia Layer, sdl3

Green — the paper says it, and the page is printed. Red — no passage carries it, so treat that sentence as unverified. The same check runs on your own text: check a summary against its source, $5.

Improvements for AI systems

  1. Zero-Dependency Deployment for AI Coding Agents: The framework allows an AI to generate code that bundles assets directly into the binary using //go:embed directive, eliminating path errors caused by mismatched directory structures. This capability drastically reduces deployment friction when generating experiments for various laboratory computers.

  2. Enhanced Timing Reliability via Garbage Collector Control: Go's runtime API allows the framework to suspend the garbage collector in timing-critical loops, ensuring that stimulus onsets and offsets are not delayed by memory management tasks. This prevents unpredictable pauses from corrupting stimulus timing, a known issue in Python environments.

  3. Native High-Precision Timing Architecture: The system achieves high precision through OS-Level Response Timestamps, where reaction times are computed by subtracting two OS-level timestamps rather than relying on continuous polling. This avoids the practical difficulties of managing external C/C++ helper engines required by some Python tools for high precision.

  4. Improved AI Coding Workflow via Type Safety: Go's strong typing translates into less run-time debugging because the compiler catches errors like misspelled method names or invalid argument types during the first build attempt. This reduces erroneous API calls generated by AI assistants.

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.

Related papers