rjnw / sham

A DSL for runtime code generation in racket
MIT License
66 stars 6 forks source link

Please add link to paper #12

Open spdegabrielle opened 4 years ago

spdegabrielle commented 4 years ago

Please add link to paper https://arxiv.org/abs/2005.09028

Sham: A DSL for Fast DSLs

Rajan Walia, Chung-chieh Shan, Sam Tobin-Hochstadt 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 is itself a DSL embedded in Racket, but compiles transparently to LLVM at runtime. Sham is designed to be well suited as both a compilation target for other DSLs embedded in Racket as well as a language for transparently replacing DSL support code with faster versions. Sham programs interoperate seamlessly with Racket programs, and so no additional effort is required to use a DSL implemented with Sham. Finally, Sham comes with a framework for defining DSL compilers and transformations, which is also used in the implementation of Sham itself. 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.

spdegabrielle commented 2 years ago

13