BuildIt: A Type-Based Multi-stage Programming Framework for Code Generation in C++

Authors: Ajay Brahmakshatriya and Saman Amarasinghe, CSAIL, MIT Abstract: The simplest implementation of a domain-specific language is to embed it in an existing language using operator overloading. This way, the DSL can inherit parsing, syntax and type checking, error handling, and the toolchain of debuggers and IDEs from the host language. A natural host language choice for most high-performance DSLs is the de-facto high-performance language, C++. However, DSL designers quickly run into the problem of not being able to extract control flows due to a lack of introspection in C++ and have to resort to special functions with lambdas to represent loops and conditionals....

May 10, 2023 ยท Rupanshu