Physics4All DSL: A Domain-Specific Language for Democratising Physics Simulations and Advancing DSL Engineering with JetBrains MPS
Authors: Meacham, S., de La Bourdonnaye, C.E., Pech, V., Alfraihi, H.
Conference: MODELSWARD 2026
Dates: 07/03/2026
Publication Date: 07/03/2026
Abstract:Simulations are essential in physics education but remain difficult for non-programmers to design and adapt. Existing tools often limit customisation, hindering teachers and students from tailoring experiments to their needs. This paper presents Physics4All, a domain-specific language (DSL) built with JetBrains MPS to democratise the creation of physics simulations. Physics4All introduces domain-specific constructs—worlds, objects, forces, dimensions, and vectors—expressed in familiar mathematical notation. Its modular generation pipeline supports multiple targets (Java and JavaScript), enabling simulations to run across platforms without altering models. Key innovations include implicit unit conversion, reusable forces and objects, and live type checking for correctness. Beyond the educational domain, these features illustrate generalisable DSL engineering principles for modularity, abstraction, and reusability. We evaluated Physics4All through a metrics-based comparison with a GPL baseline and an empirical case study involving secondary school teachers and educational technology developers. The comparison highlighted substantial reductions in implementation effort, while the case study confirmed high suitability, expressiveness, and productivity, with usability and maintainability identified as areas for improvement. Compared to widely used tools such as PhET, Algodoo, and COMSOL, Physics4All offers greater customisation while remaining accessible to non-programmers. The results demonstrate how DSLs can expand the reach and impact of simulation-based education while contributing to broader discussions on domain-specific language engineering.
Source: Manual