Readability of Domain-Specific Languages: A Controlled Experiment Comparing (Declarative) Inference Rules with (Imperative) Java Source Code in Programming Language Design

Kai Klanten, Stefan Hanenberg, Stefan Gries, Volker Gruhn

2024

Abstract

.Domain-specific languages (DSLs) play a large role in computer science: languages from formal grammars up to SQL are integral part of education as well as industrial applications. However, to what extent such languages have a positive impact on the resulting code, respectively on the activity of writing and reading code, mostly remains unclear. The focus of the present work is on the notation of inference rules as they are applied in programming language education and research. A controlled experiment is introduced where given type rules are either defined using a corresponding DSL or the general-purpose language Java. Thereto, a repeated Nof-1 experiment was executed on 12 undergraduate students in computer science, where the participants had to select for a randomly generated typing rule and a randomly generated term from a list of possible types the correct one. Although the formal notation of inference rules is typically considered as non-trivial (in comparison to code in general–purpose languages), it turned out that the students were able to detect the type of a given expression significantly faster than using Java (p < .001, η2 p = .439): on average, the response times using Java were almost twice as much as the response times using inference rules ( MJava Min f erence = 1.914). Furthermore, the participants did less errors using inference rules (p = .023). We conclude from that the use of inference rules in programming language design also improves the readability of such rules.

Download


Paper Citation


in Harvard Style

Klanten K., Hanenberg S., Gries S. and Gruhn V. (2024). Readability of Domain-Specific Languages: A Controlled Experiment Comparing (Declarative) Inference Rules with (Imperative) Java Source Code in Programming Language Design. In Proceedings of the 19th International Conference on Software Technologies - Volume 1: ICSOFT; ISBN 978-989-758-706-1, SciTePress, pages 492-503. DOI: 10.5220/0012857800003753


in Bibtex Style

@conference{icsoft24,
author={Kai Klanten and Stefan Hanenberg and Stefan Gries and Volker Gruhn},
title={Readability of Domain-Specific Languages: A Controlled Experiment Comparing (Declarative) Inference Rules with (Imperative) Java Source Code in Programming Language Design},
booktitle={Proceedings of the 19th International Conference on Software Technologies - Volume 1: ICSOFT},
year={2024},
pages={492-503},
publisher={SciTePress},
organization={INSTICC},
doi={10.5220/0012857800003753},
isbn={978-989-758-706-1},
}


in EndNote Style

TY - CONF

JO - Proceedings of the 19th International Conference on Software Technologies - Volume 1: ICSOFT
TI - Readability of Domain-Specific Languages: A Controlled Experiment Comparing (Declarative) Inference Rules with (Imperative) Java Source Code in Programming Language Design
SN - 978-989-758-706-1
AU - Klanten K.
AU - Hanenberg S.
AU - Gries S.
AU - Gruhn V.
PY - 2024
SP - 492
EP - 503
DO - 10.5220/0012857800003753
PB - SciTePress