Generic Reduction-Based Interpreters (Extended Version)

๐Ÿ“… 2025-08-15
๐Ÿ“ˆ Citations: 0
โœจ Influential: 0
๐Ÿ“„ PDF
๐Ÿค– AI Summary
Specification-based interpreters suffer from excessive boilerplate code and poor maintainability. Method: This paper proposes a generic programmingโ€“based automated construction methodology. It decomposes syntactic constructs into reducible expressions and contexts, and leverages recursive data type modeling, pattern matching, and structured reduction strategies to automatically derive and reorganize reduction logic. Contribution/Results: To our knowledge, this is the first application of generic programming to reduction interpreter design, eliminating substantial hand-written template code inherent in conventional implementations. Experimental evaluation demonstrates that the approach reduces code volume by approximately 60% on average, significantly improves modularity, and enhances cross-language reusability. These results validate the effectiveness and practicality of the generic reduction framework in interpreter engineering.

Technology Category

Natural Language Processing: Code Generation / Program Synthesis from Natural LanguageKnowledge Representation and Reasoning: Logic ProgrammingReasoning under Uncertainty: Probabilistic Programming

Application Category

Semantics and Knowledge: Methods, algorithms and applications for the development of semantic models, knowledge graphs and other forms of structured data models with machine-interpretable semanticsUser Modeling, Personalization and Recommendation: Explainable and interpretable methods for personalizationGraph Algorithms and Modeling for the Web: Efficient manipulation of static and dynamic Web-related graphs
๐Ÿ“ Abstract
Reduction-based interpreters are traditionally defined in terms of a one-step reduction function which systematically decomposes a term into a potential redex and context, contracts the redex, and recomposes it to construct the new term to be further reduced. While implementing such interpreters follows a systematic recipe, they often require interpreter engineers to write a substantial amount of code -- much of it boilerplate. In this paper, we apply well-known techniques from generic programming to reduce boilerplate code in reduction-based interpreters.
Problem

Research questions and friction points this paper is trying to address.

Reducing boilerplate code in reduction-based interpreters
Applying generic programming to interpreter implementation
Systematic decomposition of terms requires excessive coding
Innovation

Methods, ideas, or system contributions that make the work stand out.

Generic programming techniques reduce boilerplate
Systematic decomposition of terms into redexes
Automated recomposition process for interpreter efficiency