Domain-specific languages (DSLs) are touted as both easy to embed in programs and easy to optimize. Yet these goals are often in tension. Embedded or internal DSLs fit naturally with a host language, while inheriting the host's performance characteristics. External DSLs can use external optimizers and languages but sit apart from the host. We present Sham, a toolkit designed to enable internal DSLs with high performance. Sham provides a domain-specific language (embedded in Racket) for implementing other high-performance DSLs, with transparent compilation to assembly code at runtime. Sham is well suited as both a compilation target for other embedded DSLs and for transparently replacing DSL support code with faster versions. Sham provides seamless inter-operation with its host language without requiring any additional effort from its users. Sham also provides a framework for defining language syntax which implements Sham's own language interface as well. We validate Sham's design on a series of case studies, ranging from Krishnamurthi's classic automata DSL to a sound synthesis DSL and a probabilistic programming language. All of these are existing DSLs where we replaced the backend using Sham, resulting in major performance gains. We present an example-driven description of how Sham can smoothly enhance an existing DSL into a high-performance one. When compared to existing approaches for implementing high-performance DSLs, Sham's design aims for both simplicity and programmer control. This makes it easier to port our techniques to other languages and frameworks, or borrow Sham's innovations "\`a la carte" without adopting the whole approach. Sham builds a sophisticated and powerful DSL construction toolkit atop fundamental language features including higher-order functions, data structures, and a foreign-function interface (FFI), all readily available in other languages. Furthermore, Sham's approach allows DSL developers to simply write functions, either using Sham or generating Sham, without needing to work through complex staging or partial evaluation systems.


翻译:域名语言( DSL) 被形容为容易嵌入程序且容易优化。 但这些目标往往处于紧张状态。 嵌入式或内部 DSL 与主机语言自然匹配, 同时继承主机的性能特性。 外部 DSL 可以使用外部优化和语言, 但与主机不同。 我们提供 Sham, 这是设计内部 DSL 的工具包, 使内部 DSL 能够使用高性能。 Sham 提供了一种域名语言( 在 Racket 中嵌入), 用于实施其他高性能 DSL, 透明地编译到运行代码代码代码代码代码。 ShamSL 既适合用于其他嵌入式 DSL, 也适合以透明的方式替换 DSLF 支持代码。 ShamFF 系统还提供一个框架, 用来定义语言的语协, 用于实施 Shammal 自己的语言接口。 我们通过 Sladmurth 和 Slade DSL 的典型的D 方法, 也可以将SL 用于当前运行, 以及当前运行中的一种快速的系统 。

0
下载
关闭预览

相关内容

【2020新书】Python文本分析,104页pdf
专知会员服务
100+阅读 · 2020年12月23日
专知会员服务
53+阅读 · 2020年9月7日
Linux导论,Introduction to Linux,96页ppt
专知会员服务
79+阅读 · 2020年7月26日
因果图,Causal Graphs,52页ppt
专知会员服务
249+阅读 · 2020年4月19日
强化学习最新教程,17页pdf
专知会员服务
177+阅读 · 2019年10月11日
【哈佛大学商学院课程Fall 2019】机器学习可解释性
专知会员服务
104+阅读 · 2019年10月9日
已删除
将门创投
5+阅读 · 2019年9月10日
Hierarchically Structured Meta-learning
CreateAMind
26+阅读 · 2019年5月22日
IEEE | DSC 2019诚邀稿件 (EI检索)
Call4Papers
10+阅读 · 2019年2月25日
逆强化学习-学习人先验的动机
CreateAMind
16+阅读 · 2019年1月18日
无监督元学习表示学习
CreateAMind
27+阅读 · 2019年1月4日
大神 一年100篇论文
CreateAMind
15+阅读 · 2018年12月31日
A Technical Overview of AI & ML in 2018 & Trends for 2019
待字闺中
17+阅读 · 2018年12月24日
Hierarchical Disentangled Representations
CreateAMind
4+阅读 · 2018年4月15日
【推荐】树莓派/OpenCV/dlib人脸定位/瞌睡检测
机器学习研究会
9+阅读 · 2017年10月24日
【学习】Hierarchical Softmax
机器学习研究会
4+阅读 · 2017年8月6日
Learning to Weight for Text Classification
Arxiv
8+阅读 · 2019年3月28日
Accelerated Methods for Deep Reinforcement Learning
Arxiv
6+阅读 · 2019年1月10日
VIP会员
相关VIP内容
【2020新书】Python文本分析,104页pdf
专知会员服务
100+阅读 · 2020年12月23日
专知会员服务
53+阅读 · 2020年9月7日
Linux导论,Introduction to Linux,96页ppt
专知会员服务
79+阅读 · 2020年7月26日
因果图,Causal Graphs,52页ppt
专知会员服务
249+阅读 · 2020年4月19日
强化学习最新教程,17页pdf
专知会员服务
177+阅读 · 2019年10月11日
【哈佛大学商学院课程Fall 2019】机器学习可解释性
专知会员服务
104+阅读 · 2019年10月9日
相关资讯
已删除
将门创投
5+阅读 · 2019年9月10日
Hierarchically Structured Meta-learning
CreateAMind
26+阅读 · 2019年5月22日
IEEE | DSC 2019诚邀稿件 (EI检索)
Call4Papers
10+阅读 · 2019年2月25日
逆强化学习-学习人先验的动机
CreateAMind
16+阅读 · 2019年1月18日
无监督元学习表示学习
CreateAMind
27+阅读 · 2019年1月4日
大神 一年100篇论文
CreateAMind
15+阅读 · 2018年12月31日
A Technical Overview of AI & ML in 2018 & Trends for 2019
待字闺中
17+阅读 · 2018年12月24日
Hierarchical Disentangled Representations
CreateAMind
4+阅读 · 2018年4月15日
【推荐】树莓派/OpenCV/dlib人脸定位/瞌睡检测
机器学习研究会
9+阅读 · 2017年10月24日
【学习】Hierarchical Softmax
机器学习研究会
4+阅读 · 2017年8月6日
Top
微信扫码咨询专知VIP会员