论文标题

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

Bacatá: Notebooks for DSLs, Almost for Free

论文作者

Merino, Mauricio Verano, Vinju, Jurgen, van der Storm, Tijs

论文摘要

上下文:计算笔记本是一种现代的识字编程方式,在其中,用户可以通过将可执行的代码,输出和散文交流和传输知识在单个丰富的文档中交流和传输知识。特定于域的语言(DSL)是针对特定应用程序域量身定制的人造软件语言。通常,DSL用户是可能没有软件工程背景的域专家。结果,他们可能不熟悉综合开发环境(IDE)。因此,开发提供与DSL交互不同接口的工具是相关的。 查询:但是,DSL设计人员可用的资源有限。我们想利用用于在DSL的背景下与通用语言交互的工具。计算笔记本是此类工具的一个示例。然后,我们的主要问题是:设计和实现DSL的笔记本接口的有效方法是什么?通过解决这个问题,我们可能能够加快DSL工具的开发,并简化最终用户和DSL之间的相互作用。 方法:在本文中,我们提出了Bacatá,这是一种以语言参数方式为DSL生成笔记本接口的机制。我们以语言工程师可以重复使用尽可能多的语言组件(例如语言处理器,类型的检查器,代码生成器)的方式设计了这种机制。 知识:我们的结果表明,Bacatá生成的笔记本接口可以自动生成,几乎没有手动配置。依靠语言设计方面的语言工程师应解决的考虑和警告很少。使用Bacatá创建DSL的笔记本成为编写与Jupyter平台在Rascal语言Workbench中挂载现有语言组件的代码的问题。 接地:我们通过生成三种不同非平淡的DSL的功能计算笔记本接口来评估Bacatá,即:halide的一小部分(用于数字图像处理的DSL),SweeterJS(Sweeterjs(JavaScript的扩展版本)和QL(QL)和QL(ql for Inspearaires a 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.

扫码加入交流群

加入微信交流群

微信交流群二维码

扫码加入学术交流群,获取更多资源