Developing a Domain-Specific Language for Cognitive Tests Using TextX

Igor Dejanović, Mirjana Dejanović · 2025

Domain-specific languages (DSLs) enable researchers and practitioners to work at a higher level of abstraction, leveraging domain-specific concepts to improve efficiency, readability, and maintainability. textX, a meta-language and tool for DSL development, simplifies the creation of such languages by providing an intuitive and flexible framework. In this paper, we showcase the power of textX through the development of PyFlies, a DSL designed for specifying cognitive experiments. PyFlies streamlines experiment design by offering a concise, human-readable syntax that eliminates the complexities of general-purpose programming. Using the Mental Rotation Test as a case study, we demonstrate how PyFlies enhances productivity and reproducibility by automatically generating executable experiments for platforms like PsychoPy. Our results highlight the advantages of textX and DSLs in reducing development effort while making experiment design more accessible to researchers with limited programming expertise.

Read the paper · More papers on PaperTik