The MetaC Language

(via Keith)

The MetaC language extends C in a 100% backward compatible way with reflective features and techniques for refactoring, reconfiguring and modifying arbitrary C source code. Therefore, the extensions provide special metadata types for working with source code information, syntactical structures for the definiton of code templates, and metafunctions to gather information about source code and refactor, modify, delete, or insert code.

Comment viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.

C as its own meta-language

Interesting project.

There seems to be intrinsic appeal in making a language its own meta-language, and there are certainly advantages to this approach (e.g. you only need to know one language to write both programs and meta-programs).

MetaC is a pretty good illustration of the disadvantages of this approach:

- C isn't a very convenient language for expressing the kind of data structure-rich access and manipulation that you are likely to want for sophisticated meta-programming. In order to cope with this, MetaC seems to have exploited undefined corners of the language (e.g. out-of-bounds array accesses) to add more "convenient" behavior (e.g. growing the array to accommodate the out-of-bounds access). This just screams "kludge".
- Implementing a full C compiler/interpreter is a lot of work compared to the equivalent task for most other languages. Sure, he can probably reuse a lot of the code from the C program analyzer. But even taking that into account, you're probably still looking at more than an order of magnitude extra work compared to writing a simple Scheme interpreter.

In my opinion the real value of something like MetaC is in the C program analyzer and the API for accessing and manipulating programs in a structured and convenient way. Once he releases the code someone should tear out the MetaC language interpreter parts, and bolt on a simple interpreter as a replacement. :)

Tick C

This reminds me vaguely of `C which I don't think was ever mentioned on LtU (but I haven't checked). Another Dawson Engler (Xok/metal) related thing.

MetaC URLs

They seem to have moved the page to:

http://www.rcs.ei.tum.de/research/MetaC/index_html

Some other useful links for MetaC:

A paper.

Maier-Komor's MetaC site.