【24h】

Binders Unbound

机译:粘合剂未绑定

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

摘要

Implementors of compilers, program refactorers, theorem provers, proof checkers, and other systems that manipulate syntax know that dealing with name binding is difficult to do well. Operations such as a-equivalence and capture-avoiding substitution seem simple, yet subtle bugs often go undetected. Furthermore, their implementations are tedious, requiring "boilerplate" code that must be updated whenever the object language definition changes. Many researchers have therefore sought to specify binding syntax declaratively, so that tools can correctly handle the details behind the scenes. This idea has been the inspiration for many new systems (such as Beluga, Delphin, FreshML, FreshOCaml, Caml, FreshLib, and Ott) but there is still room for improvement in expressivity, simplicity and convenience. In this paper, we present a new domain-specific language, UNBOUND, for specifying binding structure. Our language is particularly expressive-it supports multiple atom types, pattern binders, type annotations, recursive binders, and nested binding (necessary for telescopes, a feature found in dependently-typed languages). However, our specification language is also simple, consisting of just five basic combinators. We provide a formal semantics for this language derived from a locally nameless representation and prove that it satisfies a number of desirable properties. We also present an implementation of our binding specification language as a GHC Haskell library implementing an embedded domain specific language (EDSL). By using Haskell type constructors to represent binding combinators, we implement the EDSL succinctly using datatype-generic programming. Our implementation supports a number of features necessary for practical programming, including flexibility in the treatment of user-defined types, best-effort name preservation (for error messages), and integration with HaskeU's monad transformer library.
机译:编译器,程序重构器,定理证明,证明检查器以及其他处理语法的系统的实现者都知道,处理名称绑定非常困难。等价和避免捕获替代等操作看起来很简单,但是细微的错误经常未被发现。此外,它们的实现很繁琐,需要“样板”代码,只要目标语言定义发生更改,都必须更新这些代码。因此,许多研究人员试图声明性地指定绑定语法,以便工具可以正确处理后台的细节。这个想法是许多新系统(例如Beluga,Delphin,FreshML,FreshOCaml,Caml,FreshLib和Ott)的灵感,但在表达性,简单性和便利性方面仍有改进的空间。在本文中,我们提出了一种新的特定于域的语言,UNBOUND,用于指定绑定结构。我们的语言特别具有表达力-它支持多种原子类型,模式绑定器,类型注释,递归绑定器和嵌套绑定(望远镜是必需的,这是依赖类型语言中的一种功能)。但是,我们的规范语言也很简单,仅由五个基本组合器组成。我们为这种语言提供了形式上的语义,该语义是从本地无名表示形式派生而来的,并证明它满足许多期望的属性。我们还提供了作为GHC Haskell库的绑定规范语言的实现,该库实现了嵌入式域特定语言(EDSL)。通过使用Haskell类型构造函数表示绑定组合器,我们使用数据类型通用编程简洁地实现了EDSL。我们的实现支持实际编程所需的许多功能,包括灵活处理用户定义的类型,尽力而为的名称保存(用于错误消息)以及与HaskeU的monad转换器库集成。

著录项

相似文献

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

客服邮箱:kefu@zhangqiaokeyan.com

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

  • 服务号