arXivDaily arXiv每日学术速递 周一至周五更新
arXiv 2002.06180cs.PL
收藏

Bacatá:DSL笔记本,几乎免费

Bacatá: Notebooks for DSLs, Almost for Free

Mauricio Verano Merino, Jurgen Vinju, Tijs van der Storm

摘要:

内容:计算笔记本是一种当代的文学编程风格,用户可以通过在单个丰富的文档中交错可执行代码,输出和散文来交流和传递知识。领域特定语言(Domain-Specific Language,DSL)是一种为特定应用领域定制的人工软件语言。通常,DSL用户是领域专家,可能没有软件工程背景。因此,他们可能不熟悉集成开发环境(IDE)。因此,开发为与DSL交互提供不同接口的工具是相关的。询问:然而,DSL设计人员可用的资源是有限的。我们希望在DSL的上下文中利用用于与通用语言交互的工具。计算笔记本就是这种工具的一个例子。那么,我们的主要问题是:什么是设计和实现DSL笔记本接口的高效和有效的方法?通过解决这个问题,我们可能能够加快DSL工具的开发,并简化最终用户和DSL之间的交互。方法:在本文中,我们提出了Bacatá,一种以语言参数化方式为DSL生成笔记本界面的机制。我们设计这种机制的方式,语言工程师可以重用尽可能多的语言组件(例如,语言处理器、类型检查器、代码生成器)。知识:我们的结果表明,Bacatá生成的笔记本界面可以自动生成,只需很少的手动配置。依赖于语言设计方面的语言工程师应该解决的注意事项和警告很少。使用Bacatá为DSL创建一个笔记本就变成了编写将Rascal语言工作台中的现有语言组件与Rascal平台连接起来的代码。接地:我们通过为三种不同的非平凡DSL生成功能计算笔记本接口来评估Bacatá,即:Halide的一个小子集(用于数字图像处理的DSL),SweeterJS(JavaScript的扩展版本)和QL(用于问卷调查的DSL)。此外,生成笔记本实现而不是手动实现它们也是相关的。我们测量并比较了我们从这些语言的现有实现中重用的源代码行(SLOC)的数量。重要性:新手程序员和最终用户对笔记本的采用使其在探索性编程、数据科学、数据新闻和机器学习等多个领域非常受欢迎。它们为什么受欢迎?在(数据)科学中,使结果具有可重复性和可理解性至关重要。但是,笔记本仅适用于GPL。这篇文章为DSL打开了笔记本隐喻,以改善与代码交互时的最终用户体验,并提高DSL的采用率。

英文摘要:

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 Domain-Specific 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. Inquiry: 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 end-users and DSLs. Approach: In this paper, we present Bacatá, 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. Knowledge: Our results show that notebook interfaces generated by Bacatá 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 Bacatá becomes a matter of writing the code that wires existing language components in the Rascal language workbench with the Jupyter platform. Grounding: We evaluate Bacatá by generating functional computational notebook interfaces for three different non-trivial 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. Importance: The adoption of notebooks by novice-programmers and end-users has made them very popular in several domains such as exploratory programming, data science, data journalism, and machine learning. Why are they popular? In (data) science, it is essential to make results reproducible as well as understandable. However, notebooks are only available for GPLs. This paper opens up the notebook metaphor for DSLs to improve the end-user experience when interacting with code and to increase DSLs adoption.

机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。

↑