Implicit Staging of EDSL Expressions: A Bridge between Shallow and Deep Embedding

Implicit Staging of EDSL Expressions: A Bridge between Shallow and Deep Embedding
复制标题

EDSL 表达式的隐式分级:浅嵌入和深嵌入之间的桥梁

DOI:
10.1007/978-3-662-44202-9_16
复制
发表时间:
2014
期刊:
ECOOP 2014
影响因子:
--
通讯作者:
Maximilian Scherr and Shigeru Chiba
Maximilian Scherr and Shigeru Chiba
中科院分区:
--
文献类型:
--
作者:
S.Dateki;M.Fukami;Y.Tanaka;G.Sasaki;T.Ogata;et al;Taisuke Izumi;李建権;Takai Y;Maximilian Scherr and Shigeru Chiba

文献摘要

相似文献

在通用宿主语言中嵌入DSL的常见实现方法迫使开发人员在浅(单阶段)嵌入和深(多阶段)嵌入之间进行选择,浅(单阶段)嵌入提供无缝使用,但限制了DSL开发人员,而深(多阶段)嵌入提供了随意优化的自由度,但使用起来不太无缝,并会产生额外的运行时开销。我们提出了一个元程序的方法提取特定领域的程序从用户程序进行自定义处理。这允许与深度嵌入类似的优化选项,同时仍然允许无缝嵌入使用。我们已经实现了一个简化的实例,这种方法在Java嵌入式EDSL表达式的原型框架,它依赖于加载时的反射,以提高可部署性和可用性。
Common implementation approaches for embedding DSLs in general-purpose host languages force developers to choose between ashallow(single-staged) embedding which offers seamless usage, but limits DSL developers, or adeep(multi-staged) embedding which offers freedom to optimize at will, but is less seamless to use and incurs additional runtime overhead. We propose a metaprogrammatic approach for extracting domain-specific programs from user programs for custom processing. This allows for similar optimization options as deep embedding, while still allowing for seamless embedded usage. We have implemented a simplified instance of this approach in a prototype framework for Java-embedded EDSL expressions, which relies on load-time reflection for improved deployability and usability.