About Me‎ > ‎Projects‎ > ‎

Working With the GCC Preprocessor

posted Jun 29, 2010, 5:13 PM by Tim Rodriguez   [ updated Jul 2, 2010, 4:21 PM ]
    GCC's CPP is astoundingly powerful. When at first I believed I needed recursive macros, I have discovered today that I actually do not. I'm only limited by the implementation limits of CPP (only 65,536 arguments to a macro, and no theoretical limit for line length, as long as you don't care about debug output). I wonder if the creators ever foresaw some of the metaprogramming capabilities that I'm discovering. While type safety is a key goal of mine, I must admit some disdain for how unsafe the "internal" macros are. It is highly recommended that anyone wishing to add in complicated functionality to Cake's macros correspond with me first.

    As of this post, the $map(iterable, function, iterable, ...) macro is working, with many more functional programming methods to follow. These macros should be much easier to swallow for the average developer than the Boost Preprocessor Library's (powerful though they may be). My hope is to make version 0.1 available by September this year.