首页> 外文会议>Asian Symposium on Programming Languages and Systems >Polymorphic Multi-stage Language with Control Effects
【24h】

Polymorphic Multi-stage Language with Control Effects

机译:具有控制效应的多态性多阶段语言

获取原文

摘要

Multi-stage programming (MSP) is a means for run-time code generation, and has been found promising in various fields including numerical computation and domain specific languages. An important problem in designing MSP languages is the dilemma of safety and expressivity; many foundational calculi have been proposed and proven to be type safe, yet, they are not expressive enough. Taha's MetaOCaml provides us a very expressive tool for MSP, yet, the corresponding theory covers its purely functional subset only. In this paper, we propose a polymorphic multi-stage calculus with delimited-control operators. Kameyama, Kiselyov, and Shan proposed a multi-stage calculus with computation effects, but their calculus lacks polymorphism. In the presence of control effects, polymorphism in types is indispensable as all pure functions are polymorphic over answer types, and in MSP languages, polymorphism in stages is indispensable to write custom generators as library functions. We show that the proposed calculus satisfies type soundness and type inference. The former is the key to guarantee the absence of scope extrusion - open codes are never generated or executed. The latter is important in the ML-like programming languages. Following Calcagno, Moggi and Taha's work, we propose a Hindley-Milner style type inference algorithm to obtain principal types for given expressions (if they exist).
机译:多级编程(MSP)是运行时代码生成的手段,并且已经发现在包括数值计算和域特定语言的各种领域中有前景。设计MSP语言的一个重要问题是安全性和富有态度的困境;已经提出了许多基础计算并证明是安全的,但它们并不足够表达。 Taha的Metaocaml为MSP提供了一个非常富有表现力的工具,但相应的理论仅涵盖其纯粹的功能子集。在本文中,我们提出了具有分隔控制运营商的多态性多阶段微积分。 Kameyama,Kiselyov和Shan提出了一种具有计算效果的多阶段微积分,但它们的结石缺乏多态性。在存在对照效果的情况下,类型中的多态性是必不可少的,因为所有纯函数都是多态的答案类型,并且在MSP语言中,阶段的多态性是必不可少的,以将自定义发电机写为库函数是必不可少的。我们表明所提出的微积分满足型声音和型推断。前者是保证没有范围挤出的关键 - 开放代码永远不会生成或执行。后者在ML类似的编程语言中很重要。在Calcagno,Moggi和Taha的工作之后,我们提出了一个Hindley-Milner风格的推理算法,以获得给定表达式的主要类型(如果存在)。

著录项

相似文献

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

客服邮箱:kefu@zhangqiaokeyan.com

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

  • 服务号