A source-to-source compiler that uses Lisp macros for meta programming of C, C++, CUDA, GLSL, and OpenCL.
C-Mera is a source-to-source compiler that transforms S-expression-based notation for C-like languages into their native syntax. It leverages Common Lisp's macro system to enable powerful meta-programming without introducing new language semantics, making it a flexible tool for code generation across multiple C-family languages.
Developers working with C-family languages (C, C++, CUDA, GLSL, OpenCL) who need advanced code generation, meta-programming, or domain-specific language creation using Lisp's macro capabilities.
C-Mera provides a lightweight, extensible system for ad-hoc code generation that stays close to the semantics of target languages while harnessing the full power of Common Lisp macros, unlike traditional preprocessors or template engines.
Next-level syntax for C-like languages :)
Open-Awesome is built by the community, for the community. Submit a project, suggest an awesome list, or help improve the catalog on GitHub.
Uses Lisp-like S-expressions to represent C-like code, enabling more programmable and abstractable forms for meta-programming, as demonstrated in examples like strcmp implementation.
Supports generating code for C, C++, CUDA, GLSL, and OpenCL from a common foundation, allowing cross-language meta-programming with minimal changes, as listed in the key features.
Leverages Common Lisp's full macro system for advanced code transformation, enabling high-level paradigms like Feature-Oriented Programming without altering language semantics, referenced in the papers section.
Includes Emacs (cm-mode) and Vim plugins for syntax highlighting and indentation, facilitating development in familiar environments, with setup instructions provided.
Missing features like 'unless' and 'do-while' are noted as open issues, and some generators (e.g., OpenCL) are not actively maintained, limiting out-of-the-box usability.
Requires installing specific Lisp compilers (CCL recommended), the Clon library, and using autotools for building, which adds overhead compared to simpler tools, as detailed in Build Instructions.
The project is maintained slowly with infrequent commits, as admitted in the README, which could affect long-term support and responsiveness to issues.