Design and implementation of a domain-specific language framework using S-expressions
Sažetak
Domain-specific languages enable concise and expressive means of programming within a selected domain, resulting in improved productivity and maintainability when compared to general-purpose languages. Although various implementation techniques exist for defining domain-specific languages, it remains a complex and resource-intensive task that typically requires advanced expertise in language engineering. Therefore, there is a growing need to simplify domain-specific language development. In particular, this work seeks to address this by providing a lightweight, extensible framework that abstracts away low-level language concerns and enables effortless creation of a new domain-specific language. This paper introduces DomainBuilder, a C++-based framework centered around an extensible interpreter architecture. The framework enables the definition of domain-specific abstractions using S-expressions extended with user-defined operators. It provides predefined general-purpose programming constructs that can interoperate seamlessly with newly introduced domain-specific constructs. Its practical applicability is demonstrated through an implementation of a domain-specific language in the domain of data pipelines. DomainBuilder enables efficient and modular construction of domain-specific languages, supporting language composability. It provides an extensible environment that can serve as a foundation for further exploration of extensible interpreter architectures.