首页> 外文期刊>Science of Computer Programming >Combining partial evaluation and staged interpretation in the implementation of domain-specific languages
【24h】

Combining partial evaluation and staged interpretation in the implementation of domain-specific languages

机译:结合部分评估和分阶段解释,以实现特定领域的语言

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

摘要

We propose a combination of partial evaluation and staged interpretation with MetaOCaml for rapid prototyping of domain-specific languages. Interpretation is an easy way to implement such languages. MetaOCaml can eliminate the overhead of interpretation at run-time, if the interpreter is written in a staged form, i.e., takes the source program separate from the input data in a first stage. Partial evaluation of the source program with values known at compile time can further improve the target code performance. Additional aggressive optimizations are possible due to the absence of general recursion. Algebraic simplifications can even achieve binding-time improvements during the online partial evaluation. Our approach both saves the application programmer completely from binding-time considerations and exploits staged interpretation with MetaOCaml for target code generation. The example domain presented in this paper is image processing, in which the domain-specific language permits the specification of convolution matrices, summations, case distinctions and non-local pixel accesses. All expressions known at compile time are simplified and all remaining expressions are turned into MetaOCaml code parts, which are combined to form the compiled application program. The example specifications deal with filtering by convolution and iterations in a series of images for wave effects and temperature distribution. The experimental results show significant speed-ups if online partial evaluation with algebraic simplifications is used for the elimination of interpretation overhead and optimization of code expressions.
机译:我们建议将部分评估和分阶段解释与MetaOCaml结合使用,以快速开发领域特定语言的原型。解释是实现此类语言的一种简便方法。如果解释器是以分段形式编写的,即在第一阶段将源程序与输入数据分开,则MetaOCaml可以消除运行时解释的开销。使用在编译时已知的值对源程序进行部分评估可以进一步提高目标代码的性能。由于不存在一般递归,因此可能会进行其他积极的优化。在在线部分评估过程中,代数简化甚至可以改善绑定时间。我们的方法既可以使应用程序程序员完全摆脱绑定时的考虑,又可以利用MetaOCaml的分阶段解释来生成目标代码。本文介绍的示例域是图像处理,其中特定于域的语言允许指定卷积矩阵,求和,区分大小写和非局部像素访问。简化了编译时已知的所有表达式,并将所有剩余的表达式转换为MetaOCaml代码部分,将其合并以形成编译后的应用程序。示例规范通过一系列图像处理卷积和迭代进行滤波,以获取波效应和温度分布。如果使用代数简化的在线部分评估来消除解释开销和优化代码表达,则实验结果显示出明显的提速。

著录项

相似文献

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

客服邮箱:kefu@zhangqiaokeyan.com

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

  • 服务号