Hacker News new | ask | show | jobs
by msoloviev 2795 days ago
I wrote a similar tool a while back which provides a more natural way to implement full-fledged programming language constructions such as loops (the example in the documentation here, which involves redefining a macro and explicit evaluation, feels a bit convoluted in comparison...), but is specifically tailored towards supporting C/C++: https://github.com/blackhole89/macros

I suppose the only strictly language-specific feature is the support for C string literals and it could otherwise also be made to run on top of different tokenisers.

m4 is surely more powerful still, but its syntax always struck me as somewhat jarring both on its own and in the context of any other language.