首页> 外文期刊>Science of Computer Programming >The optics of language-integrated query
【24h】

The optics of language-integrated query

机译:语言集成查询的光学

获取原文
获取原文并翻译 | 示例

摘要

Monadic comprehensions reign over the realm of language-integrated query (LINQ), and for good reasons. Indeed, comprehensions are tightly integrated with general purpose programming languages and close enough to common query languages, such as SQL, to guarantee their translation into effective queries. Comprehensions also support features for writing reusable and composable queries, such as the handling of nested data and the use of functional abstractions. In parallel to these developments, optics have emerged in recent years as the technology of choice to write programs that manipulate complex data structures with nested components. Optic abstractions are easily composable and, in principle, permit both data access and updates. This paper attempts to exploit the notion of optic for UNO. as a higher-level language that complements comprehension-based approaches. In order to do this, we lift a restricted subset of optics, namely getters, affine folds and folds, into a full-blown DSL. The type system of the resulting language of optics, that we have named Optica, distills their compositional properties, whereas its denotational semantics is given by standard optics. This formal specification of the concept of optic enables the definition of non-standard optic representations beyond van Laarhoven, profunctor optics, etc. In particular, the paper demonstrates that a restricted subset of XQuery can be understood as an optic representation; it introduces Triplets, a nonstandard semantic domain to normalize optic expressions and facilitate the generation of SQL queries; and it describes how to generate comprehension-based queries from optic expressions, thus showing that both approaches can coexist. Despite the limited expressiveness of optics in relation to comprehensions, results are encouraging enough to anticipate the convenience and feasibility of extending existing comprehension-based libraries for LINQ in the functional ecosystem, with optic capabilities. In order to show this potential, the paper also describes S-Optica, a Scala implementation of Optica using the tagless-final approach.
机译:单语理解占据了语言集成查询(LINQ)的领域,这有充分的理由。实际上,理解与通用编程语言紧密集成在一起,并且与诸如SQL之类的通用查询语言足够接近,以确保将其转换为有效的查询。理解还支持用于编写可重用和可组合查询的功能,例如嵌套数据的处理和功能抽象的使用。与这些发展并行的是,近年来,光学已成为一种编写程序的首选技术,该程序可以处理带有嵌套组件的复杂数据结构。光学抽象很容易构成,并且原则上允许数据访问和更新。本文尝试利用UNO的光学概念。作为对基于理解的方法的补充的高级语言。为此,我们将光学器件的受限子集(即吸气剂,仿射褶皱和褶皱)提升为成熟的DSL。我们将其命名为Optica的光学语言的类型系统提炼了它们的成分特性,而其指称语义由标准光学给出。光学概念的这种正式规范使得可以定义范拉尔霍芬(van Laarhoven),profunctor光学器件等以外的非标准光学表示形式。特别是,本文证明了XQuery的受限子集可以理解为光学表示形式。它引入了Triplets,这是一个非标准的语义域,用于规范光学表达式并促进SQL查询的生成。它描述了如何从视觉表达中生成基于理解的查询,从而表明这两种方法可以共存。尽管光学相对于理解的表达能力有限,但结果令人鼓舞,足以预见到在光学系统中扩展现有的基于理解的LINQ在功能生态系统中的便利性和可行性。为了展示这种潜力,本文还介绍了S-Optica,这是使用无标签最终方法的Optica的Scala实现。

著录项

  • 来源
    《Science of Computer Programming》 |2020年第may1期|102395.1-102395.44|共44页
  • 作者

  • 作者单位

    Universidad ReyJuan Carlos Calle Tulipan s. 28933 Mostoles Spain Habla Computing SL Avda. Gregorio Peces Barba 28918 Leganes Spain;

  • 收录信息 美国《科学引文索引》(SCI);美国《工程索引》(EI);
  • 原文格式 PDF
  • 正文语种 eng
  • 中图分类
  • 关键词

    Optics; Language-integrated query; Comprehensions; Typed tagless-final; Scala;

    机译:光学;语言集成查询;理解力;键入无标签决赛;斯卡拉;

相似文献

  • 外文文献
  • 中文文献
  • 专利
获取原文

客服邮箱:kefu@zhangqiaokeyan.com

京公网安备:11010802029741号 ICP备案号:京ICP备15016152号-6 六维联合信息科技 (北京) 有限公司©版权所有
  • 客服微信

  • 服务号