Bacatxc3xa1: Notebooks for DSLs, Almost for Free Context: Computational notebooks are a contemporary style of literate programming, in which users can communicate and transfer knowledge by interleaving executable code, output, and prose in a single rich document. A DomainSpecific Language (DSL) is an artificial software language tailored for a particular application domain. Usually, DSL users are domain experts that may not have a software engineering background. As a consequence, they might not be familiar with Integrated Development Environments (IDEs). Thus, the development of tools that offer different interfaces for interacting with a DSL is relevant.  :88,However, resources available to DSL designers are limited. We would like to leverage tools used to interact with general purpose languages in the context of DSLs. Computational notebooks are an example of such tools. Then, our main question is: What is an efficient and effective method of designing and implementing notebook interfaces for DSLs? By addressing this question we might be able to speed up the development of DSL tools, and ease the interaction between endusers and DSLs.  :167,In this paper, we present Bacata, a mechanism for generating notebook interfaces for DSLs in a language parametric fashion. We designed this mechanism in a way in which language engineers can reuse as many language components (e.g., language processors, type checkers, code generators) as possible.  :213,Our results show that notebook interfaces generated by Bacata can be automatically generated with little manual configuration. There are few considerations and caveats that should be addressed by language engineers that rely on language design aspects. The creation of a notebook for a DSL with Bacata becomes a matter of writing the code that wires existing language components in the Rascal language workbench with the Jupyter platform.  We :281,evaluate Bacata by generating functional computational notebook interfaces for three different nontrivial DSLs, namely: a small subset of Halide (a DSL for digital image processing), SweeterJS (an extended version of JavaScript), and QL (a DSL for questionnaires). Additionally, it is relevant to generate notebook implementations rather than implementing them manually. We measured and compared the number of Source Lines of Code (SLOCs) that we reused from existing implementations of those languages.  The :354,adoption of notebooks by noviceprogrammers and endusers has made them very popular in several domains such as exploratory programming, data science, data journalism, and machine learning. Why are they popular? :167,In (data) science, it is essential to make results reproducible as well as understandable. :88,However, notebooks are only available for GPLs. This paper opens up the notebook metaphor for DSLs to improve the enduser experience when interacting with code and to increase DSLs adoption.

Reusing Static Analysis across Different DomainSpecific Languages using Reference Attribute Grammars. Context: Domainspecific languages (DSLs) enable domain experts to specify tasks and problems themselves, while enabling static analysis to elucidate issues in the modelled domain early. Although language workbenches have simplified the design of DSLs and extensions to general purpose languages, static analyses must still be implemented manually.  Inquiry: Moreover, static analyses, e.g., complexity metrics, dependency analysis, and declarationuse analysis, are usually domaindependent and cannot be easily reused. Therefore, transferring existing static analyses to another DSL incurs a huge implementation overhead. However, this overhead is not always intrinsically necessary: in many cases, while the concepts of the DSL on which a static analysis is performed are domainspecific, the underlying algorithm employed in the analysis is actually domainindependent and thus can be reused in principle, depending on how it is specified. While current approaches either implement static analyses internally or with an external Visitor, the implementation is tied to the languageu0027s grammar and cannot be reused easily. Thus far, a commonly used approach that achieves reusable static analysis relies on the transformation into an intermediate representation upon which the analysis is performed. This, however, entails a considerable additional implementation effort.  Approach: To remedy this, it has been proposed to map the necessary domainspecific concepts to the algorithmu0027s domainindependent data structures, yet without a practical implementation and the demonstration of reuse. Thus, to make static analysis reusable again, we employ relational Reference Attribute Grammars (RAGs) by creating such a mapping to a domainindependent overlay structure using higherorder attributes.  Knowledge: We describe how static analysis can be specified on analysisspecific data structures, how relational RAGs can help with the specification, and how a mapping from the domainspecific language can be performed. Furthermore, we demonstrate how a static analysis for a DSL can be externalized and reused in another general purpose language.  Grounding: The approach was evaluated using the RAG system JastAdd. To illustrate reusability, we implemented two analyses with two addressed languages each: a cycle detection analysis used in a small state machine DSL and for detecting circular dependencies in Java types and packages, and an analysis of variable shadowing, applied to both Java and the Modelica modelling language. Thereby, we demonstrate the reuse of two analysis algorithms in three completely different domains. Additionally, we use the cycle detection analysis to evaluate the efficiency by comparing our external analysis to an internal reference implementation analysing all Java programs in the Qualitas Corpus and thereby are able to show that an externalized analysis incurs only minimal overhead.  Importance: We make static analysis reusable, again, showing the practicality and efficiency of externalizing static analysis for both DSLs and general purpose languages using relational RAGs.