Skip to main content

Lund University Publications

LUND UNIVERSITY LIBRARIES

Dynamic Dependency-Based Purity Checking

Risberg Alaküla, Anton LU orcid ; Fors, Niklas LU orcid and Reichenbach, Christoph LU orcid (2025) p.148-161
Abstract
Many software language tools use declarative domain-specific languages (DDSLs) to implement parts of their functionality, such as context-free grammars for parsing or inference rules for type analysis. For interoperability and ease of use, DDSLs often rely on embedded general-purpose language (GPL) code fragments, as in the semantic actions of parser specifications, but require that these GPL fragments fulfill certain semantic properties, such as the absence of observable side effects. Fulfilling these properties is usually up to the developer, and accidental violations can lead to subtle and hard-to-trace bugs.

We present Tragdor, a tool that dynamically checks for property violations in Reference Attribute Grammars (RAGs)... (More)
Many software language tools use declarative domain-specific languages (DDSLs) to implement parts of their functionality, such as context-free grammars for parsing or inference rules for type analysis. For interoperability and ease of use, DDSLs often rely on embedded general-purpose language (GPL) code fragments, as in the semantic actions of parser specifications, but require that these GPL fragments fulfill certain semantic properties, such as the absence of observable side effects. Fulfilling these properties is usually up to the developer, and accidental violations can lead to subtle and hard-to-trace bugs.

We present Tragdor, a tool that dynamically checks for property violations in Reference Attribute Grammars (RAGs) written for the JastAdd metacompiler, and report on the efficacy of four property testing strategies that Tragdor employs. Even in a mature RAG like the Java 11 compiler ExtendJ, Tragdor was able to find 13 implementation issues, 2 of which we consider to be of high severity. Our manual inspection of Tragdor's reports identifies a number of potential RAG anti-patterns and finds evidence that the inherent dependency structure of RAGs often encodes fine-grained implicit contracts. (Less)
Please use this url to cite or link to this publication:
author
; and
organization
publishing date
type
Chapter in Book/Report/Conference proceeding
publication status
published
subject
host publication
SLE '25: 18th ACM SIGPLAN International Conference on Software Language Engineering
pages
148 - 161
publisher
Association for Computing Machinery (ACM)
external identifiers
  • scopus:105010337199
DOI
10.1145/3732771.3742720
project
Cloud Based Language Tooling
language
English
LU publication?
yes
id
430dbe3e-1086-4e16-bfc5-328ce4628ac9
date added to LUP
2025-06-18 11:01:40
date last changed
2025-10-14 11:59:20
@inproceedings{430dbe3e-1086-4e16-bfc5-328ce4628ac9,
  abstract     = {{Many software language tools use declarative domain-specific languages (DDSLs) to implement parts of their functionality, such as context-free grammars for parsing or inference rules for type analysis. For interoperability and ease of use, DDSLs often rely on embedded general-purpose language (GPL) code fragments, as in the semantic actions of parser specifications, but require that these GPL fragments fulfill certain semantic properties, such as the absence of observable side effects. Fulfilling these properties is usually up to the developer, and accidental violations can lead to subtle and hard-to-trace bugs.<br/><br/>We present Tragdor, a tool that dynamically checks for property violations in Reference Attribute Grammars (RAGs) written for the JastAdd metacompiler, and report on the efficacy of four property testing strategies that Tragdor employs. Even in a mature RAG like the Java 11 compiler ExtendJ, Tragdor was able to find 13 implementation issues, 2 of which we consider to be of high severity. Our manual inspection of Tragdor's reports identifies a number of potential RAG anti-patterns and finds evidence that the inherent dependency structure of RAGs often encodes fine-grained implicit contracts.}},
  author       = {{Risberg Alaküla, Anton and Fors, Niklas and Reichenbach, Christoph}},
  booktitle    = {{SLE '25: 18th ACM SIGPLAN International Conference on Software Language Engineering}},
  language     = {{eng}},
  month        = {{06}},
  pages        = {{148--161}},
  publisher    = {{Association for Computing Machinery (ACM)}},
  title        = {{Dynamic Dependency-Based Purity Checking}},
  url          = {{http://dx.doi.org/10.1145/3732771.3742720}},
  doi          = {{10.1145/3732771.3742720}},
  year         = {{2025}},
}