Quoted staged rewriting: a practical approach to library-defined optimizations

Quoted staged rewriting: a practical approach to library-defined optimizations
复制标题

引用的分阶段重写:库定义优化的实用方法

DOI:
--
复制
发表时间:
2017
期刊:
International Conference on Generative Programming: Concepts and Experiences
影响因子:
--
通讯作者:
Christoph E. Koch
Christoph E. Koch
中科院分区:
--
文献类型:
--
作者:
L. Parreaux;A. Shaikhha;Christoph E. Koch

文献摘要

参考文献

被引文献

相似文献

阶段已证明了一种成功地删除代码摘要的技术,从而使程序执行更快,同时保留了程序员的高级接口,不幸的是,基于分期的技术遇到了许多问题 - 从实践到基本限制不等我们的宽度采用了宽度。在模式匹配和代码重建过程中,利用分期的功率和灵活性;中间表示(IR),并且它允许进行非侵入性优化 - 与登台相比,不必调整整个库和用户程序以适应优化。 QSR和库库定义的优化比以往任何时候都更加实用:图书馆设计师编写特定于域的优化器,用户在其代码基础的划界部分中透明地调用了范围的优化器。 ))既比艺术的状态更简单,更强大,并且可以很容易地被Scala程序员使用,而没有元编程的知识。
Staging has proved a successful technique for programmatically removing code abstractions, thereby allowing for faster program execution while retaining a high-level interface for the programmer. Unfortunately, techniques based on staging suffer from a number of problems — ranging from practicalities to fundamental limitations — which have prevented their widespread adoption. We introduce Quoted Staged Rewriting (QSR), an approach that uses type-safe, pattern matching-enabled quasiquotes to define optimizations. The approach is “staged” in two ways: first, rewrite rules can execute arbitrary code during pattern matching and code reconstruction, leveraging the power and flexibility of staging; second, library designers can orchestrate the application of successive rewriting phases (stages). The advantages of using quasiquote-based rewriting are that library designers never have to deal directly with the intermediate representation (IR), and that it allows for non-intrusive optimizations — in contrast with staging, it is not necessary to adapt the entire library and user programs to accommodate optimizations. We show how Squid, a Scala macro-based framework, enables QSR and renders library-defined optimizations more practical than ever before: library designers write domain-specific optimizers that users invoke transparently on delimited portions of their code base. As a motivating example we describe an implementation of stream fusion (a well-known deforestation technique) that is both simpler and more powerful than the state of the art, and can readily be used by Scala programmers with no knowledge of metaprogramming.
DOI: 10.1145/2814204.2814208
发表时间: 2015-10
期刊: Proceedings of the 2015 ACM SIGPLAN International Conference on Generative Programming: Concepts and Experiences
影响因子: --
作者:
Roland Leißa;Klaas Boesche;Sebastian Hack;Richard Membarth;P. Slusallek
通讯作者: Roland Leißa;Klaas Boesche;Sebastian Hack;Richard Membarth;P. Slusallek