Have your C, and eat it too.
Cake - The C Advanced Keystone Environment, is a collection of metaprogramming tools written in GNU C for GNU C. It is not a library itself, as it will only be available in source and is meant to accelerate prototyping. Certain components may require a modified preprocessor in the future, but so far in its development, I haven't needed to modify gcc's preprocessor. Cake will be licensed under the Mozilla Public License (or alternatively under the Simple BSD License) and any changes made to gcc will remain under the GNU General Public License. C can be THE ideal programming language as described here—it just needs the love and generosity of some gurus.
Since Cake will be available in source only, the developer must include the files that they wish to use as headers. It may not be the most efficient C library in terms of space or time (it's certainly no lightweight), but I do aim for this to enable rapid prototyping of quality code in C.
I must list some caveats:
- Cake will be one of the most useful examples of C Preprocessor abuse you will ever encounter; as such, there are some macro functions to learn, but nothing unexpected, and it will ensure the safety of your code with compile-time errors. All macros will be documented, and because this is distributed in source-only form, you are free to look at each one as it is defined. Rather than compete with existing namespaces, the macro functions of Cake will always be prefixed with "$", but the developer may disable these in favor of CAPS macros which (for the most part) will be almost identical. And for the truly brave, you can run your code through gcc -E and see what it spits out.
- Cake is NOT portable C99. It is meant to be used only with gcc and some sections may eventually require their own compiler based on gcc. That said, gcc itself is pretty portable, so any sections of your project that you wish to write with Cake can be compiled using gcc and linked to the rest of your project with your compiler of choice (remembering, of course to comply with the licenses).
- I offer NO GUARANTEE OF BACKWARDS COMPATIBILITY before this project is stamped with a 1.0 version number.
- Beware the extra power offered by this environment, early adopters; just because it looks like an interpreted language doesn't mean it'll manage your memory for you. Efforts are made to reduce the number of memory leaks, but this is still C: the responsibility is yours.
- Try to keep variable types & qualifiers reduced to single tokens with typedef.