arXivDaily arXiv每日学术速递 周一至周五更新
感恩节,周五至周末无更新,大家顺遂。周一再来吧
arXiv 1803.10202cs.PL
收藏

Haskell的混合种源

Language-integrated provenance in Haskell

Jan Stolarek, James Cheney

摘要:

科学进步越来越依赖于数据管理,特别是清理和管理数据,以便系统地分析和重用数据。已经提出了大量用于管理和策展数据(及其出处)的技术,主要是在数据库社区中。特别是,一些有影响力的论文提出了收集出处信息,解释一段数据是从哪里复制的,或者使用了什么其他记录来获得它。然而,大多数这些技术只存在于研究原型中,并不适用于主流数据库系统。这意味着科学家们要么自己实施这些技术,要么(经常)不使用这些技术。这本质上是一个代码重用问题:起源技术目前不能被可重用地实现,只能作为标准数据库的临时、通常不维护的扩展。另一种相对未被探索的方法是在更高的抽象级别上支持这些技术,使用元编程或反射技术。先进的编程技术是否可以更容易地将起源研究成果转化为实践?我们建立在最近的一种方法,称为语言集成的出处,它扩展了语言集成的查询技术与源到源查询翻译记录出处。在以前的工作中,开发了一个研究程序设计语言的链接,支持复杂的Web和数据库编程的概念证明。在本文中,我们将展示如何在基于数据库支持的Haskell(DSH)库的Haskell构建中采用这种方法。尽管Haskell丰富的编程特性在原则上似乎已经足够了,但在Haskell中实现语言集成的起源需要克服许多技术挑战,因为这些功能之间存在交互。我们的实现作为一个概念的证明,展示了这种元编程功能的组合,第一次,使数据出处设施提供给程序员作为一个广泛使用的,通用的语言库。在我们的工作中,我们成功地实现了被称为出处和血统的出处形式。我们已经使用一个简单的数据库和查询集测试了我们的实现,并确定结果查询在数据库上正确执行。我们的实现在GitHub上公开提供。我们的工作使得DSH的用户可以以很低的成本进行出处跟踪。虽然Haskell并没有广泛用于科学数据库开发,但我们的工作表明了哪些语言特性是支持源代码库所必需的。我们还强调了如何结合Haskell的高级类型编程功能可能会导致意想不到的并发症,这可能会激发进一步的研究类型系统的表现力。

英文摘要:

Scientific progress increasingly depends on data management, particularly to clean and curate data so that it can be systematically analyzed and reused. A wealth of techniques for managing and curating data (and its provenance) have been proposed, largely in the database community. In particular, a number of influential papers have proposed collecting provenance information explaining where a piece of data was copied from, or what other records were used to derive it. Most of these techniques, however, exist only as research prototypes and are not available in mainstream database systems. This means scientists must either implement such techniques themselves or (all too often) go without. This is essentially a code reuse problem: provenance techniques currently cannot be implemented reusably, only as ad hoc, usually unmaintained extensions to standard databases. An alternative, relatively unexplored approach is to support such techniques at a higher abstraction level, using metaprogramming or reflection techniques. Can advanced programming techniques make it easier to transfer provenance research results into practice? We build on a recent approach called language-integrated provenance, which extends language-integrated query techniques with source-to-source query translations that record provenance. In previous work, a proof of concept was developed in a research programming language called Links, which supports sophisticated Web and database programming. In this paper, we show how to adapt this approach to work in Haskell building on top of the Database-Supported Haskell (DSH) library. Even though it seemed clear in principle that Haskell's rich programming features ought to be sufficient, implementing language-integrated provenance in Haskell required overcoming a number of technical challenges due to interactions between these capabilities. Our implementation serves as a proof of concept showing how this combination of metaprogramming features can, for the first time, make data provenance facilities available to programmers as a library in a widely-used, general-purpose language. In our work we were successful in implementing forms of provenance known as where-provenance and lineage. We have tested our implementation using a simple database and query set and established that the resulting queries are executed correctly on the database. Our implementation is publicly available on GitHub. Our work makes provenance tracking available to users of DSH at little cost. Although Haskell is not widely used for scientific database development, our work suggests which languages features are necessary to support provenance as library. We also highlight how combining Haskell's advanced type programming features can lead to unexpected complications, which may motivate further research into type system expressiveness.

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

↑