首页> 外文会议>Domain-specific languages >J Is for JavaScript: A Direct-Style Correspondence between Algol-Like Languages and JavaScript Using First-Class Continuations
【24h】

J Is for JavaScript: A Direct-Style Correspondence between Algol-Like Languages and JavaScript Using First-Class Continuations

机译:J Is for JavaScript:使用一流的连续性,类似于Algol的语言和JavaScript之间的直接样式对应

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

摘要

It is a time-honored fashion to implement a domain-specific language (DSL) by translation to a general-purpose language. Such an implementation is more portable, but an unidiomatie translation jeopardizes performance because, in practice, language implementations favor the common cases. This tension arises especially when the domain calls for complex control structures. We illustrate this tension by revisiting Landin's original correspondence between Algol and Church's lambda-notation.rnWe translate domain-specific programs with lexically scoped jumps to JavaScript. Our translation produces the same block structure and binding structure as in the source program, a la Abdali. The target code uses a control operator in direct style, a la Landin. In fact, the control operator used is almost Landin's J-hence our title. Our translation thus complements a continuation-passing translation a la Steele. These two extreme translations require JavaScript implementations to cater either for first-class continuations, as Rhino does, or for proper tail recursion. Less extreme translations should emit more idiomatic control-flow instructions such as for, break, and throw.rnThe present experiment leads us to conclude that translations should preserve not just the data structures and the block structure of a source program, but also its control structure. We thus identify a new class of use cases for control structures in JavaScript, namely the idiomatic translation of control structures from DSLs.
机译:通过转换为通用语言来实现特定领域语言(DSL)是一种历史悠久的方式。这样的实现方式更具可移植性,但是统一的翻译会损害性能,因为在实践中,语言实现方式更倾向于常见情况。特别是当领域需要复杂的控制结构时,这种紧张就会出现。我们通过重新审视Landin在Algol和Church的lambda表示法之间的原始对应关系来说明这种紧张局势。我们以词法范围内的跳转将特定领域的程序转换为JavaScript。我们的翻译产生了与源程序la Abdali中相同的块结构和绑定结构。目标代码使用直接样式的控制运算符la Landin。实际上,所使用的控制运算符几乎是Landin的J-因此,我们的头衔。因此,我们的翻译是对钢笔翻译的补充。这两个极端的翻译需要JavaScript实现,以像Rhino一样满足一流的延续性,或满足正确的尾部递归。不太极端的翻译应发出更多的惯用控制流指令,例如for,break和throw。rn本实验使我们得出结论,翻译不仅应保留源程序的数据结构和块结构,还应保留其控制结构。因此,我们确定了JavaScript中控制结构的一类新的用例,即DSL中控制结构的惯用翻译。

著录项

  • 来源
    《Domain-specific languages》|2009年|1-19|共19页
  • 会议地点 Oxford(GB);Oxford(GB)
  • 作者单位

    Department of Computer Science, Aarhus University Aabogade 34, DK-8200 Aarhus N, Denmark;

    Department of Computer Science, Rutgers University 110 Frelinghuysen Road, Piscataway, NJ 08854, USA;

    Department of Computer Science, Aarhus University Aabogade 34, DK-8200 Aarhus N, Denmark;

  • 会议组织
  • 原文格式 PDF
  • 正文语种 eng
  • 中图分类 程序语言、算法语言;
  • 关键词

相似文献

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

客服邮箱:kefu@zhangqiaokeyan.com

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

  • 服务号