Open-Awesome
CategoriesAlternativesStacksSelf-HostedExplore
Open-Awesome

© 2026 Open-Awesome. Curated for the developer elite.

TermsPrivacyAboutGitHubRSS
  1. Home
  2. Common Lisp
  3. C-mera

C-mera

NOASSERTIONCommon Lisp

A source-to-source compiler that uses Lisp macros for meta programming of C, C++, CUDA, GLSL, and OpenCL.

GitHubGitHub
452 stars23 forks0 contributors

What is C-mera?

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.

Target Audience

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.

Value Proposition

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.

Overview

Next-level syntax for C-like languages :)

Use Cases

Best For

  • Generating C, C++, CUDA, GLSL, or OpenCL code from a common S-expression notation.
  • Implementing high-level programming paradigms like Feature-Oriented Programming in C-like languages via Lisp macros.
  • Creating domain-specific languages (DSLs) for high-performance graphics or image processing applications.
  • Exploring implementation variants and generative programming for performance-critical code.
  • Writing structured, programmable representations of C-like code with editor support (Emacs/Vim).
  • Extending code generation to new C-like languages by building on C-Mera's core.

Not Ideal For

  • Projects requiring actively maintained, full-featured support for all C-family languages (e.g., OpenCL is noted as not actively maintained)
  • Teams without any Common Lisp expertise, as meta-programming heavily depends on Lisp macros
  • Environments where simple, dependency-light build processes are critical, due to requirements for specific Lisp compilers and autotools

Pros & Cons

Pros

Structured S-expression Syntax

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.

Multi-language Code Generation

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.

Extensible via Lisp Macros

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.

Editor Integration

Includes Emacs (cm-mode) and Vim plugins for syntax highlighting and indentation, facilitating development in familiar environments, with setup instructions provided.

Cons

Incomplete Language Support

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.

Complex Setup and Dependencies

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.

Slow Maintenance Pace

The project is maintained slowly with infrequent commits, as admitted in the README, which could affect long-term support and responsiveness to issues.

Frequently Asked Questions

Quick Stats

Stars452
Forks23
Contributors0
Open Issues23
Last commit5 months ago
CreatedSince 2015

Tags

#cuda#s-expressions#opencl#c-plus-plus#meta-programming#glsl#source-to-source-compiler#c-language#code-generation#common-lisp

Built With

A
ASDF
C
CCL
S
SBCL
Q
Quicklisp
C
Common Lisp

Included in

Common Lisp2.9k
Auto-fetched 1 day ago

Related Projects

lispclispc

"Lispsy" Lisp(ish) to C Converter (designed for CLISP)

Stars548
Forks37
Last commit4 years ago
sxqlsxql

An SQL generator for Common Lisp.

Stars423
Forks37
Last commit8 months ago
composable query buildercomposable query builder

An SQL generator for Common Lisp.

Stars423
Forks37
Last commit8 months ago
vacietisvacietis

C to Common Lisp compiler

Stars320
Forks25
Last commit4 years ago
Community-curated · Updated weekly · 100% open source

Found a gem we're missing?

Open-Awesome is built by the community, for the community. Submit a project, suggest an awesome list, or help improve the catalog on GitHub.

Submit a projectStar on GitHub