Yin-Yang: Transparent Deep Embedding of DSLs
Deep EDSLs intrinsically compromise programmer experience for improved program performance. Shallow EDSLs, complement them, by trading program performance for good programmer experience. We present Yin-Yang, a library for DSL embedding that uses compile-time meta-programming to transparently, and reliably, transform shallow EDSL programs to the equivalent deep EDSL programs. The transformation allows program prototyping and development with the shallow embedding, while the equivalent deep embedding is used where performance is of essence. Through language virtualization and a minimal interface Yin-Yang allows design of compiler agnostic EDSLs that perform domain-specific analysis at compile time while EDSLs can be compiled at both run and compile time. For run time compiled EDSLs Yin-Yang introduces guarded recompilation that significantly reduces EDSL invocation overheads. This allows EDSLs to be used in latency sensitive applications, and on small data sets. We show that Yin-Yang's transformation is reliable and obviates all embedding related annotations in a large set of applications from two non-trivial EDSLs.
Record created on 2013-04-05, modified on 2013-05-06