

CPIP – A C/C++ preprocessor implemented in Python - parados
http://cpip.sourceforge.net/

======
tbrock
Interesting. I'm just starting to learn about C++ but the sense I get is that
modern C++ is moving away from the preprocessor. One example is preferring the
use of enums and inline functions over the use of macros.

Now, that doesn't change the fact that this project is cool and could lead to
interesting developments but are preprocessor advancements a good thing in
general for C++ or is it moving backwards?

~~~
albertzeyer
Sure, where it is possible, C++ constructs (templates, inlines, constexpr,
...) should be used instead.

However, one very important bit, where we (sadly) are not really moving away
from: The include system. This is still handled all by the preprocessor.

~~~
atilaneves
We're moving away from it, it's just not done yet. I'd be surprised if C++17
doesn't have a module system, especially after the clang guys implemented one
as a proof-of-concept.

~~~
72deluxe
Interesting! Do you know if there's any proposals or papers detailing the idea
anywhere?

~~~
pjmlp
This is one of them,

[http://www.open-
std.org/jtc1/sc22/wg21/docs/papers/2014/n404...](http://www.open-
std.org/jtc1/sc22/wg21/docs/papers/2014/n4047.pdf)

The other one is the clang one

[http://clang.llvm.org/docs/Modules.html](http://clang.llvm.org/docs/Modules.html)

------
mianos
Can anyone come up with a good reason to use this instead over, say, jinja2?

~~~
parados
I doubt it. Jinja2 is a templating language for generating web pages. CPIP is
a means of understanding what the C/C++ preprocessor is up to. These are
unrelated.

