【24h】

CodeBricks: Code Fragments as Building Blocks

机译:CodeBricks:代码片段作为构建块

获取原文
获取原文并翻译 | 示例
获取外文期刊封面目录资料

摘要

We present a framework for code generation that allows programs to manipulate and generate code at the source level while the joining and splicing of exceutable code is carried out automatically at the intermediate code/VM level. The framework introduces a data type Code to represent code fragments: methods/operators from this class are used to reify a method from a class, producing its representatin as an object of type Code. Code objects can be combined by partial application to other Code objects. Code combinators, corresponding to higher-order methods, allow splicing the code of a functional actual parameter into the resulting Code object. CodeBricks is a library implementing the framework for the NET Common Language Runtime. The framework can be exploited by language designers to implement metaprogramming, multistage programming and other language features. We illustrate the use of the technique in the implementation of a fully featured regular expression compiler that generates code emulating a finite state automaton. We present benchmarks comparing the performance of the RE matcher built with CodeBricks with the hand written one present in. NET.
机译:我们提出了一种代码生成框架,该框架允许程序在源代码级别操纵和生成代码,而可交换代码的联接和拼接在中间代码/ VM级别自动进行。该框架引入了一个数据类型Code来表示代码片段:此类中的方法/运算符用于对类中的方法进行验证,将其表示形式生成为Code类型的对象。可以通过部分应用将代码对象组合到其他代码对象。对应于高阶方法的代码组合器允许将功能实际参数的代码拼接到生成的Code对象中。 CodeBricks是一个库,用于实现NET Common Language Runtime的框架。语言设计师可以利用该框架来实现元编程,多阶段编程和其他语言功能。我们将说明该技术在功能齐全的正则表达式编译器的实现中的使用,该编译器会生成模拟有限状态自动机的代码。我们提供了基准,将使用CodeBricks构建的RE匹配器的性能与.NET中的手写内容进行了比较。

著录项

相似文献

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

客服邮箱:kefu@zhangqiaokeyan.com

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

  • 服务号