Abstract:
This study shows the possibility of creating different physics models using a Domain-Specific Language (DSL). Physics education frequently struggles to create a connection between theoretical knowledge and experiential understanding. As a result, this paper solves these challenges and introduces a proposed solution that bridges the gap between theoretical and applied knowledge in Physics education, in the form of a DSL, “GravITy”, specifically for interactive Physics simulations. The idea behind GravITy is to provide high-level, Physicscentric constructs that allow teachers and students to describe complex scenarios with straightforward commands, rather than long general code. The Grammar Definition of GravITy, which details the formal structure of the DSL through Backus-Naur Form, semantic flow, examples, and the processes of lexing and parsing, is key to achieving this ease of use. An interpreter is then utilized to convert GravITy code into dynamic Processing visualizations. The DSL’s design is developed to integrate these interactive simulation capabilities directly into the language, enabling immediate visualization of concepts and real-time feedback as users tweak parameters.