Hacker News new | ask | show | jobs
by ot 4675 days ago
An impressive application of the C preprocessor is the Boost.Preprocessor library [1]. It basically implements a primitive (and bounded) version of Lisp inside the preprocessor.

I used it once to write DSLs to define data structures, where a few lines of code were expanded to hundreds of lines of templates, (de)serialization code, etc...

[1] http://www.boostpro.com/mplbook/preprocessor.html