TY - CHAP A1 - Selgrad, Kai A1 - Lier, Alexander A1 - Wittmann, Markus A1 - Lohmann, Daniel A1 - Stamminger, Marc T1 - Defmacro for C: Lightweight, Ad Hoc Code Generation T2 - Proceedings of ELS 2014 7th European Lisp Symposium ; May 5 - 6 2014, IRCAM, Paris, France N2 - We describe the design and implementation of CGen, a C code generator with support for Common Lisp-style macro expansion. Our code generator supports the simple and efficient management of variants, ad hoc code generation to capture reoccurring patterns, composable abstractions as well as the implementation of embedded domain specific languages by using the Common Lisp macro system. We demonstrate the applicability of our approach by numerous examples from small scale convenience macros over embedded languages to real-world applications in high-performance computing. KW - Meta Programming KW - Code Generation KW - Common Lisp KW - Configurability KW - Macro KW - Maintenance Y1 - 2014 UR - https://european-lisp-symposium.org/static/proceedings/2014.pdf SN - 2677-3465 SP - 80 EP - 87 ER -